ndelay_on.c (224B)
1 /* ISC license. */ 2 3 #include <skalibs/fcntl.h> 4 #include <skalibs/djbunix.h> 5 6 int ndelay_on (int fd) 7 { 8 int got = fcntl(fd, F_GETFL) ; 9 return got < 0 ? got : got & O_NONBLOCK ? 0 : fcntl(fd, F_SETFL, got | O_NONBLOCK) ; 10 }