home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / dup2.z / dup2
Encoding:
Text File  |  2002-10-03  |  2.9 KB  |  67 lines

  1.  
  2.  
  3.  
  4. dddduuuupppp2222((((3333CCCC))))                                                              dddduuuupppp2222((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _dddd_uuuu_pppp_2222 - duplicate an open file descriptor
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  13.  
  14.      _iiii_nnnn_tttt _dddd_uuuu_pppp_2222 _((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_2222_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _f_i_l_d_e_s is a file descriptor referring to an open file, and _f_i_l_d_e_s_2 is a
  18.      non-negative integer less than the maximum number of open files
  19.      available.  _dddd_uuuu_pppp_2222 causes _f_i_l_d_e_s_2 to refer to the same file as _f_i_l_d_e_s.  If
  20.      _f_i_l_d_e_s_2 already referred to an open file, not _f_i_l_d_e_s, it is closed first.
  21.      If _f_i_l_d_e_s_2 refers to _f_i_l_d_e_s, or if _f_i_l_d_e_s is not a valid open file
  22.      descriptor, _f_i_l_d_e_s_2 will not be closed first.
  23.  
  24.      _dddd_uuuu_pppp_2222 will fail if one or more of the following are true:
  25.  
  26.      _EEEE_BBBB_AAAA_DDDD_FFFF          _f_i_l_d_e_s is not a valid open file descriptor.
  27.  
  28.      _EEEE_BBBB_AAAA_DDDD_FFFF          _f_i_l_d_e_s_2 is negative or greater than or equal to the
  29.                     maximum number of open files available.
  30.  
  31.      _EEEE_IIII_NNNN_TTTT_RRRR          a signal was caught during the _dddd_uuuu_pppp_2222 call.
  32.  
  33.      _EEEE_MMMM_FFFF_IIII_LLLL_EEEE         The maximum number of file descriptors are currently open.
  34.  
  35. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  36.      _cccc_rrrr_eeee_aaaa_tttt(2), _cccc_llll_oooo_ssss_eeee(2), _eeee_xxxx_eeee_cccc(2), _ffff_cccc_nnnn_tttt_llll(2), _oooo_pppp_eeee_nnnn(2), _pppp_iiii_pppp_eeee(2), _llll_oooo_cccc_kkkk_ffff(3C),
  37.      _llll_iiii_mmmm_iiii_tttt_ssss(4)
  38.  
  39. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  40.      Upon successful completion a non-negative integer, namely, the file
  41.      descriptor, is returned.  Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo
  42.      is set to indicate the error.
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.