Open System Services System Calls Reference Manual (G06.28+, H06.05+)

spt_writevx(2) OSS System Calls Reference Manual
this case, the number of bytes written is returned. For example, suppose a le has space for 20
more bytes of data before reaching a limit. A write request of 512 bytes returns a value of 20.
The limit can be either the end of the physical medium or the value that has been set by the
ulimit() function. The next write of a nonzero number of bytes gives a failure return (except as
noted later).
Upon successful completion, the spt_writevx() function returns the number of bytes actually
written to the le associated with ledes.
If the O_APPEND status ag of the le is set, the le offset is set to the end of the le before
each write operation.
If the O_SYNC status ag of the le is set and ledes refers to a regular le, a successful
spt_writevx() call does not return until the data is delivered to the underlying hardware (as
described in the open(2) reference page).
The O_NONBLOCK ag is effective only on pipes, FIFOs, sockets, and terminal device les
(Telserv or OSSTTY processes).
Write requests to a pipe or FIFO le are handled the same way as write requests to a regular le
with these exceptions:
No le offset is associated with a pipe; therfore, each spt_writevx()
request appends to the end of the pipe.
If the size of the spt_writevx() request is less than or equal to the value
of the PIPE_BUF system variable, the spt_writevx() function is
guaranteed to be atomic. The data is not interleaved with data from
other processes doing writes on the same pipe.
If the size of the spt_writevx() request is greater than the value of the
PIPE_BUF system variable, the le system attempts to resize the pipe
buffer from 2 * PIPE_BUF to 65,536 bytes. If the resizing is successful,
the le system performs atomic writes of up to 32,768 bytes and can
transfer up to 52 kilobytes of data from the pipe buffer on subsequent
spt_readx() or spt_readvx() calls by the client.
If the le system cannot resize the buffer, it continues to use the existing
buffer. A second attempt at resizing occurs after approximately a
minute.
Writes of greater than PIPE_BUF bytes can have data interleaved, on
arbitrary boundaries, with writes by other processes, whether or not the
O_NONBLOCK ag is set.
If the O_NONBLOCK ag is not set, an spt_writevx() request to a full
pipe causes the process to block until enough space becomes available
to handle the entire request.
If the O_NONBLOCK ag is set, spt_writevx() requests are handled
differently:
The spt_writevx() function does block the process.
spt_writevx() requests for PIPE_BUF or fewer bytes either
succeed completely and return the number of bytes written, or
return the value -1 and set errno to [EAGAIN].
An spt_writevx() request for greater than PIPE_BUF bytes
either transfers what it can and returns the number of bytes
7364 Hewlett-Packard Company 527186-007