blob: cf05cfb3479e18b8f345a0d515c1658fb0340805 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
/*
* waitstdin -- wait for text on stdin
* $ cc -O2 -o waitstdin waitstdin.c
*/
#include <sys/select.h>
#include <sys/wait.h>
int
main()
{
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(0, &readfds);
if(select(1, &readfds, NULL, NULL, NULL) == -1)
return 1;
return 0;
}
|