This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: O_RDWR undefined in mmapmodule.c
Type: compile error Stage: resolved
Components: Extension Modules Versions: Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Jeffrey.Armstrong, christian.heimes, python-dev
Priority: normal Keywords: patch

Created on 2015-05-17 15:20 by Jeffrey.Armstrong, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
mmapmodule.py3.5.0a3.HAVE_FCNTL_H.diff Jeffrey.Armstrong, 2015-05-17 15:29 Patch for mmapmodule to include fcntl.h explicitly on all UNIX-y platforms
Messages (5)
msg243404 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2015-05-17 15:20
While compiling on Linux/x86 with Open Watcom, I've run into the following at link time in Modules/mmapmodule.c:

./Modules/mmapmodule.c(1223): Error! E1011: Symbol 'O_RDWR' has not been declared

The constant isn't defined because fcntl.h isn't included.  Looking at the top of the file, it appears that, for the Apple platform only, this header is included, but no others.

In order to support more runtime libraries outside of GNU libc, I would suggest including fcntl.h for all UNIX-y platforms, especially because the POSIX standard dictates that this constant be defined in fcntl.h.  I don't know how it finds its way in under GCC/GNU libc, but an explicit include might be better.
msg243406 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2015-05-17 15:24
I think it's more portable with a #ifdef HAVE_FCNTL_H block around the include.
msg243407 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2015-05-17 15:29
Indeed, I agree.  Let's try this new patch.
msg247878 - (view) Author: Jeffrey Armstrong (Jeffrey.Armstrong) * Date: 2015-08-02 15:27
There is a patch attached to this report for greater than 2 months. Should I mark this as "won't fix?"
msg247890 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-08-02 19:17
New changeset 1838f37a8d9e by Benjamin Peterson in branch '3.4':
include fcntl.h on all *nix platforms (closes #24217)

New changeset 25ba5e7af08a by Benjamin Peterson in branch '3.5':
Merge 3.4 (#24217)

New changeset 4ed9cc2203b3 by Benjamin Peterson in branch 'default':
merge 3.5 (#24217)

New changeset 2e635a0e0207 by Benjamin Peterson in branch '2.7':
include fcntl.h on all *nix platforms (closes #24217)
Date User Action Args
2022-04-11 14:58:17adminsetgithub: 68405
2015-08-02 19:17:49python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg247890

resolution: fixed
stage: resolved
2015-08-02 15:27:26Jeffrey.Armstrongsetmessages: + msg247878
2015-05-17 15:29:37Jeffrey.Armstrongsetfiles: - mmapmodule.py3.5.0a3.diff
2015-05-17 15:29:11Jeffrey.Armstrongsetfiles: + mmapmodule.py3.5.0a3.HAVE_FCNTL_H.diff

messages: + msg243407
2015-05-17 15:24:35christian.heimessetnosy: + christian.heimes
messages: + msg243406
2015-05-17 15:20:16Jeffrey.Armstrongcreate