Set a fd into nonblocking mode. */
| 47 | |
| 48 | /* Set a fd into nonblocking mode. */ |
| 49 | void set_nonblocking(int fd) |
| 50 | { |
| 51 | int val; |
| 52 | |
| 53 | if ((val = fcntl(fd, F_GETFL)) == -1) |
| 54 | return; |
| 55 | if (!(val & NONBLOCK_FLAG)) { |
| 56 | val |= NONBLOCK_FLAG; |
| 57 | fcntl(fd, F_SETFL, val); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /* Set a fd into blocking mode. */ |
| 62 | void set_blocking(int fd) |
no outgoing calls
no test coverage detected