Open System Services System Calls Reference Manual (G06.28+)
spt_writevx(2) OSS System Calls Reference Manual
written, or transfers no data and returns the value -1 with errno
set to [EAGAIN]. Also, if a request is greater than PIPE_BUF
bytes and all data previously written to the pipe has been read,
writev() transfers at least PIPE_BUF bytes.
When attempting to write to a file descriptor (other than a pipe or a FIFO file) for
a special character device (a terminal) that supports nonblocking writes and can-
not accept data immediately:
• If the O_NONBLOCK flag is clear, the spt_writevx() function blocks
until the data can be accepted.
• If the O_NONBLOCK flag is set, the spt_writevx() function returns the
value -1 and errno is set to [EAGAIN].
When attempting to write to a socket with no space available for data:
• If the O_NONBLOCK flag is not set, the spt_writevx() function blocks
until space becomes available.
• If the O_NONBLOCK flag is set, the spt_writevx() function returns the
value -1 and sets errno to [EAGAIN]. The O_NONBLOCK flag has no
effect if there is space available.
Upon successful completion, the spt_writevx() function marks the st_ctime and
st_mtime fields of the file for update and clears the set-user-ID and set-group-ID
attributes if the file is a regular file.
The spt_fcntlx( ) function provides more information about record locks.
If it is interrupted by a signal before it writes any data, the spt_writevx() func-
tion returns the value -1 with errno set to [EINTR]. If it is interrupted by a signal
after it has successfully written some data, the spt_writevx() function returns
the number of bytes that it has written.
Use on Guardian Objects
Attempting to write to a Guardian file (that is, a file in /G) that is locked causes the
spt_writevx() function to return -1 and set errno to [EGUARDIANLOCKED].
NOTES
The macro to map writev() to spt_writevx() is available in C applications when
SPT_THREAD_AWARE_NONBLOCK has been defined in the following manner before
including spthread.h:
#define SPT_THREAD_AWARE_NONBLOCK
The alias to link writev() to spt_writevx() is available in C++ applications when
SPT_THREAD_AWARE_PRAGMA_NONBLOCK has been defined in the following manner
before including spthread.h:
#define SPT_THREAD_AWARE_PRAGMA_NONBLOCK
RETURN VALUES
Upon successful completion, the spt_writevx() function returns the number of bytes that were
actually written. Otherwise, the value -1 is returned, and errno is set to indicate the error.
If the file descriptor becomes invalid (is closed by another thread), -1 is returned with an errno
value of [EBADF]. If a signal is received via the pthread_kill() function and is not blocked,
ignored, or handled, -1 is returned with an errno value of [EINTR].
7−352 Hewlett-Packard Company 527186-005