gh-113343: Fix error check on mmap(2)#113342
Conversation
It should check MAP_FAILED instead of NULL for error.
On mmap(2) man page:
RETURN VALUE
On success, mmap() returns a pointer to the mapped area.
On error, the value MAP_FAILED (that is, (void *) -1) is
returned, and errno is set to indicate the error.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Would you like to create an issue for this too? |
|
@pablogsal I created the issue for this PR and linked it, so you can merge this PR anytime. |
|
@corona10 Thanks for doing that. I'm not familiar with the python dev process so I didn't know it's needed to create an issue first for this kind of mior problems. |
For typos, we usually skip but for the technical things, I prefer to create it to track the history. |
|
Thanks @namhyung for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
GH-113374 is a backport of this pull request to the 3.12 branch. |
Fix error check on mmap(2)
It should check MAP_FAILED instead of NULL for error.
On mmap(2) man page:
RETURN VALUE
On success, mmap() returns a pointer to the mapped area.
On error, the value MAP_FAILED (that is, (void *) -1) is
returned, and errno is set to indicate the error.
(cherry picked from commit 6b70c3d)
Co-authored-by: Namhyung Kim <namhyung@gmail.com>
|
Thanks for the PR @namhyung and congrats on your first PR in CPython :) |
|
@pablogsal and @corona10 thanks for your help! |
gh-113343: Fix error check on mmap(2) (GH-113342) Fix error check on mmap(2) It should check MAP_FAILED instead of NULL for error. On mmap(2) man page: RETURN VALUE On success, mmap() returns a pointer to the mapped area. On error, the value MAP_FAILED (that is, (void *) -1) is returned, and errno is set to indicate the error. (cherry picked from commit 6b70c3d) Co-authored-by: Namhyung Kim <namhyung@gmail.com>
Fix error check on mmap(2)
It should check MAP_FAILED instead of NULL for error.
On mmap(2) man page:
RETURN VALUE
On success, mmap() returns a pointer to the mapped area.
On error, the value MAP_FAILED (that is, (void *) -1) is
returned, and errno is set to indicate the error.
Fix error check on mmap(2)
It should check MAP_FAILED instead of NULL for error.
On mmap(2) man page:
RETURN VALUE
On success, mmap() returns a pointer to the mapped area.
On error, the value MAP_FAILED (that is, (void *) -1) is
returned, and errno is set to indicate the error.
Fix error check on mmap(2)
It should check MAP_FAILED instead of NULL for error.
On mmap(2) man page:
RETURN VALUE
On success, mmap() returns a pointer to the mapped area.
On error, the value MAP_FAILED (that is, (void *) -1) is
returned, and errno is set to indicate the error.
Fix error check on mmap(2)
It should check MAP_FAILED instead of NULL for error.
On mmap(2) man page:
RETURN VALUE
On success, mmap() returns a pointer to the mapped area.
On error, the value MAP_FAILED (that is, (void *) -1) is
returned, and errno is set to indicate the error.
According to the man page, mmap(2) returns MAP_FAILED (-1) on error instead of NULL.