| 48 | } |
| 49 | |
| 50 | int make_blocking(int fd) { |
| 51 | const int flags = fcntl(fd, F_GETFL, 0); |
| 52 | if (flags < 0) { |
| 53 | return flags; |
| 54 | } |
| 55 | if (flags & O_NONBLOCK) { |
| 56 | return fcntl(fd, F_SETFL, flags & ~O_NONBLOCK); |
| 57 | } |
| 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | int make_close_on_exec(int fd) { |
| 62 | return fcntl(fd, F_SETFD, FD_CLOEXEC); |
no outgoing calls
no test coverage detected