MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_sane_socketpair

Function acl_sane_socketpair

lib_acl/src/stdlib/sys/acl_sane_socketpair.c:27–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25/* sane_socketpair - sanitize socketpair() error returns */
26
27int acl_sane_socketpair(int domain, int type, int protocol, ACL_SOCKET result[2])
28{
29 static int socketpair_ok_errors[] = {
30 EINTR,
31 0,
32 };
33 int count;
34 int err;
35 int ret;
36
37 /*
38 * Solaris socketpair() can fail with EINTR.
39 */
40 while ((ret = socketpair(domain, type, protocol, result)) < 0) {
41 for (count = 0; /* void */ ; count++) {
42 if ((err = socketpair_ok_errors[count]) == 0) {
43 return (ret);
44 }
45 if (acl_last_error() == err) {
46 acl_msg_warn("socketpair: %s (trying again)",
47 acl_last_serror());
48 sleep(1);
49 break;
50 }
51 }
52 }
53 return ret;
54}
55
56#elif defined(ACL_WINDOWS)
57

Callers 5

channel_openFunction · 0.85
acl_mbox_create2Function · 0.85
acl_duplex_pipeFunction · 0.85
mainFunction · 0.85
event_mutexMethod · 0.85

Calls 14

acl_last_errorFunction · 0.85
acl_msg_warnFunction · 0.85
acl_last_serrorFunction · 0.85
acl_inet_listenFunction · 0.85
acl_msg_errorFunction · 0.85
acl_tcp_set_nodelayFunction · 0.85
acl_getsocknameFunction · 0.85
acl_socket_closeFunction · 0.85
acl_inet_connectFunction · 0.85
acl_non_blockingFunction · 0.85
acl_tcp_so_lingerFunction · 0.85
sleepFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…