|
|
1.1 ! root 1: /* psapselect.c - PPM: map descriptors */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/psap2-lpp/RCS/psapselect.c,v 7.0 89/11/23 22:16:02 mrose Rel $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/psap2-lpp/RCS/psapselect.c,v 7.0 89/11/23 22:16:02 mrose Rel $ ! 9: * ! 10: * Contributed by The Wollongong Group, Inc. ! 11: * ! 12: * ! 13: * $Log: psapselect.c,v $ ! 14: * Revision 7.0 89/11/23 22:16:02 mrose ! 15: * Release 6.0 ! 16: * ! 17: */ ! 18: ! 19: /* ! 20: * NOTICE ! 21: * ! 22: * Acquisition, use, and distribution of this module and related ! 23: * materials are subject to the restrictions of a license agreement. ! 24: * Consult the Preface in the User's Manual for the full terms of ! 25: * this agreement. ! 26: * ! 27: */ ! 28: ! 29: ! 30: /* LINTLIBRARY */ ! 31: ! 32: #include <stdio.h> ! 33: #include <signal.h> ! 34: #define LPP ! 35: #include "ppkt.h" ! 36: ! 37: /* map presentation descriptors for select() */ ! 38: ! 39: int PSelectMask (sd, mask, nfds, pi) ! 40: int sd; ! 41: fd_set *mask; ! 42: int *nfds; ! 43: struct PSAPindication *pi; ! 44: { ! 45: SBV smask; ! 46: int reason, ! 47: result; ! 48: register struct psapblk *pb; ! 49: ! 50: missingP (mask); ! 51: missingP (nfds); ! 52: missingP (pi); ! 53: ! 54: smask = sigioblock (); ! 55: ! 56: if ((pb = findpblk (sd)) == NULL) { ! 57: (void) sigiomask (smask); ! 58: return psaplose (pi, PC_PARAMETER, NULLCP, ! 59: "invalid presentation descriptor"); ! 60: } ! 61: ! 62: result = pb -> pb_checkfnx ? (*pb -> pb_checkfnx) (pb, pi) : OK; ! 63: if (result == NOTOK && (reason = pi -> pi_abort.pa_reason) != PC_TIMER) { ! 64: if (PC_FATAL (reason)) ! 65: freepblk (pb); ! 66: } ! 67: else { ! 68: FD_SET (pb -> pb_fd, mask); ! 69: if (pb -> pb_fd > *nfds) ! 70: *nfds = pb -> pb_fd + 1; ! 71: } ! 72: ! 73: (void) sigiomask (smask); ! 74: ! 75: return result; ! 76: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.