Commit | Line | Data |
---|---|---|
9319b3c3 C |
1 | /* ssapselect.c - SPM: map descriptors */ |
2 | ||
3 | #ifndef lint | |
4 | static char *rcsid = "$Header: /f/osi/ssap/RCS/ssapselect.c,v 7.1 91/02/22 09:46:07 mrose Interim $"; | |
5 | #endif | |
6 | ||
7 | /* | |
8 | * $Header: /f/osi/ssap/RCS/ssapselect.c,v 7.1 91/02/22 09:46:07 mrose Interim $ | |
9 | * | |
10 | * | |
11 | * $Log: ssapselect.c,v $ | |
12 | * Revision 7.1 91/02/22 09:46:07 mrose | |
13 | * Interim 6.8 | |
14 | * | |
15 | * Revision 7.0 89/11/23 22:25:50 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 "spkt.h" | |
36 | ||
37 | /* \f map session descriptors for select() */ | |
38 | ||
39 | int SSelectMask (sd, mask, nfds, si) | |
40 | int sd; | |
41 | fd_set *mask; | |
42 | int *nfds; | |
43 | register struct SSAPindication *si; | |
44 | { | |
45 | SBV smask; | |
46 | int result; | |
47 | register struct ssapblk *sb; | |
48 | struct TSAPdisconnect tds; | |
49 | register struct TSAPdisconnect *td = &tds; | |
50 | ||
51 | missingP (mask); | |
52 | missingP (nfds); | |
53 | ||
54 | smask = sigioblock (); | |
55 | ||
56 | if ((sb = findsblk (sd)) == NULL) { | |
57 | (void) sigiomask (smask); | |
58 | return ssaplose (si, SC_PARAMETER, NULLCP, | |
59 | "invalid session descriptor"); | |
60 | } | |
61 | ||
62 | if ((result = TSelectMask (sb -> sb_fd, mask, nfds, td)) == NOTOK) | |
63 | if (td -> td_reason == DR_WAITING) | |
64 | (void) ssaplose (si, SC_WAITING, NULLCP, NULLCP); | |
65 | else | |
66 | (void) ts2sslose (si, "TSelectMask", td); | |
67 | ||
68 | (void) sigiomask (smask); | |
69 | ||
70 | return result; | |
71 | } |