Home
last modified time | relevance | path

Searched refs:fds (Results 1 – 25 of 163) sorted by relevance

1234567

/external/chromium_org/native_client_sdk/src/tests/nacl_io_test/
Devent_test.cc236 void SetFDs(int* fds, int cnt) { in SetFDs() argument
242 EXPECT_NE(-1, fds[index]); in SetFDs()
243 FD_SET(fds[index], &rd_set); in SetFDs()
244 FD_SET(fds[index], &wr_set); in SetFDs()
245 FD_SET(fds[index], &ex_set); in SetFDs()
247 pollfds[index].fd = fds[index]; in SetFDs()
253 void CloseFDs(int* fds, int cnt) { in CloseFDs() argument
255 kp->close(fds[index]); in CloseFDs()
269 int fds[2]; in TEST_F() local
272 fds[0] = kp->open("/test.txt", O_CREAT | O_WRONLY); in TEST_F()
[all …]
/external/chromium_org/third_party/libjingle/source/talk/base/
Dlinuxfdwalk_unittest.cc42 std::set<int> *fds = static_cast<std::set<int> *>(data); in FdCheckVisitor() local
43 EXPECT_EQ(1U, fds->erase(fd)); in FdCheckVisitor()
47 std::set<int> *fds = static_cast<std::set<int> *>(data); in FdEnumVisitor() local
48 EXPECT_TRUE(fds->insert(fd).second); in FdEnumVisitor()
52 static void CheckOpenFdList(std::set<int> fds) { in CheckOpenFdList() argument
53 EXPECT_EQ(0, fdwalk(&FdCheckVisitor, &fds)); in CheckOpenFdList()
54 EXPECT_EQ(0U, fds.size()); in CheckOpenFdList()
57 static void GetOpenFdList(std::set<int> *fds) { in GetOpenFdList() argument
58 fds->clear(); in GetOpenFdList()
59 EXPECT_EQ(0, fdwalk(&FdEnumVisitor, fds)); in GetOpenFdList()
[all …]
/external/chromium_org/base/posix/
Dunix_domain_socket_linux.cc23 const std::vector<int>& fds) { in SendMsg() argument
30 if (fds.size()) { in SendMsg()
31 const unsigned control_len = CMSG_SPACE(sizeof(int) * fds.size()); in SendMsg()
40 cmsg->cmsg_len = CMSG_LEN(sizeof(int) * fds.size()); in SendMsg()
41 memcpy(CMSG_DATA(cmsg), &fds[0], sizeof(int) * fds.size()); in SendMsg()
60 std::vector<int>* fds) { in RecvMsg() argument
61 return UnixDomainSocket::RecvMsgWithFlags(fd, buf, length, 0, fds); in RecvMsg()
69 std::vector<int>* fds) { in RecvMsgWithFlags() argument
70 fds->clear(); in RecvMsgWithFlags()
109 fds->resize(wire_fds_len); in RecvMsgWithFlags()
[all …]
Dunix_domain_socket_linux_unittest.cc26 int fds[2]; in TEST() local
27 ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds)); in TEST()
28 file_util::ScopedFD scoped_fd0(&fds[0]); in TEST()
29 file_util::ScopedFD scoped_fd1(&fds[1]); in TEST()
36 fds[1], static_cast<uint8_t*>(NULL), 0U, static_cast<int*>(NULL), in TEST()
43 UnixDomainSocket::RecvMsg(fds[0], buffer, sizeof(buffer), in TEST()
63 int fds[2]; in TEST() local
64 ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds)); in TEST()
65 file_util::ScopedFD scoped_fd1(&fds[1]); in TEST()
66 ASSERT_EQ(0, IGNORE_EINTR(close(fds[0]))); in TEST()
[all …]
/external/e2fsprogs/lib/
Dfpopen.c42 int fds[2]; in fpopen() local
92 if (pipe(fds) < 0) in fpopen()
101 close(fds[1]); in fpopen()
102 dup2(fds[0], 0); in fpopen()
104 close(fds[0]); in fpopen()
105 dup2(fds[1], 1); in fpopen()
107 dup2(fds[1], 2); in fpopen()
113 return fdopen(do_stdin ? fds[1] : fds[0], mode); in fpopen()
/external/chromium_org/content/browser/renderer_host/
Drender_sandbox_host_linux.cc129 std::vector<int> fds; in HandleRequestFromRenderer() local
137 const ssize_t len = UnixDomainSocket::RecvMsg(fd, buf, sizeof(buf), &fds); in HandleRequestFromRenderer()
144 if (fds.empty()) in HandleRequestFromRenderer()
155 HandleFontMatchRequest(fd, pickle, iter, fds); in HandleRequestFromRenderer()
157 HandleFontOpenRequest(fd, pickle, iter, fds); in HandleRequestFromRenderer()
159 HandleGetFontFamilyForChar(fd, pickle, iter, fds); in HandleRequestFromRenderer()
161 HandleLocaltime(fd, pickle, iter, fds); in HandleRequestFromRenderer()
163 HandleGetChildWithInode(fd, pickle, iter, fds); in HandleRequestFromRenderer()
165 HandleGetStyleForStrike(fd, pickle, iter, fds); in HandleRequestFromRenderer()
167 HandleMakeSharedMemorySegment(fd, pickle, iter, fds); in HandleRequestFromRenderer()
[all …]
/external/compiler-rt/lib/tsan/lit_tests/
Dfd_dup_norace.cc9 int fds[2]; variable
13 read(fds[0], &buf, 1); in Thread1()
14 close(fds[0]); in Thread1()
19 close(fds[1]); in Thread2()
24 fds[0] = open("/dev/random", O_RDONLY); in main()
25 fds[1] = dup2(fds[0], 100); in main()
Dfd_socketpair_norace.cc8 int fds[2]; variable
13 write(fds[1], "a", 1); in Thread1()
14 close(fds[1]); in Thread1()
20 while (read(fds[0], &buf, 1) != 1) { in Thread2()
23 close(fds[0]); in Thread2()
28 socketpair(AF_UNIX, SOCK_STREAM, 0, fds); in main()
Dfd_pipe_race.cc6 int fds[2]; variable
9 write(fds[1], "a", 1); in Thread1()
15 close(fds[0]); in Thread2()
16 close(fds[1]); in Thread2()
21 pipe(fds); in main()
Dfd_location.cc6 int fds[2]; variable
9 write(fds[1], "a", 1); in Thread1()
15 close(fds[0]); in Thread2()
16 close(fds[1]); in Thread2()
21 pipe(fds); in main()
/external/openssh/openbsd-compat/
Dbsd-poll.c40 poll(struct pollfd *fds, nfds_t nfds, int timeout) in poll() argument
49 fd = fds[i].fd; in poll()
68 fd = fds[i].fd; in poll()
71 if (fds[i].events & POLLIN) { in poll()
75 if (fds[i].events & POLLOUT) { in poll()
93 fd = fds[i].fd; in poll()
94 fds[i].revents = 0; in poll()
98 fds[i].revents |= POLLIN; in poll()
101 fds[i].revents |= POLLOUT; in poll()
104 fds[i].revents |= POLLERR; in poll()
/external/chromium_org/sandbox/linux/seccomp-bpf/
Ddemo.cc383 int fds[2 + kNumFds]; in SendmsgStressThreadFnc() local
384 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) { in SendmsgStressThreadFnc()
390 if (!SendFds(fds[0], "test", 4, fds[1], fds[1], fds[1], -1) || in SendmsgStressThreadFnc()
391 !GetFds(fds[1], buf, &len, fds+2, fds+3, fds+4, NULL) || in SendmsgStressThreadFnc()
394 write(fds[2], "demo", 4) != 4 || in SendmsgStressThreadFnc()
395 read(fds[0], buf, 4) != 4 || in SendmsgStressThreadFnc()
401 if (close(fds[i])) { in SendmsgStressThreadFnc()
475 int fds[3]; in main() local
476 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) { in main()
482 if (!SendFds(fds[0], "test", 4, fds[1], -1) || in main()
[all …]
/external/openssh/openbsd-compat/regress/
Dclosefromtest.c39 int i, max, fds[NUM_OPENS]; in main() local
43 if ((fds[i] = open("/dev/null", O_RDONLY)) == -1) in main()
48 closefrom(fds[max]); in main()
49 if (close(fds[max]) != -1) in main()
54 if (read(fds[i], buf, sizeof(buf)) == -1) in main()
58 closefrom(fds[0]); in main()
60 if (close(fds[i]) != -1) in main()
/external/valgrind/main/none/tests/
Dsyscall-restart2.c18 int fds[2]; in main() local
20 if (pipe(fds) == -1) { in main()
43 close(fds[1]); in main()
44 ret = read(fds[0], &ch, 1); in main()
52 close(fds[0]); in main()
56 write(fds[1], "x", 1); in main()
Dsyscall-restart1.c18 int fds[2]; in main() local
20 if (pipe(fds) == -1) { in main()
43 close(fds[1]); in main()
44 ret = read(fds[0], &ch, 1); in main()
52 close(fds[0]); in main()
56 if (write(fds[1], "x", 1) != -1 || errno != EPIPE) in main()
/external/chromium_org/third_party/libevent/
Ddevpoll.c63 struct evdevpoll *fds; member
162 devpollop->fds = calloc(nfiles, sizeof(struct evdevpoll)); in devpoll_init()
163 if (devpollop->fds == NULL) { in devpoll_init()
173 free(devpollop->fds); in devpoll_init()
191 struct evdevpoll *fds; in devpoll_recalc() local
198 fds = realloc(devpollop->fds, nfds * sizeof(struct evdevpoll)); in devpoll_recalc()
199 if (fds == NULL) { in devpoll_recalc()
203 devpollop->fds = fds; in devpoll_recalc()
204 memset(fds + devpollop->nfds, 0, in devpoll_recalc()
253 evdp = &devpollop->fds[events[i].fd]; in devpoll_dispatch()
[all …]
Depoll.c65 struct evepoll *fds; member
141 epollop->fds = calloc(INITIAL_NFILES, sizeof(struct evepoll)); in epoll_init()
142 if (epollop->fds == NULL) { in epoll_init()
160 struct evepoll *fds; in epoll_recalc() local
167 fds = realloc(epollop->fds, nfds * sizeof(struct evepoll)); in epoll_recalc()
168 if (fds == NULL) { in epoll_recalc()
172 epollop->fds = fds; in epoll_recalc()
173 memset(fds + epollop->nfds, 0, in epoll_recalc()
221 evep = &epollop->fds[fd]; in epoll_dispatch()
280 evep = &epollop->fds[fd]; in epoll_add()
[all …]
/external/chromium/third_party/libevent/
Ddevpoll.c63 struct evdevpoll *fds; member
162 devpollop->fds = calloc(nfiles, sizeof(struct evdevpoll)); in devpoll_init()
163 if (devpollop->fds == NULL) { in devpoll_init()
173 free(devpollop->fds); in devpoll_init()
191 struct evdevpoll *fds; in devpoll_recalc() local
198 fds = realloc(devpollop->fds, nfds * sizeof(struct evdevpoll)); in devpoll_recalc()
199 if (fds == NULL) { in devpoll_recalc()
203 devpollop->fds = fds; in devpoll_recalc()
204 memset(fds + devpollop->nfds, 0, in devpoll_recalc()
253 evdp = &devpollop->fds[events[i].fd]; in devpoll_dispatch()
[all …]
Depoll.c65 struct evepoll *fds; member
141 epollop->fds = calloc(INITIAL_NFILES, sizeof(struct evepoll)); in epoll_init()
142 if (epollop->fds == NULL) { in epoll_init()
160 struct evepoll *fds; in epoll_recalc() local
167 fds = realloc(epollop->fds, nfds * sizeof(struct evepoll)); in epoll_recalc()
168 if (fds == NULL) { in epoll_recalc()
172 epollop->fds = fds; in epoll_recalc()
173 memset(fds + epollop->nfds, 0, in epoll_recalc()
221 evep = &epollop->fds[fd]; in epoll_dispatch()
280 evep = &epollop->fds[fd]; in epoll_add()
[all …]
/external/qemu/
Dos-posix.c54 static int fds[2]; variable
245 if (pipe(fds) == -1) in os_daemonize()
253 close(fds[1]); in os_daemonize()
256 len = read(fds[0], &status, 1); in os_daemonize()
270 close(fds[0]); in os_daemonize()
271 qemu_set_cloexec(fds[1]); in os_daemonize()
298 len = write(fds[1], &status, 1); in os_setup_post()
330 if (write(fds[1], &status, 1) != 1) { in os_pidfile_error()
345 int qemu_eventfd(int fds[2]) in qemu_eventfd()
352 fds[0] = ret; in qemu_eventfd()
[all …]
Dcompatfd.c75 int fds[2]; in qemu_signalfd_compat() local
83 if (pipe(fds) == -1) { in qemu_signalfd_compat()
88 qemu_set_cloexec(fds[0]); in qemu_signalfd_compat()
89 qemu_set_cloexec(fds[1]); in qemu_signalfd_compat()
92 info->fd = fds[1]; in qemu_signalfd_compat()
101 return fds[0]; in qemu_signalfd_compat()
/external/chromium_org/sandbox/linux/tests/
Dunit_tests.cc123 int fds[2]; in RunTestInProcess() local
124 ASSERT_EQ(0, pipe(fds)); in RunTestInProcess()
126 SANDBOX_ASSERT(fds[0] > 2 && fds[1] > 2); in RunTestInProcess()
134 SANDBOX_ASSERT(dup2(fds[1], 2) == 2); in RunTestInProcess()
135 SANDBOX_ASSERT(!close(fds[0])); in RunTestInProcess()
136 SANDBOX_ASSERT(!close(fds[1])); in RunTestInProcess()
153 close(fds[1]); in RunTestInProcess()
159 const int fcntl_ret = fcntl(fds[0], F_SETFL, O_NONBLOCK); in RunTestInProcess()
161 struct pollfd poll_fd = {fds[0], POLLIN | POLLRDHUP, 0}; in RunTestInProcess()
171 rc = HANDLE_EINTR(read(fds[0], &msg_buf[len], kCapacity)); in RunTestInProcess()
[all …]
/external/chromium_org/content/zygote/
Dzygote_linux.cc125 std::vector<int> fds; in HandleRequestFromBrowser() local
127 const ssize_t len = UnixDomainSocket::RecvMsg(fd, buf, sizeof(buf), &fds); in HandleRequestFromBrowser()
148 return HandleForkRequest(fd, pickle, iter, fds); in HandleRequestFromBrowser()
151 if (!fds.empty()) in HandleRequestFromBrowser()
156 if (!fds.empty()) in HandleRequestFromBrowser()
171 i = fds.begin(); i != fds.end(); ++i) in HandleRequestFromBrowser()
314 std::vector<int> fds; in ForkWithRealPid() local
320 fds.push_back(ipc_channel_fd); // kBrowserFDIndex in ForkWithRealPid()
321 fds.push_back(dummy_fd); // kDummyFDIndex in ForkWithRealPid()
322 fds.push_back(pipe_fds[0]); // kParentFDIndex in ForkWithRealPid()
[all …]
/external/chromium_org/content/browser/zygote_host/
Dzygote_host_impl_linux.cc83 int fds[2]; in Init() local
87 if (socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) != 0) in Init()
88 CHECK(socketpair(PF_UNIX, SOCK_DGRAM, 0, fds) == 0); in Init()
90 CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); in Init()
93 fds_to_map.push_back(std::make_pair(fds[1], kZygoteSocketPairFd)); in Init()
179 const ssize_t len = UnixDomainSocket::RecvMsg(fds[0], buf, sizeof(buf), in Init()
212 close(fds[1]); in Init()
213 control_fd_ = fds[0]; in Init()
270 const std::vector<int>* fds) { in SendMessage() argument
275 CHECK(!fds || fds->size() <= UnixDomainSocket::kMaxFileDescriptors) in SendMessage()
[all …]
/external/chromium_org/content/renderer/pepper/
Dpepper_broker_unittest.cc43 int fds[2] = {-1, -1}; in TEST_F() local
44 ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, fds)); in TEST_F()
46 ASSERT_EQ(0, fcntl(fds[1], F_SETFL, O_NONBLOCK)); in TEST_F()
47 base::FileDescriptor file_descriptor(fds[1], true); // Auto close. in TEST_F()
56 EXPECT_EQ(0, ::close(fds[0])); in TEST_F()

1234567