Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dup(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                   dup(2)



        _________________________________________________________________
        dup                                                   System Call
        Duplicate an open file descriptor.
        _________________________________________________________________


        SYNTAX

        int    dup  (fildes)
        int             fildes;


        PARAMETERS

        fildes         A valid, active file descriptor.


        DESCRIPTION

        If <fildes> is a valid, active descriptor, then this call returns
        a new file descriptor with both descriptors sharing the same
        object pointer.  The new descriptor is set to remain open across
        exec system calls.  This call is identical to new_filedes = fcntl
        (filedes, F_DUPFD, 0).


        ACCESS CONTROL

        None.


        RETURN VALUE

        0..<NOFILE-1>  The value of the new file descriptor.


        -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.


        EMFILE         All descriptors are open.





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





                                                                   dup(2)



        SEE ALSO

        The related manual sections:  accept(2), close(2), creat(2),
        dup2(2), exec(2), fcntl(2), getdtablesize(2), open(2), pipe(2),
        socket(2), socketpair(2).

















































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



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