classification
Title: Python-2.5.2/Modules/mmapmodule.c:915: error: `O_RDWR' undeclared
Type: compile error Stage:
Components: Build Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, jackdied, loewis, mmokrejs, pitrou, terry.reedy
Priority: normal Keywords:

Created on 2008-07-03 00:14 by mmokrejs, last changed 2013-07-08 00:02 by christian.heimes. This issue is now closed.

Messages (6)
msg69153 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2008-07-03 00:14
Some typo in the sources showing up on Solaris 2.6 only?

building 'mmap' extension
gcc -shared -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -I. -I/usr/scratch/Python-2.5.2/./Include -I.
-IInclude -I./Include -I/usr/local/include
-I/usr/scratch/Python-2.5.2/Include -I/usr/scratch/Python-2.5.2 -c
/usr/scratch/Python-2.5.2/Modules/mmapmodule.c -o
build/temp.solaris-2.6-sun4u-2.5/usr/scratch/Python-2.5.2/Modules/mmapmodule.o
/usr/scratch/Python-2.5.2/Modules/mmapmodule.c: In function
`new_mmap_object':
/usr/scratch/Python-2.5.2/Modules/mmapmodule.c:915: warning: implicit
declaration of function `open'
/usr/scratch/Python-2.5.2/Modules/mmapmodule.c:915: error: `O_RDWR'
undeclared (first use in this function)
/usr/scratch/Python-2.5.2/Modules/mmapmodule.c:915: error: (Each
undeclared identifier is reported only once
/usr/scratch/Python-2.5.2/Modules/mmapmodule.c:915: error: for each
function it appears in.)
msg69166 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-07-03 06:24
Why do you think there is a typo? O_RDWR is a valid constant that should
be provided on all Unix-like systems.

Can you please find out from the open(2) man page: a) whether Solaris
2.6 supports the O_RDWR constant, b) what header files to include, and
c) whether including these header files solves the problem?
msg69175 - (view) Author: Martin Mokrejs (mmokrejs) Date: 2008-07-03 06:56
So adding these two lines helped:

# diff /usr/scratch/Python-2.5.2/Modules/mmapmodule.c.ori
/usr/scratch/Python-2.5.2/Modules/mmapmodule.c
36a37
> #include <sys/types.h>
38a40
> #include <fcntl.h>
#
msg84226 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2009-03-26 21:57
survey of other modules that use O_RDRW
The following include sys/type.h and fcntl.h unconditionally:
  bsdmodule.c, dbmmoudle.c, _fileio.c

posixmodule.c includes them after doing an #ifdef check

mmapmodule.c currently (2.7 trunk) includes sys/types.h with an ifdef
check, but fcntl.h not at all.
msg112656 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-03 19:35
Still a problem with 2.7 or later?
msg192603 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-08 00:02
Compilation works on Solaris 10 and 11 for quite some time. Please reopen the bug report if you still have issues.
History
Date User Action Args
2013-07-08 00:02:39christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg192603

type: compile error
resolution: fixed
2010-08-03 19:35:32terry.reedysetnosy: + terry.reedy

messages: + msg112656
versions: + Python 2.7, - Python 2.5
2009-03-26 21:57:15jackdiedsetnosy: + jackdied
messages: + msg84226
2009-01-01 02:35:51pitrousetnosy: + pitrou
2008-07-03 06:56:07mmokrejssetmessages: + msg69175
2008-07-03 06:24:44loewissetnosy: + loewis
messages: + msg69166
2008-07-03 00:14:13mmokrejscreate