Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ select(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                select(2)



        _________________________________________________________________
        select                                                System Call
        Wait for I/O conditions.
        _________________________________________________________________


        SYNTAX

        #include <sys/types.h>
        #include <sys/time.h>

        int   select  (nfds, readfds, writefds, exceptfds, timeout)
        int             nfds;
        long *          readfds;
        long *          writefds;
        long *          exceptfds;
        struct timeval *timeout;


        PARAMETERS

        nfds           The range of file descriptors to examine.


        readfds        The address of a bit mask representing file
                       descriptors ready for reading.


        writefds       The address of a bit mask representing file
                       descriptors ready for writing.


        exceptfds      The address of a bit mask representing file
                       descriptors having an exception.


        timeout        Maximum selection duration.


        DESCRIPTION

        Select examines the descriptors specified by the bit masks
        <readfds>, <writefds>, and <exceptfds> to see if they are ready
        for reading, writing, or have an exceptional condition pending,
        respectively.

        Descriptor "f" is represented in a bit mask by the value "1<<f".
        Furthermore, only descriptors 0 through <nfds-1> inclusive are
        examined.

        The <timeout> parameter specifies a maximum interval to wait for



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





                                                                select(2)



        a descriptor to become ready.  If <timeout> is NULL, select will
        wait indefinitely.  Otherwise, the maximum wait time is given by
        the value of the structure located at <timeout>.

        Select returns when either the maximum wait interval has expired
        or at least one condition for one of the descriptors exists.

        Select returns, in place, a mask of descriptors that are ready.
        The descriptor masks are only modified if the return value is
        non-negative.


        ACCESS CONTROL

        None.


        RETURN VALUE

        1..<3*nfds>    Completed successfully. The sum of the number of
                       descriptors identified in each bit mask is
                       returned.


        0              Time limit exceeded.


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


        EXCEPTIONS

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


        EBADF          One of the bit masks specified an invalid
                       descriptor.


        EINTR          A signal was delivered before any of the
                       selected-for events occurred and before the time
                       limit expired.


        SEE ALSO

        The related manual sections:  accept(2), connect(2), recv(2),
        read(2), readv(2), send(2),
        write(2), writev(2).




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



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