Add missing header to shmget(2)

Authored by sevan on Aug 12 2017, 4:25 PM.


Group Reviewers
Src Committers
rS322432: Add missing header.

S_IRUSR is defined in sys/stat.h

Bug 209229

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
sevan created this revision.Aug 12 2017, 4:25 PM
bcr accepted this revision.Aug 12 2017, 4:39 PM

OK, go ahead with this.

This revision is now accepted and ready to land.Aug 12 2017, 4:39 PM
This revision was automatically updated to reflect the committed changes.
jilles added a subscriber: jilles.Aug 12 2017, 6:25 PM

This is internally consistent, but does not match what POSIX says. POSIX says only <sys/shm.h> is required and the permissions should be coded using octal constants (yuck). However, if a programmer wants to use S_IRUSR and the like, that is fine. POSIX defines the exact values these constants should have. I don't think POSIX needs to be followed exactly in this.

Note that <sys/ipc.h> can safely be removed from this list. POSIX says <sys/shm.h> should include <sys/ipc.h> and that is what we implement.

Also, it seems like <sys/types.h> can be removed. A shmget() invocation will compile and run with only #include <sys/shm.h>.