Bug 23366

Summary: mmap() non conforming
Product: Base System Reporter: dwhedon <dwhedon>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description dwhedon 2000-12-07 23:10:01 UTC
mmap() as defined by the open group doesn't need sys/types.h included:
http://www.opengroup.org/onlinepubs/007908799/xsh/mmap.html

However, on FreeBSD it is required.  This breaks applications that 
conform to the SuS.		

How-To-Repeat: bash-2.03$ more test.c
#include <sys/mman.h>
main(){
}
bash-2.03$ gcc test.c
In file included from test.c:1:
/usr/include/sys/mman.h:134: syntax error before `mode_t'
/usr/include/sys/mman.h:137: syntax error before `size_t'
etc.
Comment 1 Garrett A. Wollman 2000-12-10 18:18:21 UTC
<<On Thu, 7 Dec 2000 15:03:13 -0800 (PST), dwhedon@gordian.com said:

> mmap() as defined by the open group doesn't need sys/types.h included:

mmap() as defined by BSD does.

Having said that, we will be making such a change soon, in 5.x only,
for compatibility with the forthcoming revision of POSIX.  Please be
patient.

-GAWollman
Comment 2 Jens Schweikhardt freebsd_committer freebsd_triage 2002-09-29 15:13:32 UTC
State Changed
From-To: open->patched

Current no longer requires sys/types.h and the example works.
Comment 3 Mike Barcroft freebsd_committer freebsd_triage 2002-11-17 17:04:09 UTC
State Changed
From-To: patched->closed

I don't plan to MFC this, so there isn't much point in keeping it 
open.