chiark
/
gitweb
/
~ian
/
chiark-tcl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
settling on interface to cdb binding
[chiark-tcl.git]
/
dgram
/
misc.c
1
/**/
2
3
#include "hbytes.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