_wwww_rrrr_iiii_tttt_eeee attempts to write _n_b_y_t_e bytes from the buffer pointed to by _b_u_f to
the file associated with _f_i_l_d_e_s. If _n_b_y_t_e is zero and the file is a
regular file, _wwww_rrrr_iiii_tttt_eeee returns zero and has no other results. _f_i_l_d_e_s is a
file descriptor obtained from a _cccc_rrrr_eeee_aaaa_tttt, _oooo_pppp_eeee_nnnn, _dddd_uuuu_pppp, _ffff_cccc_nnnn_tttt_llll, _pppp_iiii_pppp_eeee, or _iiii_oooo_cccc_tttt_llll
system call.
_pppp_wwww_rrrr_iiii_tttt_eeee and _pppp_wwww_rrrr_iiii_tttt_eeee_6666_4444 are the same as _wwww_rrrr_iiii_tttt_eeee except that they do the
equivalent of an _llll_ssss_eeee_eeee_kkkk (for _pppp_wwww_rrrr_iiii_tttt_eeee) or _llll_ssss_eeee_eeee_kkkk_6666_4444 (for _pppp_wwww_rrrr_iiii_tttt_eeee_6666_4444) _o_f_f_s_e_t
bytes with the _w_h_e_n_c_e set to _SSSS_EEEE_EEEE_KKKK______SSSS_EEEE_TTTT before writing. On return from
_pppp_wwww_rrrr_iiii_tttt_eeee or _pppp_wwww_rrrr_iiii_tttt_eeee_6666_4444, the file pointer is unchanged. If _ffff_iiii_llll_dddd_eeee_ssss refers to a
file incapable of seeking (a fifo or socket) then an error is returned
and _eeee_rrrr_rrrr_nnnn_oooo will be set to _EEEE_SSSS_PPPP_IIII_PPPP_EEEE.
_wwww_rrrr_iiii_tttt_eeee_vvvv performs the same action as _wwww_rrrr_iiii_tttt_eeee, but gathers the output data
from the _i_o_v_c_n_t buffers specified by the members of the _i_o_v array:
_i_o_v[0], _i_o_v[1], ..., _i_o_v[_i_o_v_c_n_t-1]. The _i_o_v_c_n_t is valid only if greater
than 0 and less than or equal to {_IIII_OOOO_VVVV______MMMM_AAAA_XXXX}. {_IIII_OOOO_VVVV______MMMM_AAAA_XXXX} can be obtained
from a call to _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff() [see _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff(3C)].
For _wwww_rrrr_iiii_tttt_eeee_vvvv, the _iiii_oooo_vvvv_eeee_cccc structure contains the following members:
If the _OOOO______AAAA_PPPP_PPPP_EEEE_NNNN_DDDD flag of the file status flags is set, the file pointer is
set to the end of the file before each _wwww_rrrr_iiii_tttt_eeee.
For regular files, if the _OOOO______SSSS_YYYY_NNNN_CCCC flag of the file status flags is set,
_wwww_rrrr_iiii_tttt_eeee does not return until both the file data and file status have been
physically updated. This function is for special applications that
require extra reliability at the cost of performance. For block special
files, if _OOOO______SSSS_YYYY_NNNN_CCCC is set, _wwww_rrrr_iiii_tttt_eeee does not return until the data has been
physically updated.
If the _OOOO______DDDD_SSSS_YYYY_NNNN_CCCC flag of the file status flags is set, _wwww_rrrr_iiii_tttt_eeee does not
return until the file data has been physically updated. This function is
for special applications that require extra reliability at the cost of
performance.
A _wwww_rrrr_iiii_tttt_eeee to a regular file is blocked if mandatory file/record locking is
set [see _cccc_hhhh_mmmm_oooo_dddd(2)], and there is a record lock owned by another process
on the segment of the file to be written:
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _wwww_rrrr_iiii_tttt_eeee returns _----_1111 and sets _eeee_rrrr_rrrr_nnnn_oooo to
_EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are clear, _wwww_rrrr_iiii_tttt_eeee sleeps until all
blocking locks are removed or the _wwww_rrrr_iiii_tttt_eeee is terminated by a signal.
If a _wwww_rrrr_iiii_tttt_eeee requests that more bytes be written than there is room for-for
example, if the write would exceed the process file size limit [see
_gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2) and _uuuu_llll_iiii_mmmm_iiii_tttt(2)], the system file size limit, or the free
space on the device-only as many bytes as there is room for will be
written. For example, suppose there is space for 20 bytes more in a file
before reaching a limit. A _wwww_rrrr_iiii_tttt_eeee of 512-bytes returns 20. The next
_wwww_rrrr_iiii_tttt_eeee of a non-zero number of bytes gives a failure return (except as
noted for pipes and FIFO below). In addition to an error return, the
_SSSS_IIII_GGGG_XXXX_FFFF_SSSS_ZZZZ signal is sent to the caller. The default disposition of this
signal depends on the environment from which the application was run -
some standard shells invoke programs with this signal ignored, others
with the signal set to the default (which will kill the process).
When attempting to _wwww_rrrr_iiii_tttt_eeee to a file with _OOOO______DDDD_IIII_RRRR_EEEE_CCCC_TTTT or _FFFF_DDDD_IIII_RRRR_EEEE_CCCC_TTTT set, _----_1111 will
be returned and _eeee_rrrr_rrrr_nnnn_oooo will be set to _EEEE_IIII_NNNN_VVVV_AAAA_LLLL if _n_b_y_t_e or the current file
position is not a multiple of the underlying device's blocksize, _nnnn_bbbb_yyyy_tttt_eeee is
too big or _bbbb_uuuu_ffff isn't properly aligned. See also _FFFF______DDDD_IIII_OOOO_IIII_NNNN_FFFF_OOOO in _ffff_cccc_nnnn_tttt_llll(2).
When attempting to write to a regular file in a DMAPI file system, if the
DMAPI application will take a considerable time to make a portion of the
file available needed for the write to proceed:
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _wwww_rrrr_iiii_tttt_eeee returns -1 and sets _eeee_rrrr_rrrr_nnnn_oooo to
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are clear, _wwww_rrrr_iiii_tttt_eeee sleeps until the the
DMAPI application has made the file data available, and then allows
the write to proceed.
Write requests to a pipe or FIFO are handled the same as a regular file
with the following exceptions:
There is no file offset associated with a pipe, hence each write
request appends to the end of the pipe.
Write requests of _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes or less are guaranteed not to be
interleaved with data from other threads doing writes on the same
pipe. Writes of greater than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes may have data
interleaved, on arbitrary boundaries, with writes by other threads,
whether the _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK or _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY flags are set.
If _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK and _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY are clear, a write request may cause the
thread to block, but on normal completion it returns _n_b_y_t_e.
If _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _wwww_rrrr_iiii_tttt_eeee requests are handled in the following
way: the _wwww_rrrr_iiii_tttt_eeee does not block the thread; write requests for
_{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} or fewer bytes either succeed completely and return
_n_b_y_t_e, or return _----_1111 and set _eeee_rrrr_rrrr_nnnn_oooo to _EEEE_AAAA_GGGG_AAAA_IIII_NNNN. A _wwww_rrrr_iiii_tttt_eeee request for
greater than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes either transfers what it can and
returns the number of bytes written, or transfers no data and
returns _----_1111 with _eeee_rrrr_rrrr_nnnn_oooo set to _EEEE_AAAA_GGGG_AAAA_IIII_NNNN. Also, if a request is greater
than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes and all data previously written to the pipe
has been read, _wwww_rrrr_iiii_tttt_eeee transfers at least _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes.
If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY is set, _wwww_rrrr_iiii_tttt_eeee requests are handled in the following way:
the _wwww_rrrr_iiii_tttt_eeee does not block the thread; write requests for _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}}
or fewer bytes either succeed completely and return _n_b_y_t_e, or return
_0000. A _wwww_rrrr_iiii_tttt_eeee request for greater than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes either
transfers what it can and returns the number of bytes written, or
transfers no data and returns _0000. Also, if a request is greater than
_{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes and all data previously written to the pipe has
been read, _wwww_rrrr_iiii_tttt_eeee transfers at least _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes.
When attempting to write to a file descriptor (other than a pipe or FIFO)
that supports nonblocking writes and cannot accept the data immediately:
If _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK and _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY are clear, _wwww_rrrr_iiii_tttt_eeee blocks until the data
can be accepted.
If _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK or _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY is set, _wwww_rrrr_iiii_tttt_eeee does not block the thread.
If some data can be written without blocking the thread, _wwww_rrrr_iiii_tttt_eeee
writes what it can and returns the number of bytes written.
Otherwise, if _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, it returns _----_1111 and sets _eeee_rrrr_rrrr_nnnn_oooo to
_EEEE_AAAA_GGGG_AAAA_IIII_NNNN or if _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY is set, it returns _0000.
_EEEE_AAAA_GGGG_AAAA_IIII_NNNN A DMAPI application might delay a considerable time
retrieving a portion of the file data needed for the write
to proceed, and _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK was set.
_EEEE_BBBB_AAAA_DDDD_FFFF _f_i_l_d_e_s is not a valid file descriptor open for writing.
_EEEE_DDDD_EEEE_AAAA_DDDD_LLLL_KKKK The _wwww_rrrr_iiii_tttt_eeee was going to go to sleep and cause a deadlock to
occur.
_EEEE_FFFF_AAAA_UUUU_LLLL_TTTT _b_u_f points outside the process's allocated address space.
_EEEE_FFFF_BBBB_IIII_GGGG An attempt is made to write a file that exceeds the
process's file size limit or the maximum file size [see
_gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2) and _uuuu_llll_iiii_mmmm_iiii_tttt(2)].
_EEEE_IIII_NNNN_TTTT_RRRR A signal was caught during the _wwww_rrrr_iiii_tttt_eeee system call and no
bytes had been written.
_EEEE_IIII_NNNN_VVVV_AAAA_LLLL An attempt is made to write to a stream linked below a
multiplexor.
_EEEE_IIII_NNNN_VVVV_AAAA_LLLL _f_i_l_d_e_s has _OOOO______DDDD_IIII_RRRR_EEEE_CCCC_TTTT or _FFFF_DDDD_IIII_RRRR_EEEE_CCCC_TTTT set and either the buffer
alignment, current file pointer alignment or write request
size is not valid for direct I/O. See also _FFFF______DDDD_IIII_OOOO_IIII_NNNN_FFFF_OOOO in
_ffff_cccc_nnnn_tttt_llll(2).
_EEEE_IIII_OOOO The process is in the background and is attempting to
write to its controlling terminal whose _TTTT_OOOO_SSSS_TTTT_OOOO_PPPP flag is
set; the process is neither ignoring nor blocking _SSSS_IIII_GGGG_TTTT_TTTT_OOOO_UUUU
signals, and the process group of the process is orphaned.
_EEEE_IIII_OOOO _f_i_l_d_e_s points to a device special file that is in the
closing state.
_EEEE_NNNN_OOOO_LLLL_CCCC_KKKK The system record lock table was full, so the _wwww_rrrr_iiii_tttt_eeee could
not go to sleep until the blocking record lock was
removed.
_EEEE_NNNN_OOOO_SSSS_RRRR An attempt is made to write to a stream with insufficient
STREAMS memory resources available in the system.
_EEEE_NNNN_OOOO_SSSS_PPPP_CCCC During a _wwww_rrrr_iiii_tttt_eeee to an ordinary file, there is no free space
left on the device.
_EEEE_NNNN_XXXX_IIII_OOOO The device associated with the file descriptor is a
block-special or character-special file and the file-
pointer value is out of range.
_EEEE_PPPP_IIII_PPPP_EEEE and _SSSS_IIII_GGGG_PPPP_IIII_PPPP_EEEE signal
An attempt is made to write to a pipe that is not open for