Bug 21644 - /usr/include/sys/mman.h uses a type defined in /usr/include/sys/types.h
Summary: /usr/include/sys/mman.h uses a type defined in /usr/include/sys/types.h
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mike Barcroft
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-09-29 11:10 UTC by TOGAWA Satoshi
Modified: 2002-08-23 21:09 UTC (History)
0 users

See Also:


Attachments
file.diff (317 bytes, patch)
2000-09-29 11:10 UTC, TOGAWA Satoshi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TOGAWA Satoshi 2000-09-29 11:10:04 UTC
In /usr/include/sys/mman.h , 

line 134
int     shm_open __P((const char *, int, mode_t));

but type "mode_t" is defined in /usr/include/sys/types.h.
And mman.h don't include types.h. So using mman.h, without
including types.h, causes compile error.

I hope that mman.h includes types.h.

How-To-Repeat: Including /usr/include/sys/mman.h , without including /usr/include/sys/types.h in above.
Comment 1 toga 2000-09-29 11:15:22 UTC
*** /usr/include/sys/mman.h	Thu Jul 27 12:06:39 2000
--- ./mman.h	Fri Sep 29 18:59:47 2000
***************
*** 129,134 ****
--- 129,135 ----
  
  __BEGIN_DECLS
  #ifdef _P1003_1B_VISIBLE
+ #include <sys/types.h>
  int	mlockall __P((int));
  int	munlockall __P((void));
  int	shm_open __P((const char *, int, mode_t));
Comment 2 Peter Pentchev 2000-09-29 11:34:02 UTC
On Fri, Sep 29, 2000 at 03:05:19AM -0700, toga@puyo.org wrote:
> >Synopsis:       /usr/include/sys/mman.h uses a type defined in /usr/include/sys/types.h
[snip]
> >Description:
> In /usr/include/sys/mman.h , 
> 
> line 134
> int     shm_open __P((const char *, int, mode_t));
> 
> but type "mode_t" is defined in /usr/include/sys/types.h.
> And mman.h don't include types.h. So using mman.h, without
> including types.h, causes compile error.

Uhm.. the shm_open(3) manpage lists both <sys/types.h> and <sys/mman.h>
as headers you should include when using shm_open().  That is, on FreeBSD,
this is a well documented header dependency.

It is true, though, that SUSv2 says shm_open() should only need <sys/mman.h> -
http://www.opengroup.org/onlinepubs/007908799/xsh/shm_open.html

G'luck,
Peter

-- 
This sentence contains exactly threee erors.
Comment 3 Johan Karlsson freebsd_committer 2002-08-22 20:28:49 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-standards

Apperently SUSv2 thinks this should be changed.
Comment 4 Mike Barcroft freebsd_committer 2002-08-23 07:11:29 UTC
Responsible Changed
From-To: freebsd-standards->mike


Over to me.
Comment 5 Mike Barcroft freebsd_committer 2002-08-23 21:06:57 UTC
State Changed
From-To: open->closed


Fixed in 5.0-CURRENT.  No plans to MFC.