| author | "Tomas Zeman <tomas.zeman@sun.com>" |
| Fri, 19 Oct 2007 14:06:22 +0200 | |
| changeset 0 | 068428edee47 |
| permissions | -rw-r--r-- |
| 0 | 1 |
#include "select.h" |
2 |
#include "open.h" |
|
3 |
#include "fifo.h" |
|
4 |
||
5 |
#define FN "temp-trynpbg1.fifo" |
|
6 |
||
7 |
void main() |
|
8 |
{
|
|
9 |
int flagbug; |
|
10 |
struct timeval instant; |
|
11 |
fd_set rfds; |
|
12 |
||
13 |
flagbug = 0; |
|
14 |
if (fifo_make(FN,0600) != -1) {
|
|
15 |
close(0); |
|
16 |
if (open_read(FN) == 0) {
|
|
17 |
FD_ZERO(&rfds); |
|
18 |
FD_SET(0,&rfds); |
|
19 |
instant.tv_sec = instant.tv_usec = 0; |
|
20 |
if (select(1,&rfds,(fd_set *) 0,(fd_set *) 0,&instant) > 0) |
|
21 |
flagbug = 1; |
|
22 |
} |
|
23 |
unlink(FN); |
|
24 |
} |
|
25 |
_exit(!flagbug); |
|
26 |
} |