HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)

s
shmop(2) shmop(2)
[EACCES] Operation permission is denied to the calling process.
[EINVAL] shmid is not a valid shared memory identifier, (possibly because the shared memory seg-
ment was already removed using shmctl(2) with
IPC_RMID), or the calling process is
already attached to shmid.
[EINVAL] shmaddr is not zero and the machine does not permit nonzero values, or shmaddr is not
equal to the current attach location for the shared memory segment.
[ENOMEM] The available data space is not large enough to accommodate the shared memory segment.
[EMFILE] The number of shared memory segments attached to the calling process exceed the
system-imposed limit.
If
shmdt() fails, errno is set to one of the following values.
[EINVAL] shmaddr is not the data segment start address of a shared memory segment.
EXAMPLES
The following call to
shmat() attaches the shared memory segment to the process. This example
assumes the process has a valid shmid, which can be obtained by calling shmget().
char *shmptr;
shmptr = (char *) shmat(myshmid, 0, 0);
The following call to shmdt() then detaches the shared memory segment.
shmdt (shmptr);
SEE ALSO
ipcs(1), exec(2), exit(2), fork(2), ftok(3C), shmctl(2), shmget(2).
Adaptive Address Space Whitepaper at http://www.hp.com
at the Developer and Solution Partner
Program (DSPP) website.
STANDARDS CONFORMANCE
shmat(): SVID2, SVID3, XPG2, XPG3, XPG4
shmdt(): SVID2, SVID3, XPG2, XPG3, XPG4
402 Hewlett-Packard Company 2 HP-UX 11i Version 2: December 2007 Update