diff options
Diffstat (limited to 'nonblock.c')
| -rw-r--r-- | nonblock.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/nonblock.c b/nonblock.c deleted file mode 100644 index dbe31d3..0000000 --- a/nonblock.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Set stdin to nonblocking. */ -#include <sys/types.h> -#include <unistd.h> -#include <fcntl.h> -#include <errno.h> -int main(void) { - int flags; - flags = fcntl(0, F_GETFL); - flags |= O_NONBLOCK; - fcntl(0, F_SETFL, (long) flags); - flags = read(0, &flags, 1); - printf("read returns %d, errno == %d\n", flags, errno); - return 0; -} |