|
|
1.1 root 1: /* ftamselect.c - FPM: map descriptors */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/ftam/RCS/ftamselect.c,v 7.1 89/12/14 10:04:10 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/ftam/RCS/ftamselect.c,v 7.1 89/12/14 10:04:10 mrose Exp $
9: *
10: *
11: * $Log: ftamselect.c,v $
12: * Revision 7.1 89/12/14 10:04:10 mrose
13: * bdt
14: *
15: * Revision 7.0 89/11/23 21:53:53 mrose
16: * Release 6.0
17: *
18: */
19:
20: /*
21: * NOTICE
22: *
23: * Acquisition, use, and distribution of this module and related
24: * materials are subject to the restrictions of a license agreement.
25: * Consult the Preface in the User's Manual for the full terms of
26: * this agreement.
27: *
28: */
29:
30:
31: /* LINTLIBRARY */
32:
33: #include <stdio.h>
34: #include <signal.h>
35: #include "fpkt.h"
36:
37: /* map ftam descriptors for select() */
38:
39: int FSelectMask (sd, mask, nfds, fti)
40: int sd;
41: fd_set *mask;
42: int *nfds;
43: struct FTAMindication *fti;
44: {
45: SBV smask;
46: register struct ftamblk *fsb;
47: struct PSAPindication pis;
48: register struct PSAPabort *pa = &pis.pi_abort;
49:
50: missingP (mask);
51: missingP (nfds);
52: missingP (fti);
53:
54: smask = sigioblock ();
55:
56: ftamPsig (fsb, sd);
57:
58: if (fsb -> fsb_data.px_ninfo > 0)
59: goto waiting;
60: if (PSelectMask (fsb -> fsb_fd, mask, nfds, &pis) == NOTOK)
61: switch (pa -> pa_reason) {
62: case PC_WAITING:
63: waiting: ;
64: (void) sigiomask (smask);
65: return ftamlose (fti, FS_GEN_WAITING, 0, NULLCP, NULLCP);
66:
67: default:
68: (void) ps2ftamlose (fsb, fti, "PSelectMask", pa);
69: freefsblk (fsb);
70: (void) sigiomask (smask);
71: return NOTOK;
72: }
73:
74: (void) sigiomask (smask);
75:
76: return OK;
77: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.