Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

fsync(2) OSS System Calls Reference Manual
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
To use this function in a 32-bit threaded application on systems running H06.24 or later RVUs or
J06.13 or later RVUs, perform the same tasks (described above) used to make the function
thread-aware in a multi-threaded application on systems running H06.21/J06.10 or later RVUs.
To use this function in a 64-bit threaded application on systems running H06.24 or later RVUs or
J06.13 or later RVUs, you must perform all of the following tasks to make the function thread-
aware in a multi-threaded application:
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Compile the application using the -Wlp64 compiler command option.
Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys-
tem Services environment, see the Open System Services Programmer’s Guide.
RETURN VALUES
Upon successful completion, the fsync() function returns the value 0 (zero). Otherwise, it returns
the value -1, and errno is set to indicate the error.
ERRORS
If any of these conditions occurs, the fsync( ) function sets errno to the value that corresponds to
the condition:
[EALREADY] Operation already in progress. An I/O operation started by a thread-aware func-
tion is in progress on a regular file and a function that is process-blocking for
regular files attempts to begin an I/O operation on the same open file.
If the fsync( ) function is thread-aware, the [EALREADY] value is not returned.
[EBADF] The filedes parameter is not a valid file descriptor.
[EINTR] The fsync() function was interrupted by a signal that was caught.
[EINVAL] The filedes parameter, although valid, does not refer to a file on which this opera-
tion is possible.
[EIO] An I/O error occurred during a write to the fileset.
[EISGUARDIAN]
The value used for the filedes parameter is appropriate only in the Guardian
environment.
[ENETDOWN]
The filedes parameter specifies a file on a remote HP NonStop node, but com-
munication with the remote node has been lost.
[ENXIO] No such device or address. An invalid device or address was specified during an
input or output operation on a special file. One of these events occurred:
A device was specified that does not exist, or a request was made beyond
the limits of the device.
362 Hewlett-Packard Company 527186-023