home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / ixemul-39.47-env-bin.lha / man / cat2 / lseek.0 < prev    next >
Text File  |  1993-12-07  |  2KB  |  67 lines

  1.  
  2. LSEEK(2)                   UNIX Programmer's Manual                   LSEEK(2)
  3.  
  4. NNAAMMEE
  5.      llsseeeekk - reposition read/write file offset
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<uunniissttdd..hh>>
  9.  
  10.      _o_f_f___t
  11.      llsseeeekk(_i_n_t _f_i_l_d_e_s, _o_f_f___t _o_f_f_s_e_t, _i_n_t _w_h_e_n_c_e)
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      The llsseeeekk() function repositions the offset of the file descriptor _f_i_l_d_e_s
  15.      to the argument _o_f_f_s_e_t according to the directive _w_h_e_n_c_e_. The argument
  16.      _f_i_l_d_e_s must be an open file descriptor.  LLsseeeekk() repositions the file
  17.      pointer _f_i_l_d_e_s as follows:
  18.  
  19.            If _w_h_e_n_c_e is SEEK_SET, the offset is set to _o_f_f_s_e_t bytes.
  20.  
  21.            If _w_h_e_n_c_e is SEEK_CUR, the offset is set to its current location
  22.            plus _o_f_f_s_e_t bytes.
  23.  
  24.            If _w_h_e_n_c_e is SEEK_END, the offset is set to the size of the file
  25.            plus _o_f_f_s_e_t bytes.
  26.  
  27.      The llsseeeekk() function allows the file offset to be set beyond the end of
  28.      the existing end­of­file of the file. If data is later written at this
  29.      point, subsequent reads of the data in the gap return bytes of zeros (un­
  30.      til data is actualy written into the gap).
  31.  
  32.      Some devices are incapable of seeking.  The value of the pointer associ­
  33.      ated with such a device is undefined.
  34.  
  35. RREETTUURRNN VVAALLUUEESS
  36.      Upon successful completion, llsseeeekk() returns the resulting offset location
  37.      as measured in bytes from the begining of the file.  Otherwise, a value
  38.      of ­1 is returned and _e_r_r_n_o is set to indicate the error.
  39.  
  40. EERRRROORRSS
  41.      LLsseeeekk() will fail and the file pointer will remain unchanged if:
  42.  
  43.      [EBADF]   _F_i_l_d_e_s is not an open file descriptor.
  44.  
  45.      [ESPIPE]  _F_i_l_d_e_s is associated with a pipe, socket, or FIFO.
  46.  
  47.      [EINVAL]  _W_h_e_n_c_e is not a proper value.
  48.  
  49. SSEEEE AALLSSOO
  50.      dup(2),  open(2)
  51.  
  52. BBUUGGSS
  53.      This document's use of _w_h_e_n_c_e is incorrect English, but maintained for
  54.      historical reasons.
  55.  
  56. SSTTAANNDDAARRDDSS
  57.      The llsseeeekk() function conforms to IEEE Std 1003.1­1988 (``POSIX'').
  58.  
  59. 4th Berkeley Distribution       March 10, 1991                               1
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.