Hello,

sys/mman.h has a check so that

#if (_POSIX_C_SOURCE > 2) || defined(_XPG4_2)

mincore() will not be defined. Is this intentional? Why would it disappear if 
you ask for a newer POSIX standard?

However, unistd.h has:

#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
extern int mincore(caddr_t, size_t, char *);
#endif

This leads to code that includes <sys/types.h>, as per the mincore() manpage, 
and uses mincore(), but does not compile with g++, but does compile with gcc. 
Presumably due to different default feature macros. If one happens to include 
<unistd.h> it ends up compiling.

I am not sure where the bug lies... is it correct for mman.h not to include 
mincore() for _POSIX_C_SOURCE > 2 || defined(_XPG4_2)? Other platforms do not 
seem to exclude them (FreeBSD at least (tested), and I have reason to believe 
the same is true of netbsd/dragonfly/linux aswell).

Even if it is correct for mincore() to be exluded for certain POSIX levels or 
similar; is not the unistd definition inconsistent?

-- 
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0xE9758B7D or 'Peter Schuller <[EMAIL PROTECTED]>'
Key retrieval: Send an E-Mail to [EMAIL PROTECTED]
E-Mail: [EMAIL PROTECTED] Web: http://www.scode.org

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to