sync_file_range function
Force committing of data to disk.
Declaration
function sync_file_range(fd: cint; offset: off64_t; nbytes: off64_t;
flags: cuint): cintDescription
sync_file_range forces the Linux kernel to write any data pages
of a specified file (file descriptor
fd) to disk. The range of
the file is specified by the offset
offset and the number of
bytes
nbytes.
Options is an OR-ed combination of
- SYNC_FILE_RANGE_WAIT_BEFORE
-
Wait for write-out of previously-submitted specified pages before writing more data.
- SYNC_FILE_RANGE_WRITE
-
Initiate write of all dirty pages in the specified range.
- SYNC_FILE_RANGE_WAIT_AFTER
-
Wait upon write-out of specified pages in the range after performing any write.
If none is specified, the operation does nothing.
Errors
On return -1 is returned and fperrno is set to the actual error code. See the Linux man page for more on the error codes.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
