The shmdt service detaches a shared memory segment.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state; PSW key 2, 8, or 9 |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1MDT): | 31-bit |
AMODE (BPX4MDT): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4MDT with the same parameters. The Shared_Memory_Address parameter is a doubleword.
The name of a fullword (doubleword) field that contains the starting address of a shared memory segment. This is the Return_value from shmat (BPX1MAT,BPX4MAT). The address returned is 31 bits for AMODE 31 callers and 64 bits for AMODE 64 callers.
The name of a fullword in which the shmdt service returns 0 if the request was successful, or -1 if the operation was unsuccessful.
Return_code | Explanation |
---|---|
EINVAL | Shared_Memory_Address is not the data segment start address of a shared memory segment attached to the caller's process. The following reason code can accompany the return code: JRBadAddress. |
The name of a fullword in which the shmdt service stores the reason code. The shmdt service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. See z/OS UNIX System Services Messages and Codes for the reason codes.
The caller of the shmdt service is restricted by ownership and read and read-write permissions that are defined by shmget and shmctl Ipc_SET.
For an example using this callable service, see BPX1MDT (shmdt) example.