shmop.2 (2010 09)

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
segment was already removed using shmctl (2) with
IPC_RMID), or the calling pro-
cess 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 (2).
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), privileges(5).
Adaptive Address Space Whitepaper in
http://www.hp.com/products1/unix/operating/infolibrary/
.
STANDARDS CONFORMANCE
shmat(): SVID2, SVID3, XPG2, XPG3, XPG4
shmdt(): SVID2, SVID3, XPG2, XPG3, XPG4
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010