Faster version of evutil_make_socket_closeonexec for internal use. * * Requires that no F_SETFD flags were previously set on the fd. */
| 61 | * Requires that no F_SETFD flags were previously set on the fd. |
| 62 | */ |
| 63 | static int evutil_fast_socket_closeonexec(evutil_socket_t fd) { |
| 64 | #if !defined(_WIN32) && defined(EVENT__HAVE_SETFD) |
| 65 | if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { |
| 66 | LogPrint(BCLog::ERROR, "evutil_fast_socket_closeonexec fcntl(%d, F_SETFD)\n", fd); |
| 67 | return -1; |
| 68 | } |
| 69 | #endif |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | /* Faster version of evutil_make_socket_nonblocking for internal use. |
| 74 | * |