home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / write.z / write
Encoding:
Text File  |  2002-10-03  |  31.3 KB  |  396 lines

  1.  
  2.  
  3.  
  4. wwwwrrrriiiitttteeee((((2222))))                                                              wwwwrrrriiiitttteeee((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _wwww_rrrr_iiii_tttt_eeee, _wwww_rrrr_iiii_tttt_eeee_vvvv, _pppp_wwww_rrrr_iiii_tttt_eeee, _pppp_wwww_rrrr_iiii_tttt_eeee_6666_4444 - write on a file
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  13.      _ssss_ssss_iiii_zzzz_eeee______tttt _wwww_rrrr_iiii_tttt_eeee_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _cccc_oooo_nnnn_ssss_tttt _vvvv_oooo_iiii_dddd _****_bbbb_uuuu_ffff_,,,, _ssss_iiii_zzzz_eeee______tttt _nnnn_bbbb_yyyy_tttt_eeee_))))_;;;;
  14.      _ssss_ssss_iiii_zzzz_eeee______tttt _pppp_wwww_rrrr_iiii_tttt_eeee_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _cccc_oooo_nnnn_ssss_tttt _vvvv_oooo_iiii_dddd _****_bbbb_uuuu_ffff_,,,, _ssss_iiii_zzzz_eeee______tttt _nnnn_bbbb_yyyy_tttt_eeee_,,,, _oooo_ffff_ffff______tttt _oooo_ffff_ffff_ssss_eeee_tttt_))))_;;;;
  15.      _ssss_ssss_iiii_zzzz_eeee______tttt _pppp_wwww_rrrr_iiii_tttt_eeee_6666_4444_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _cccc_oooo_nnnn_ssss_tttt _vvvv_oooo_iiii_dddd _****_bbbb_uuuu_ffff_,,,, _ssss_iiii_zzzz_eeee______tttt _nnnn_bbbb_yyyy_tttt_eeee_,,,, _oooo_ffff_ffff_6666_4444______tttt _oooo_ffff_ffff_ssss_eeee_tttt_))))_;;;;
  16.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_uuuu_iiii_oooo_...._hhhh_>>>>
  17.      _ssss_ssss_iiii_zzzz_eeee______tttt _wwww_rrrr_iiii_tttt_eeee_vvvv_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _cccc_oooo_nnnn_ssss_tttt _ssss_tttt_rrrr_uuuu_cccc_tttt _iiii_oooo_vvvv_eeee_cccc _****_iiii_oooo_vvvv_,,,, _iiii_nnnn_tttt _iiii_oooo_vvvv_cccc_nnnn_tttt_))))_;;;;
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      _wwww_rrrr_iiii_tttt_eeee attempts to write _n_b_y_t_e bytes from the buffer pointed to by _b_u_f to
  21.      the file associated with _f_i_l_d_e_s.  If _n_b_y_t_e is zero and the file is a
  22.      regular file, _wwww_rrrr_iiii_tttt_eeee returns zero and has no other results.  _f_i_l_d_e_s is a
  23.      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
  24.      system call.
  25.  
  26.      _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
  27.      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
  28.      bytes with the _w_h_e_n_c_e set to _SSSS_EEEE_EEEE_KKKK______SSSS_EEEE_TTTT before writing.  On return from
  29.      _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
  30.      file incapable of seeking (a fifo or socket) then an error is returned
  31.      and _eeee_rrrr_rrrr_nnnn_oooo will be set to _EEEE_SSSS_PPPP_IIII_PPPP_EEEE.
  32.  
  33.      _wwww_rrrr_iiii_tttt_eeee_vvvv performs the same action as _wwww_rrrr_iiii_tttt_eeee, but gathers the output data
  34.      from the _i_o_v_c_n_t buffers specified by the members of the _i_o_v array:
  35.      _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
  36.      than 0 and less than or equal to {_IIII_OOOO_VVVV______MMMM_AAAA_XXXX}.  {_IIII_OOOO_VVVV______MMMM_AAAA_XXXX} can be obtained
  37.      from a call to _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff() [see _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff(3C)].
  38.  
  39.      For _wwww_rrrr_iiii_tttt_eeee_vvvv, the _iiii_oooo_vvvv_eeee_cccc structure contains the following members:
  40.  
  41.           _vvvv_oooo_iiii_dddd   _****_iiii_oooo_vvvv______bbbb_aaaa_ssss_eeee_;;;;
  42.           _ssss_ssss_iiii_zzzz_eeee______tttt   _iiii_oooo_vvvv______llll_eeee_nnnn_;;;;
  43.  
  44.      Each _iiii_oooo_vvvv_eeee_cccc entry specifies the base address and length of an area in
  45.      memory from which data should be written.  _wwww_rrrr_iiii_tttt_eeee_vvvv always writes a
  46.      complete area before proceeding to the next.
  47.  
  48.      On devices capable of seeking, the writing of data proceeds from the
  49.      position in the file indicated by the file pointer.  On return from
  50.      _wwww_rrrr_iiii_tttt_eeee, the file pointer is incremented by the number of bytes actually
  51.      written.  On a regular file, if the incremented file pointer is greater
  52.      than the length of the file, the length of the file is set to the new
  53.      file pointer.
  54.  
  55.      On devices incapable of seeking, writing always takes place starting at
  56.      the current position.  The value of a file pointer associated with such a
  57.      device is undefined.
  58.  
  59.  
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. wwwwrrrriiiitttteeee((((2222))))                                                              wwwwrrrriiiitttteeee((((2222))))
  70.  
  71.  
  72.  
  73.      If the _OOOO______AAAA_PPPP_PPPP_EEEE_NNNN_DDDD flag of the file status flags is set, the file pointer is
  74.      set to the end of the file before each _wwww_rrrr_iiii_tttt_eeee.
  75.  
  76.      For regular files, if the _OOOO______SSSS_YYYY_NNNN_CCCC flag of the file status flags is set,
  77.      _wwww_rrrr_iiii_tttt_eeee does not return until both the file data and file status have been
  78.      physically updated.  This function is for special applications that
  79.      require extra reliability at the cost of performance.  For block special
  80.      files, if _OOOO______SSSS_YYYY_NNNN_CCCC is set, _wwww_rrrr_iiii_tttt_eeee does not return until the data has been
  81.      physically updated.
  82.  
  83.      If the _OOOO______DDDD_SSSS_YYYY_NNNN_CCCC flag of the file status flags is set, _wwww_rrrr_iiii_tttt_eeee does not
  84.      return until the file data has been physically updated.  This function is
  85.      for special applications that require extra reliability at the cost of
  86.      performance.
  87.  
  88.      A _wwww_rrrr_iiii_tttt_eeee to a regular file is blocked if mandatory file/record locking is
  89.      set [see _cccc_hhhh_mmmm_oooo_dddd(2)], and there is a record lock owned by another process
  90.      on the segment of the file to be written:
  91.  
  92.           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
  93.           _EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
  94.  
  95.           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
  96.           blocking locks are removed or the _wwww_rrrr_iiii_tttt_eeee is terminated by a signal.
  97.  
  98.      If a _wwww_rrrr_iiii_tttt_eeee requests that more bytes be written than there is room for-for
  99.      example, if the write would exceed the process file size limit [see
  100.      _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
  101.      space on the device-only as many bytes as there is room for will be
  102.      written.  For example, suppose there is space for 20 bytes more in a file
  103.      before reaching a limit.  A _wwww_rrrr_iiii_tttt_eeee of 512-bytes returns 20.  The next
  104.      _wwww_rrrr_iiii_tttt_eeee of a non-zero number of bytes gives a failure return (except as
  105.      noted for pipes and FIFO below).  In addition to an error return, the
  106.      _SSSS_IIII_GGGG_XXXX_FFFF_SSSS_ZZZZ signal is sent to the caller.  The default disposition of this
  107.      signal depends on the environment from which the application was run -
  108.      some standard shells invoke programs with this signal ignored, others
  109.      with the signal set to the default (which will kill the process).
  110.  
  111.      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
  112.      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
  113.      position is not a multiple of the underlying device's blocksize, _nnnn_bbbb_yyyy_tttt_eeee is
  114.      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).
  115.  
  116.      When attempting to write to a regular file in a DMAPI file system, if the
  117.      DMAPI application will take a considerable time to make a portion of the
  118.      file available needed for the write to proceed:
  119.  
  120.           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
  121.           _EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. wwwwrrrriiiitttteeee((((2222))))                                                              wwwwrrrriiiitttteeee((((2222))))
  136.  
  137.  
  138.  
  139.           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
  140.           DMAPI application has made the file data available, and then allows
  141.           the write to proceed.
  142.  
  143.      Write requests to a pipe or FIFO are handled the same as a regular file
  144.      with the following exceptions:
  145.  
  146.           There is no file offset associated with a pipe, hence each write
  147.           request appends to the end of the pipe.
  148.  
  149.           Write requests of _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes or less are guaranteed not to be
  150.           interleaved with data from other threads doing writes on the same
  151.           pipe.  Writes of greater than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes may have data
  152.           interleaved, on arbitrary boundaries, with writes by other threads,
  153.           whether the _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK or _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY flags are set.
  154.  
  155.           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
  156.           thread to block, but on normal completion it returns _n_b_y_t_e.
  157.  
  158.           If _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, _wwww_rrrr_iiii_tttt_eeee requests are handled in the following
  159.           way:  the _wwww_rrrr_iiii_tttt_eeee does not block the thread; write requests for
  160.           _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} or fewer bytes either succeed completely and return
  161.           _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
  162.           greater than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes either transfers what it can and
  163.           returns the number of bytes written, or transfers no data and
  164.           returns _----_1111 with _eeee_rrrr_rrrr_nnnn_oooo set to _EEEE_AAAA_GGGG_AAAA_IIII_NNNN.  Also, if a request is greater
  165.           than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes and all data previously written to the pipe
  166.           has been read, _wwww_rrrr_iiii_tttt_eeee transfers at least _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes.
  167.  
  168.           If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY is set, _wwww_rrrr_iiii_tttt_eeee requests are handled in the following way:
  169.           the _wwww_rrrr_iiii_tttt_eeee does not block the thread; write requests for _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}}
  170.           or fewer bytes either succeed completely and return _n_b_y_t_e, or return
  171.           _0000.  A _wwww_rrrr_iiii_tttt_eeee request for greater than _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes either
  172.           transfers what it can and returns the number of bytes written, or
  173.           transfers no data and returns _0000.  Also, if a request is greater than
  174.           _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes and all data previously written to the pipe has
  175.           been read, _wwww_rrrr_iiii_tttt_eeee transfers at least _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes.
  176.  
  177.      When attempting to write to a file descriptor (other than a pipe or FIFO)
  178.      that supports nonblocking writes and cannot accept the data immediately:
  179.  
  180.           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
  181.           can be accepted.
  182.  
  183.           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.
  184.           If some data can be written without blocking the thread, _wwww_rrrr_iiii_tttt_eeee
  185.           writes what it can and returns the number of bytes written.
  186.           Otherwise, if _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, it returns _----_1111 and sets _eeee_rrrr_rrrr_nnnn_oooo to
  187.           _EEEE_AAAA_GGGG_AAAA_IIII_NNNN or if _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY is set, it returns _0000.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                                                         PPPPaaaaggggeeee 3333
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. wwwwrrrriiiitttteeee((((2222))))                                                              wwwwrrrriiiitttteeee((((2222))))
  202.  
  203.  
  204.  
  205.      For STREAMS files [see _iiii_nnnn_tttt_rrrr_oooo(2)], the operation of _wwww_rrrr_iiii_tttt_eeee is determined by
  206.      the values of the minimum and maximum _n_b_y_t_e range (``packet size'')
  207.      accepted by the stream.  These values are contained in the topmost stream
  208.      module.  Unless the user pushes the topmost module [see _IIII______PPPP_UUUU_SSSS_HHHH in
  209.      _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7)], these values can not be set or tested from user level.  If
  210.      _n_b_y_t_e falls within the packet size range, _n_b_y_t_e bytes are written.  If
  211.      _n_b_y_t_e does not fall within the range and the minimum packet size value is
  212.      zero, _wwww_rrrr_iiii_tttt_eeee breaks the buffer into maximum packet size segments prior to
  213.      sending the data downstream (the last segment may be smaller than the
  214.      maximum packet size).  If _n_b_y_t_e does not fall within the range and the
  215.      minimum value is non-zero, _wwww_rrrr_iiii_tttt_eeee fails and sets _eeee_rrrr_rrrr_nnnn_oooo to _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE.  Writing
  216.      a zero-length buffer (_n_b_y_t_e is zero) to a STREAMS device sends a zero
  217.      length message with zero returned.  However, writing a zero-length buffer
  218.      to a pipe or FIFO sends no message and zero is returned.  The user
  219.      program may issue the _IIII______SSSS_WWWW_RRRR_OOOO_PPPP_TTTT _iiii_oooo_cccc_tttt_llll(2) to enable zero-length messages to
  220.      be sent across the pipe or FIFO [see _ssss_tttt_rrrr_eeee_aaaa_mmmm_iiii_oooo(7)].
  221.  
  222.      When writing to a stream, data messages are created with a priority band
  223.      of zero.  When writing to a stream that is not a pipe or FIFO:
  224.  
  225.           If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY and _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK are not set, and the stream cannot accept
  226.           data (the stream write queue is full because of internal flow
  227.           control conditions), _wwww_rrrr_iiii_tttt_eeee blocks until data can be accepted.
  228.  
  229.           If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set and the stream cannot accept data,
  230.           _wwww_rrrr_iiii_tttt_eeee returns _----_1111 and sets _eeee_rrrr_rrrr_nnnn_oooo to _EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
  231.  
  232.           If _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set and part of the buffer has already
  233.           been written when a condition occurs in which the stream cannot
  234.           accept additional data, _wwww_rrrr_iiii_tttt_eeee terminates and returns the number of
  235.           bytes written.
  236.  
  237.      The number of bytes written may be less than _n_b_y_t_e.  This can occur if
  238.      the _wwww_rrrr_iiii_tttt_eeee gets interrupted for some reason, but some bytes have already
  239.      been written.
  240.  
  241.      _wwww_rrrr_iiii_tttt_eeee and _wwww_rrrr_iiii_tttt_eeee_vvvv fail and the file pointer remains unchanged if one or
  242.      more of the following are true:
  243.  
  244.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN         Mandatory file/record locking is set, _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or
  245.                     _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK is set, and there is a blocking record lock.
  246.  
  247.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN         Total amount of system memory available when reading via
  248.                     raw I/O is temporarily insufficient.
  249.  
  250.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN         An attempt is made to write to a stream that can not
  251.                     accept data with the _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK flag set.
  252.  
  253.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN         If a _wwww_rrrr_iiii_tttt_eeee to a pipe or FIFO of _{{{{_PPPP_IIII_PPPP_EEEE______BBBB_UUUU_FFFF_}}}} bytes or less
  254.                     is requested and less than _n_b_y_t_e of free space is
  255.                     available.
  256.  
  257.  
  258.  
  259.  
  260.                                                                         PPPPaaaaggggeeee 4444
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. wwwwrrrriiiitttteeee((((2222))))                                                              wwwwrrrriiiitttteeee((((2222))))
  268.  
  269.  
  270.  
  271.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN         A DMAPI application might delay a considerable time
  272.                     retrieving a portion of the file data needed for the write
  273.                     to proceed, and _OOOO______NNNN_DDDD_EEEE_LLLL_AAAA_YYYY or _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK was set.
  274.  
  275.      _EEEE_BBBB_AAAA_DDDD_FFFF          _f_i_l_d_e_s is not a valid file descriptor open for writing.
  276.  
  277.      _EEEE_DDDD_EEEE_AAAA_DDDD_LLLL_KKKK        The _wwww_rrrr_iiii_tttt_eeee was going to go to sleep and cause a deadlock to
  278.                     occur.
  279.  
  280.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT         _b_u_f points outside the process's allocated address space.
  281.  
  282.      _EEEE_FFFF_BBBB_IIII_GGGG          An attempt is made to write a file that exceeds the
  283.                     process's file size limit or the maximum file size [see
  284.                     _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2) and _uuuu_llll_iiii_mmmm_iiii_tttt(2)].
  285.  
  286.      _EEEE_IIII_NNNN_TTTT_RRRR          A signal was caught during the _wwww_rrrr_iiii_tttt_eeee system call and no
  287.                     bytes had been written.
  288.  
  289.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         An attempt is made to write to a stream linked below a
  290.                     multiplexor.
  291.  
  292.      _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
  293.                     alignment, current file pointer alignment or write request
  294.                     size is not valid for direct I/O.  See also _FFFF______DDDD_IIII_OOOO_IIII_NNNN_FFFF_OOOO in
  295.                     _ffff_cccc_nnnn_tttt_llll(2).
  296.  
  297.      _EEEE_IIII_OOOO            The process is in the background and is attempting to
  298.                     write to its controlling terminal whose _TTTT_OOOO_SSSS_TTTT_OOOO_PPPP flag is
  299.                     set; the process is neither ignoring nor blocking _SSSS_IIII_GGGG_TTTT_TTTT_OOOO_UUUU
  300.                     signals, and the process group of the process is orphaned.
  301.  
  302.      _EEEE_IIII_OOOO            _f_i_l_d_e_s points to a device special file that is in the
  303.                     closing state.
  304.  
  305.      _EEEE_NNNN_OOOO_LLLL_CCCC_KKKK         The system record lock table was full, so the _wwww_rrrr_iiii_tttt_eeee could
  306.                     not go to sleep until the blocking record lock was
  307.                     removed.
  308.  
  309.      _EEEE_NNNN_OOOO_SSSS_RRRR          An attempt is made to write to a stream with insufficient
  310.                     STREAMS memory resources available in the system.
  311.  
  312.      _EEEE_NNNN_OOOO_SSSS_PPPP_CCCC         During a _wwww_rrrr_iiii_tttt_eeee to an ordinary file, there is no free space
  313.                     left on the device.
  314.  
  315.      _EEEE_NNNN_XXXX_IIII_OOOO          The device associated with the file descriptor is a
  316.                     block-special or character-special file and the file-
  317.                     pointer value is out of range.
  318.  
  319.      _EEEE_PPPP_IIII_PPPP_EEEE and _SSSS_IIII_GGGG_PPPP_IIII_PPPP_EEEE signal
  320.                     An attempt is made to write to a pipe that is not open for
  321.                     reading by any process.
  322.  
  323.  
  324.  
  325.  
  326.                                                                         PPPPaaaaggggeeee 5555
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333. wwwwrrrriiiitttteeee((((2222))))                                                              wwwwrrrriiiitttteeee((((2222))))
  334.  
  335.  
  336.  
  337.      _EEEE_PPPP_IIII_PPPP_EEEE          An attempt is made to write to a FIFO that is not open for
  338.                     reading by any process.
  339.  
  340.      _EEEE_PPPP_IIII_PPPP_EEEE          An attempt is made to write to a pipe that has only one
  341.                     end open.
  342.  
  343.      _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE         An attempt is made to write to a stream with _n_b_y_t_e outside
  344.                     specified minimum and maximum write range, and the minimum
  345.                     value is non-zero.
  346.  
  347.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT      The object of the write is located on a remote system
  348.                     which is not available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  349.  
  350.      _EEEE_NNNN_OOOO_LLLL_CCCC_KKKK         Enforced record locking was enabled and _{{{{_LLLL_OOOO_CCCC_KKKK______MMMM_AAAA_XXXX_}}}} regions
  351.                     are already locked in the system.
  352.  
  353.      _EEEE_SSSS_PPPP_IIII_PPPP_EEEE         _p_w_r_i_t_e or _p_w_r_i_t_e_6_4 was called on a file incapable of
  354.                     seeking.
  355.  
  356.      In addition, _wwww_rrrr_iiii_tttt_eeee_vvvv may return one of the following errors:
  357.  
  358.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         _i_o_v_c_n_t was less than or equal to 0, or greater than
  359.                     _{{{{_IIII_OOOO_VVVV______MMMM_AAAA_XXXX_}}}}. _{{{{_IIII_OOOO_VVVV______MMMM_AAAA_XXXX_}}}} can be obtained from a call to
  360.                     _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff() [see _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff(3C)].
  361.  
  362.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         An _iiii_oooo_vvvv______llll_eeee_nnnn value in the _i_o_v array was negative.
  363.  
  364.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         The sum of the _iiii_oooo_vvvv______llll_eeee_nnnn values in the _i_o_v array overflowed
  365.                     a 32-bit integer.
  366.  
  367.      A _wwww_rrrr_iiii_tttt_eeee to a STREAMS file can fail if an error message has been received
  368.      at the stream head.  In this case, _eeee_rrrr_rrrr_nnnn_oooo is set to the value included in
  369.      the error message.
  370.  
  371.      After carrier loss, _MMMM______HHHH_AAAA_NNNN_GGGG_UUUU_PPPP is set, and a subsequent write will return
  372.      -1 with _eeee_rrrr_rrrr_nnnn_oooo set to _EEEE_IIII_OOOO.  To write after disconnecting and reconnecting
  373.      the line, set the _CCCC_LLLL_OOOO_CCCC_AAAA_LLLL flag to tell the driver to ignore the state of
  374.      the line and the driver will not send _MMMM______HHHH_AAAA_NNNN_GGGG_UUUU_PPPP to the stream head.  If
  375.      _CCCC_LLLL_OOOO_CCCC_AAAA_LLLL is not set, and hangup occurs, the application is responsible for
  376.      re-establishing the connection.
  377.  
  378.      On successful completion _wwww_rrrr_iiii_tttt_eeee and _wwww_rrrr_iiii_tttt_eeee_vvvv mark for update the _ssss_tttt______cccc_tttt_iiii_mmmm_eeee
  379.      and _ssss_tttt______mmmm_tttt_iiii_mmmm_eeee fields of the file.
  380.  
  381. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  382.      _cccc_rrrr_eeee_aaaa_tttt(2), _dddd_uuuu_pppp(2), _ffff_cccc_nnnn_tttt_llll(2), _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2), _iiii_nnnn_tttt_rrrr_oooo(2), _llll_ssss_eeee_eeee_kkkk(2), _oooo_pppp_eeee_nnnn(2),
  383.      _pppp_iiii_pppp_eeee(2), _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff(3C), _tttt_yyyy_pppp_eeee_ssss(5), _uuuu_llll_iiii_mmmm_iiii_tttt(2)
  384.  
  385. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  386.      On success, _wwww_rrrr_iiii_tttt_eeee returns the number of bytes actually written.
  387.      Otherwise, it returns -1 and sets _eeee_rrrr_rrrr_nnnn_oooo to identify the error.
  388.  
  389.  
  390.  
  391.  
  392.                                                                         PPPPaaaaggggeeee 6666
  393.  
  394.  
  395.  
  396.