The msync callable service writes all modified pages over the requested range to their permanent storage locations on disk. It also deletes any in-memory cached pages over the requested range, resetting the contents of those pages to that which resides on disk.
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 (BPX1MSY): | 31-bit |
AMODE (BPX4MSY): | 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 BPX4MSY with the same parameters. The Map_address and Map_length parameters are doublewords.
The name of a fullword (doubleword) that contains the address of the mapping from which the modified pages are to be written to their permanent storage locations on disk, or invalidated. The value of map_address must be a multiple of the page size.
The name of the fullword (doubleword) that contains the size (in bytes) of the mapping that is to have all updated pages written out to disk, or invalidated. The length can be the size of the whole mapping, or a part of it. If the specified length is not a multiple of the page size, it is rounded up to a page boundary.
Constant | Description |
---|---|
MS_ASYNC | Performs asynchronous writes. MS_ASYNC returns immediately when all write operations are scheduled. If the requestor's intent is to write consistent data to the disk, do not use this option. |
MS_SYNC | Performs synchronous writes. MS_SYNC will return after all write operations are completed. |
MS_INVALIDATE | Invalidates the cached memory—mapped pages. After the cached copy of the data in memory has been invalidated for a MAP_SHARED mapping, any further references to these pages will be obtained by the system from their permanent storage locations on disk. For a MAP_PRIVATE mapping, only updated (private) pages are invalidated. Any further references to these pages will be obtained from the shared cache. |
The name of a fullword in which the msync service returns the value of 0 if the request is successful, or -1 if it is not successful.
Upon successful completion, the msync service writes all modified pages over the range (map_address, map_address+map_length) to their permanent storage locations on disk, invalidates the cached mmap pages, or does both.
The name of a fullword in which the msync service stores the return code. The msync 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:
|
EIO | An I/O error occurred while writing to the file system (file system JR). This return code is set only if MS_SYNC is set in the Sync_Options parameter. I/O errors during asynchronous write operations are not reported to the application. |
ENOMEM | One of the following conditions occurred:
|
The name of a fullword in which the msync service stores the reason code. The msync 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.
For an example using this callable service, see BPX1MSY (msync) example.