man(1) Manual page archive


NAME
     seek - move read/write pointer

SYNOPSIS
     (seek = 19.)
     (file descriptor in r0)
     sys seek; offset; ptrname

     seek(fildes, offset, ptrname)

DESCRIPTION
     The file descriptor refers to a file open for reading or
     writing.  The read (resp. write) pointer for the file is set
     as follows:

        if ptrname is 0, the pointer is set to offset.

        if ptrname is 1, the pointer is set to its current loca-
           tion plus offset.

        if ptrname is 2, the pointer is set to the size of the
           file plus offset.

        if ptrname is 3, 4 or 5, the meaning is as above for 0, 1
           and 2 except that the offset is multiplied by 512.

     If ptrname is 0 or 3, offset is unsigned, otherwise it is
     signed.

SEE ALSO
     open (II), creat (II)

DIAGNOSTICS
     The error bit (c-bit) is set for an undefined file descrip-
     tor.  From C, a -1 return indicates an error.

 1