#include <sys/shm.h> int shmdt(const void *shmaddr);
|
The shmdt() function detaches the shared memory segment specified by shmaddr from the calling process.
Parameters
Authorities
Figure 1-16. Authorization Required for shmdt()
| Object Referred to | Authority Required | errno |
|---|---|---|
| Shared memory segment to be detached | None | None |
Return Value
Error Conditions
If shmdt() is not successful, errno usually indicates one of the following errors. Under some conditions, errno could indicate an error other than those listed here.
The value of shmid corresponds to a shared memory ID that has been marked as damaged by a previous shared memory operation.
In attempting to use an argument in a call, the system detected an address that is not valid.
While attempting to access a parameter passed to this function, the system detected an address that is not valid.
A function was passed incorrect argument values, or an operation was attempted on an object and the operation specified is not supported for that type of object.
An argument value is not valid, out of range, or NULL.
The value of shmaddr is not the data segment start address of a shared memory segment.
An attempt was made to use a function that is not available in this implementation for any object or any arguments.
The function is not implemented.
The operation failed because of an unknown system state. See any messages in the job log and correct any errors that are indicated, then retry the operation.
Error Messages
None.
Usage Notes
Related Information
Example
For an example of using this function, see Using Semaphores and Shared Memory in Appendix A, Examples.
| Top | Interprocess Communication APIs | APIs by category |
| [Information Center Home Page | Feedback ] | [Legal | AS/400 Glossary] |