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

Function evutil_fast_socket_nonblocking

src/commons/support/events.cpp:77–87  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

75 * Requires that no F_SETFL flags were previously set on the fd.
76 */
77static int evutil_fast_socket_nonblocking(evutil_socket_t fd) {
78#ifdef _WIN32
79 return evutil_make_socket_nonblocking(fd);
80#else
81 if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
82 LogPrint(BCLog::ERROR, "evutil_fast_socket_nonblocking fcntl(%d, F_SETFL)\n", fd);
83 return -1;
84 }
85 return 0;
86#endif
87}
88
89/* Internal wrapper around 'socket' to provide Linux-style support for
90 * syscall-saving methods where available.

Callers 1

evutil_socket_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected