Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ select(2) — DG/UX 4.30

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

accept(2)

connect(2)

recv(2)

read(2)

readv(2)

send(2)

write(2)

writev(2)



     select(2)                  DG/UX 4.30                   select(2)



     NAME
          select - Wait for I/O conditions.

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




     Licensed material--property of copyright holder(s)         Page 1





     select(2)                  DG/UX 4.30                   select(2)



          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.


          EINVAL         nfds==0.

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

















     Licensed material--property of copyright holder(s)         Page 2



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