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

Function with_socketpair

lib_fiber/samples-c/test/kqueue_hook/main.c:58–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58static int with_socketpair(void (*fn)(int, int))
59{
60 int fds[2];
61 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
62 fail("socketpair failed");
63 return -1;
64 }
65 fn(fds[0], fds[1]);
66 close(fds[0]);
67 close(fds[1]);
68 return 0;
69}
70
71static void drain_read(int fd)
72{

Callers 1

fiber_mainFunction · 0.85

Calls 3

failFunction · 0.85
socketpairFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…