The munmap callable service removes the mapping for pages in the requested range. It should be used only to unmap regions that have been previously mapped by the application with the mmap callable service.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, PSW Key 2 or PSW Key 8 |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1MUN): | 31-bit |
AMODE (BPX4MUN): | 64-bit |
ASC mode: | Primary address space control (ASC) 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 BPX4MUN with the same parameters. The Map_address and Map_length parameters are doublewords.
The name of a fullword (doubleword) that contains the address of an existing mapping that is to be unmapped. The specified address does not have to be the start of a mapping. The value of map_address must be a multiple of the page size. If the address falls within a MAP_MEGA map, the address that is provided is rounded down to a megabyte multiple so that an entire segment is included in the unmap operation. It is not possible to unmap part of a segment when processing a MAP_MEGA map.
The name of the fullword (doubleword) containing the size (in bytes) of the mappings that are to be unmapped. The length can be the size of the whole mapping, or a part of it. If the specified length is not in multiples of the page size, it will be rounded up to a page boundary. If map_address plus map_length falls within a MAP_MEGA map, the length is rounded up so that it includes an entire segment (but not necessarily the entire MAP_MEGA mapping).
The name of a fullword in which the munmap service returns the value of 0 if the request is successful, or -1 if it is not successful.
Upon successful completion, the munmap service unmaps all pages in the range (map_address, map_address+map_length).
The name of a fullword in which the munmap service stores the return code. The munmap service returns Return_code only if Return_value is -1. See z/OS UNIX System Services Messages and Codes for a complete list of possible return code values.
Return_code | Explanation |
---|---|
EAGAIN | The caller is not running in either PSW Key 2 or PSW Key 8. (JRUnsupportedKey) |
EINVAL | One of the following conditions occurred:
|
The name of a fullword in which the munmap service stores the reason code. The munmap service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
There are no restrictions on the use of the munmap service.
For an example using this callable service, see BPX1MUN (munmap) example.