The fsync callable service writes changes on the permanent storage device that holds the file.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1FSY): | 31-bit |
AMODE (BPX4FSY): | 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 BPX4FSY with the same parameters.
The name of a fullword that contains the file descriptor of the file for which changes are to be written to permanent storage.
The name of a fullword in which the fsync service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EBADF | The File_descriptor parameter does not specify a valid, open file. |
EINVAL | The file is not a regular file. |
The name of a fullword in which the fsync service stores the reason code. The fsync 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.
The file identified by File_descriptor must be open for writing when the fsync service is called.
When automatic conversion is enabled, a fsync operation cannot write to permanent storage an untranslated partial character that was cached by z/OS®. Untranslated partial characters occur when translating multibyte characters sets and z/OS is given data that does not end on a character boundary. Untranslated partial characters are resolved during a subsequent write operation (BPX1WRT/BPX4WRT) when the remaining part of the character is supplied.
For an example using this callable service, see BPX1FSY (fsync) example.