chiark / gitweb /
Compiles and runs. Now all it needs is meat.
[chiark-tcl.git] / dgram / misc.c
1 /**/
2
3 #include "all.h"
4
5 int setnonblock(int fd, int isnonblock) {
6   int r;
7
8   r= fcntl(fd,F_GETFL); 
9   if (r==-1) return -1;
10   r= fcntl(fd,F_SETFL, isnonblock ? r|O_NONBLOCK : r&~O_NONBLOCK);
11   if (r==-1) return -1;
12   return 0;
13 }
14