Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lseek(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                 lseek(2)



        _________________________________________________________________
        lseek                                                 System Call
        Change object pointer's current position.
        _________________________________________________________________


        SYNTAX

        #define SEEK_SET
        #define SEEK_CUR
        #define SEEK_END
        #include <sys/file.h>
        #include <sys/types.h>

        off_t  lseek  (fildes, offset, whence)
        int             fildes;
        off_t           offset;
        int             whence;


        PARAMETERS

        fildes         A valid, active file descriptor.


        offset         The new position of the file pointer.


        whence         Changes the interpretation of <offset>.


        DESCRIPTION

        If <fildes> is a valid, active descriptor that refers to an
        object pointer having a current position attribute, the object
        pointer's current position is modified according to the <offset>
        and <whence> parameters as follows:

        If <whence> is SEEK_SET, the current position is set to <offset>
        bytes.

        If <whence> is SEEK_CUR, the current position is set to its
        current location plus <offset>.

        If <whence> is SEEK_END, the current position is set to the size
        of the object plus <offset>.  The size of character special files
        and block special files is always zero.  Hence, this option is
        equivalent to <whence> being SEEK_SET for these files.

        If <whence> is equal to any other value, the user is sent the
        signal SIGSYS and errno returns EINVAL.



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                                 lseek(2)



        It is an error for the new current position attribute to be
        negative.

        If lseek fails, the object pointer is not changed.


        ACCESS CONTROL

        None.


        RETURN VALUE

        <position>     Completed successfully.  The object pointer's new
                       position is returned.


        -1             An error occurred.  Errno is set to indicate the
                       error.


        EXCEPTIONS

        Errno may be set to one of the following error codes:


        EBADF          <Fildes> is not a valid, active descriptor.


        ESPIPE         <Fildes> is associated with a pipe or a socket.


        EINVAL and SIGSYS signal
                       <Whence> is not SEEK_SET, SEEK_CUR, or SEEK_END.


        EINVAL         The resulting file pointer would be negative.


        SEE ALSO

        The related manual sections:  creat(2), dup(2), dup2(2),
        fcntl(2), open(2).











        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026