Bug 209229 - [PATCH] shmget(2) missing includes
Summary: [PATCH] shmget(2) missing includes
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Documentation (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sevan Janiyan
URL: https://reviews.freebsd.org/D12007
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-05-03 09:37 UTC by mt
Modified: 2017-08-12 17:49 UTC (History)
1 user (show)

See Also:


Attachments
patch for shmget(2) (283 bytes, text/plain)
2016-05-03 09:37 UTC, mt
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mt 2016-05-03 09:37:01 UTC
Created attachment 169907 [details]
patch for shmget(2)

Hi,

shmget(2) man page says to include sys/types.h which is not necessary. Instead
sys/stat.h should be used because it contains S_IRUSR (and others).

Without sys/stat.h the compiler throws an error:
sgt.c:7:37: error: use of undeclared identifier 'S_IRUSR'

I have attached the patch.

BR,
Marko
Comment 1 mt 2016-07-29 18:21:36 UTC
Hi,

can anybody confirm this?

Maybe the definitions of S_IRUSR (and others) should be moved to some other include file?

-Marko
Comment 2 Sevan Janiyan freebsd_committer 2017-08-12 16:24:25 UTC
(In reply to mt from comment #1)
You're right, sys/stat.h is needed. But sys/types.h is also needed.
It's defined in the correct location as per http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysstat.h.html
Comment 3 commit-hook freebsd_committer 2017-08-12 17:47:08 UTC
A commit references this bug:

Author: sevan
Date: Sat Aug 12 17:46:51 UTC 2017
New revision: 322432
URL: https://svnweb.freebsd.org/changeset/base/322432

Log:
  Add missing header.
  S_IRUSR is defined in sys/stat.h

  PR:		209229
  Submitted by:	<mt AT markoturk DOT info>
  Approved by:	bcr (mentor)
  MFC after:	5 days
  Differential Revision:	https://reviews.freebsd.org/D12007

Changes:
  head/lib/libc/sys/shmget.2
Comment 4 Sevan Janiyan freebsd_committer 2017-08-12 17:49:04 UTC
Committed, thanks for the patch & apologies for the delay.