|
|
1.1 root 1: /* rosapintr.c - ROPM: invoke (interruptable) */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/rosap/RCS/rosapintr.c,v 6.0 89/03/18 23:42:25 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/rosap/RCS/rosapintr.c,v 6.0 89/03/18 23:42:25 mrose Rel $
9: *
10: *
11: * $Log: rosapintr.c,v $
12: * Revision 6.0 89/03/18 23:42:25 mrose
13: * Release 5.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 "rosap.h"
33:
34: /* */
35:
36: static int interrupted;
37: SFD intrser ();
38:
39: /* RO-INVOKE.REQUEST (interruptable) */
40:
41: int RoIntrRequest (sd, op, args, invokeID, linkedID, priority, roi)
42: int sd;
43: int op,
44: invokeID,
45: *linkedID,
46: priority;
47: PE args;
48: struct RoSAPindication *roi;
49: {
50: int nfds,
51: result;
52: fd_set rfds;
53: SFP istat;
54:
55: if (RoInvokeRequest (sd, op, ROS_ASYNC, args, invokeID, linkedID, priority,
56: roi) == NOTOK)
57: return NOTOK;
58:
59: interrupted = 0;
60: istat = signal (SIGINT, intrser);
61:
62: for (;;) {
63: nfds = 0;
64: FD_ZERO (&rfds);
65:
66: /* interrupt causes EINTR */
67: if (RoSelectMask (sd, &rfds, &nfds, roi) == OK)
68: (void) xselect (nfds, &rfds, NULLFD, NULLFD, NOTOK);
69:
70: if (interrupted) {
71: result = rosaplose (roi, ROS_INTERRUPTED, NULLCP, NULLCP);
72: break;
73: }
74:
75: if ((result = RoWaitRequest (sd, OK, roi)) != NOTOK
76: || roi -> roi_preject.rop_reason != ROS_TIMER)
77: break;
78: }
79:
80: (void) signal (SIGINT, istat);
81:
82: return result;
83: }
84:
85: /* */
86:
87: /* ARGSUSED */
88:
89: static SFD intrser (sig)
90: int sig;
91: {
92: #ifndef BSDSIGS
93: (void) signal (SIGINT, intrser);
94: #endif
95:
96: interrupted++;
97: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.