4.4BSD/usr/share/man/cat2/seek.0

Compare this file to the similar file:
Show the results in this format:

LSEEK(2)                    BSD Programmer's Manual                   LSEEK(2)

NNAAMMEE
     llsseeeekk - reposition read/write file offset

SSYYNNOOPPSSIISS
     ##iinncclluuddee <<uunniissttdd..hh>>

     _o_f_f___t
     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);

DDEESSCCRRIIPPTTIIOONN
     The llsseeeekk() function repositions the offset of the file descriptor _f_i_l_d_e_s
     to the argument _o_f_f_s_e_t according to the directive _w_h_e_n_c_e_. The argument
     _f_i_l_d_e_s must be an open file descriptor.  LLsseeeekk() repositions the file
     pointer _f_i_l_d_e_s as follows:

           If _w_h_e_n_c_e is SEEK_SET, the offset is set to _o_f_f_s_e_t bytes.

           If _w_h_e_n_c_e is SEEK_CUR, the offset is set to its current location
           plus _o_f_f_s_e_t bytes.

           If _w_h_e_n_c_e is SEEK_END, the offset is set to the size of the file
           plus _o_f_f_s_e_t bytes.

     The llsseeeekk() function allows the file offset to be set beyond the end of
     the existing end-of-file of the file. If data is later written at this
     point, subsequent reads of the data in the gap return bytes of zeros (un-
     til data is actualy written into the gap).

     Some devices are incapable of seeking.  The value of the pointer associ-
     ated with such a device is undefined.

RREETTUURRNN VVAALLUUEESS
     Upon successful completion, llsseeeekk() returns the resulting offset location
     as measured in bytes from the begining of the file.  Otherwise, a value
     of -1 is returned and _e_r_r_n_o is set to indicate the error.

EERRRROORRSS
     LLsseeeekk() will fail and the file pointer will remain unchanged if:

     [EBADF]   _F_i_l_d_e_s is not an open file descriptor.

     [ESPIPE]  _F_i_l_d_e_s is associated with a pipe, socket, or FIFO.

     [EINVAL]  _W_h_e_n_c_e is not a proper value.

SSEEEE AALLSSOO
     dup(2),  open(2)

BBUUGGSS
     This document's use of _w_h_e_n_c_e is incorrect English, but maintained for
     historical reasons.

SSTTAANNDDAARRDDSS
     The llsseeeekk() function conforms to IEEE Std 1003.1-1988 (``POSIX'').

4th Berkeley Distribution        June 4, 1993                                1