Commit | Line | Data |
---|---|---|
abbfd2f2 | 1 | #ifndef lint |
30647f51 | 2 | static char *sccsid = "@(#)wwiomux.c 3.1 83/08/11"; |
abbfd2f2 EW |
3 | #endif |
4 | ||
5 | #include "ww.h" | |
6 | ||
7 | wwforce(imask) | |
8 | register int *imask; | |
9 | { | |
bb05dfb5 | 10 | register struct ww **w; |
abbfd2f2 EW |
11 | char buf[512]; |
12 | register int n; | |
abbfd2f2 | 13 | |
bb05dfb5 EW |
14 | for (w = wwindex; w < &wwindex[NWW]; w++) |
15 | if (*w && (*w)->ww_haspty && (*w)->ww_pty >= 0) | |
16 | *imask |= 1 << (*w)->ww_pty; | |
17 | n = select(wwdtablesize, imask, (int *)0, (int *)0, | |
18 | (struct timeval *)0); | |
abbfd2f2 EW |
19 | if (n <= 0) |
20 | return -1; | |
bb05dfb5 EW |
21 | for (w = wwindex; w < &wwindex[NWW]; w++) |
22 | if (*w && (*w)->ww_haspty && (*w)->ww_pty >= 0 | |
23 | && *imask & 1 << (*w)->ww_pty) { | |
24 | n = read((*w)->ww_pty, buf, sizeof buf); | |
4711df8b | 25 | if (n > 0) |
bb05dfb5 | 26 | (void) wwwrite((*w), buf, n); |
abbfd2f2 | 27 | } |
abbfd2f2 EW |
28 | return 0; |
29 | } |