Annotation of 43BSDReno/contrib/isode-beta/psap2/psapselect.c, revision 1.1.1.1

1.1       root        1: /* psapselect.c - PPM: map descriptors */
                      2: 
                      3: #ifndef        lint
                      4: static char *rcsid = "$Header: /f/osi/psap2/RCS/psapselect.c,v 7.0 89/11/23 22:14:36 mrose Rel $";
                      5: #endif
                      6: 
                      7: /* 
                      8:  * $Header: /f/osi/psap2/RCS/psapselect.c,v 7.0 89/11/23 22:14:36 mrose Rel $
                      9:  *
                     10:  *
                     11:  * $Log:       psapselect.c,v $
                     12:  * Revision 7.0  89/11/23  22:14:36  mrose
                     13:  * Release 6.0
                     14:  * 
                     15:  */
                     16: 
                     17: /*
                     18:  *                               NOTICE
                     19:  *
                     20:  *    Acquisition, use, and distribution of this module and related
                     21:  *    materials are subject to the restrictions of a license agreement.
                     22:  *    Consult the Preface in the User's Manual for the full terms of
                     23:  *    this agreement.
                     24:  *
                     25:  */
                     26: 
                     27: 
                     28: /* LINTLIBRARY */
                     29: 
                     30: #include <stdio.h>
                     31: #include <signal.h>
                     32: #include "ppkt.h"
                     33: 
                     34: /*    map presentation descriptors for select() */
                     35: 
                     36: int    PSelectMask (sd, mask, nfds, pi)
                     37: int    sd;
                     38: fd_set *mask;
                     39: int    *nfds;
                     40: struct PSAPindication *pi;
                     41: {
                     42:     SBV     smask;
                     43:     register struct psapblk *pb;
                     44:     struct SSAPindication   sis;
                     45:     register struct SSAPabort  *sa = &sis.si_abort;
                     46: 
                     47:     missingP (mask);
                     48:     missingP (nfds);
                     49:     missingP (pi);
                     50: 
                     51:     smask = sigioblock ();
                     52: 
                     53:     if ((pb = findpblk (sd)) == NULL) {
                     54:        (void) sigiomask (smask);
                     55:        return psaplose (pi, PC_PARAMETER, NULLCP,
                     56:                            "invalid presentation descriptor");
                     57:     }
                     58: 
                     59:     if (SSelectMask (pb -> pb_fd, mask, nfds, &sis) == NOTOK)
                     60:        switch (sa -> sa_reason) {
                     61:            case SC_WAITING: 
                     62:                (void) sigiomask (smask);
                     63:                return psaplose (pi, PC_WAITING, NULLCP, NULLCP);
                     64: 
                     65:            default: 
                     66:                (void) ss2pslose (pb, pi, "SSelectMask", sa);
                     67:                freepblk (pb);
                     68:                (void) sigiomask (smask);
                     69:                return NOTOK;
                     70:        }
                     71: 
                     72:     (void) sigiomask (smask);
                     73: 
                     74:     return OK;
                     75: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.