Lines Matching refs:fd

39   int fd = socket(PF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC | SOCK_NONBLOCK, 0);  in ConnectFn()  local
40 if (fd < 0) { in ConnectFn()
51 if (connect(fd, reinterpret_cast<struct sockaddr*>(&addr), sizeof(addr)) < 0) { in ConnectFn()
55 else if (callback_fn != nullptr && !callback_fn(fd)) { in ConnectFn()
59 close(fd); in ConnectFn()
65 bool (*callback_fn)(int fd), const char* sock_path) { in RunTest() argument
66 int fd = socket(PF_UNIX, SOCK_SEQPACKET, 0); in RunTest() local
67 ASSERT_NE(fd, -1) << strerror(errno); in RunTest()
75 …ASSERT_NE(-1, bind(fd, reinterpret_cast<struct sockaddr*>(&addr), sizeof(addr))) << strerror(errno… in RunTest()
77 ASSERT_NE(-1, listen(fd, 1)) << strerror(errno); in RunTest()
86 FD_SET(fd, &read_set); in RunTest()
90 ASSERT_LT(0, select(fd+1, &read_set, nullptr, nullptr, &tv)); in RunTest()
92 test_fn(&addr, fd); in RunTest()
98 close(fd); in RunTest()
106 static void TestAccept4(struct sockaddr_un* addr, int fd) { in TestAccept4() argument
108 int fd_acc = accept4(fd, reinterpret_cast<struct sockaddr*>(addr), &len, SOCK_CLOEXEC); in TestAccept4()
128 static bool SendMultiple(int fd) { in SendMultiple() argument
130 if (send(fd, g_RecvMsgs[i], strlen(g_RecvMsgs[i]) + 1, 0) < 0) { in SendMultiple()
139 static void TestRecvMMsg(struct sockaddr_un *addr, int fd) { in TestRecvMMsg() argument
141 int fd_acc = accept(fd, reinterpret_cast<struct sockaddr*>(addr), &len); in TestRecvMMsg()
188 static bool SendMMsg(int fd) { in SendMMsg() argument
200 if (sendmmsg(fd, msgs, NUM_SEND_MSGS, 0) < 0) { in SendMMsg()
207 static void TestSendMMsg(struct sockaddr_un *addr, int fd) { in TestSendMMsg() argument
209 int fd_acc = accept(fd, reinterpret_cast<struct sockaddr*>(addr), &len); in TestSendMMsg()