Bug 225905 - shmget man page misses #include "sys/stat.h"
Summary: shmget man page misses #include "sys/stat.h"
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Books & Articles (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-15 02:23 UTC by Stefan B.
Modified: 2018-03-12 16:04 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan B. 2018-02-15 02:23:58 UTC
PROBLEM:

In the shmget() man page, the S_IRUSR, S_IWUSR etc are mentioned.
This forces one has grep first to find out what #include file directive has to be added.

SOLUTION:

Add a line «#include "sys/stat.h"» to the synopsis.
Comment 1 Brooks Davis freebsd_committer freebsd_triage 2018-02-15 17:41:12 UTC
I was curious what the standards compliant thing to do here was and it's apparently to be completely unhelpful and not say what the mode bit mean except in some other badly referenced document (having checked Solaris, Linux, and POSIX).  We have some internal defines which are documented in semget.2.  I wonder if we'd be better off switching to the SHM_[RW] version of that text (and adding it to msgget).  That would avoid the need for more headers.
Comment 2 Stefan B. 2018-02-15 21:05:35 UTC
(In reply to Brooks Davis from comment #1)
This confusion seems common. I saw there are various definitions.
Some programs even have their own ones.

Maybe it would be most helpful to also note that it are the same constants like in the common unix perms model, i.e. 0400, 0200, etc. (at least afaiu)
Comment 3 Brooks Davis freebsd_committer freebsd_triage 2018-02-21 19:16:43 UTC
I've proposed a possible fix in https://reviews.freebsd.org/D14461
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-03-04 20:06:39 UTC
A commit references this bug:

Author: brooks
Date: Sun Mar  4 20:06:02 UTC 2018
New revision: 330409
URL: https://svnweb.freebsd.org/changeset/base/330409

Log:
  Refer to SysV IPC permissions as numeric constants.

  POSIX defines no macros for these permissions.

  Also remove unneeded headers from synopsis.

  PR:		225905
  Reviewed by:	wblock
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D14461

Changes:
  head/lib/libc/sys/msgget.2
  head/lib/libc/sys/semget.2
  head/lib/libc/sys/shmget.2
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-03-12 15:58:40 UTC
A commit references this bug:

Author: brooks
Date: Mon Mar 12 15:57:56 UTC 2018
New revision: 330800
URL: https://svnweb.freebsd.org/changeset/base/330800

Log:
  MFC r330409:

  Refer to SysV IPC permissions as numeric constants.

  POSIX defines no macros for these permissions.

  Also remove unneeded headers from synopsis.

  PR:		225905
  Reviewed by:	wblock
  Differential Revision:	https://reviews.freebsd.org/D14461

Changes:
_U  stable/11/
  stable/11/lib/libc/sys/msgget.2
  stable/11/lib/libc/sys/semget.2
  stable/11/lib/libc/sys/shmget.2
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-03-12 16:04:47 UTC
A commit references this bug:

Author: brooks
Date: Mon Mar 12 16:04:11 UTC 2018
New revision: 330801
URL: https://svnweb.freebsd.org/changeset/base/330801

Log:
  MFC r330409:

  Refer to SysV IPC permissions as numeric constants.

  POSIX defines no macros for these permissions.

  Also remove unneeded headers from synopsis.

  PR:		225905
  Reviewed by:	wblock
  Differential Revision:	https://reviews.freebsd.org/D14461

Changes:
_U  stable/10/
  stable/10/lib/libc/sys/msgget.2
  stable/10/lib/libc/sys/semget.2
  stable/10/lib/libc/sys/shmget.2