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