MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / evutil_fast_socket_closeonexec

Function evutil_fast_socket_closeonexec

src/commons/support/events.cpp:63–71  ·  view source on GitHub ↗

Faster version of evutil_make_socket_closeonexec for internal use. * * Requires that no F_SETFD flags were previously set on the fd. */

Source from the content-addressed store, hash-verified

61 * Requires that no F_SETFD flags were previously set on the fd.
62 */
63static 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 *

Callers 1

evutil_socket_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected