|
|
1.1 root 1: /* isore.c - help out ISODE TSAP programs */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/support/RCS/isore.c,v 7.0 89/11/23 22:27:34 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/support/RCS/isore.c,v 7.0 89/11/23 22:27:34 mrose Rel $
9: *
10: *
11: * $Log: isore.c,v $
12: * Revision 7.0 89/11/23 22:27:34 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: #include <stdio.h>
29: #include <signal.h>
30: #include "manifest.h"
31:
32: /* MAIN */
33:
34: SFD EMTser ();
35:
36:
37: /* ARGSUSED */
38:
39: main (argc, argv, envp)
40: int argc;
41: char **argv,
42: **envp;
43: {
44: int fd,
45: mask,
46: nfds,
47: ppid;
48: fd_set ifds,
49: rfds;
50:
51: if (argc != 4)
52: exit (1);
53: if ((nfds = atoi (argv[1])) < 0
54: || sscanf (argv[2], "0x%x", &mask) != 1
55: || (ppid = atoi (argv[3])) < 0)
56: exit (2);
57:
58: FD_ZERO (&rfds);
59: for (fd = 0; fd < nfds; fd++)
60: if (mask & (1 << fd))
61: FD_SET (fd, &rfds);
62:
63: (void) signal (SIGEMT, EMTser);
64:
65: for (;;) {
66: ifds = rfds;
67: switch (xselect (nfds, &ifds, NULLFD, NULLFD, NOTOK)) {
68: case NOTOK:
69: fprintf (stderr, "NOTOK\n");
70: break;
71:
72: case OK:
73: fprintf (stderr, "OK\n");
74: break;
75:
76: default:
77: (void) kill (ppid, SIGEMT);
78: sigpause (0);
79: break;
80: }
81: }
82: }
83:
84: /* SIGNALS */
85:
86: /* ARGSUSED */
87:
88: static SFD EMTser (sig, code, sc)
89: int sig;
90: long code;
91: struct sigcontext *sc;
92: {
93: #ifndef BSDSIGS
94: (void) signal (SIGEMT, EMTser);
95: #endif
96: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.