Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python-2.5.2/Modules/mmapmodule.c:915: error: `O_RDWR' undeclared #47516

Closed
mmokrejs mannequin opened this issue Jul 3, 2008 · 6 comments
Closed

Python-2.5.2/Modules/mmapmodule.c:915: error: `O_RDWR' undeclared #47516

mmokrejs mannequin opened this issue Jul 3, 2008 · 6 comments
Labels
build The build process and cross-build

Comments

@mmokrejs
Copy link
Mannequin

mmokrejs mannequin commented Jul 3, 2008

BPO 3266
Nosy @loewis, @terryjreedy, @pitrou, @jackdied, @tiran

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2013-07-08.00:02:39.743>
created_at = <Date 2008-07-03.00:14:13.640>
labels = ['build']
title = "Python-2.5.2/Modules/mmapmodule.c:915: error: `O_RDWR' undeclared"
updated_at = <Date 2013-07-08.00:02:39.741>
user = 'https://bugs.python.org/mmokrejs'

bugs.python.org fields:

activity = <Date 2013-07-08.00:02:39.741>
actor = 'christian.heimes'
assignee = 'none'
closed = True
closed_date = <Date 2013-07-08.00:02:39.743>
closer = 'christian.heimes'
components = ['Build']
creation = <Date 2008-07-03.00:14:13.640>
creator = 'mmokrejs'
dependencies = []
files = []
hgrepos = []
issue_num = 3266
keywords = []
message_count = 6.0
messages = ['69153', '69166', '69175', '84226', '112656', '192603']
nosy_count = 6.0
nosy_names = ['loewis', 'terry.reedy', 'mmokrejs', 'pitrou', 'jackdied', 'christian.heimes']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue3266'
versions = ['Python 2.7']

@mmokrejs
Copy link
Mannequin Author

mmokrejs mannequin commented Jul 3, 2008

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.)

@mmokrejs mmokrejs mannequin added the build The build process and cross-build label Jul 3, 2008
@loewis
Copy link
Mannequin

loewis mannequin commented Jul 3, 2008

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?

@mmokrejs
Copy link
Mannequin Author

mmokrejs mannequin commented Jul 3, 2008

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>

@jackdied
Copy link
Contributor

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.

@terryjreedy
Copy link
Member

Still a problem with 2.7 or later?

@tiran
Copy link
Member

tiran commented Jul 8, 2013

Compilation works on Solaris 10 and 11 for quite some time. Please reopen the bug report if you still have issues.

@tiran tiran closed this as completed Jul 8, 2013
@tiran tiran added the build The build process and cross-build label Jul 8, 2013
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build
Projects
None yet
Development

No branches or pull requests

3 participants