Home
last modified time | relevance | path

Searched refs:newfd (Results 1 – 25 of 44) sorted by relevance

12

/third_party/musl/libc-test/src/functionalext/supplement/unistd/
Drenameat.c31 int oldfd, newfd; in renameat_0100() local
41 if ((newfd = creat(newPath, S_IWUSR)) < 0) { in renameat_0100()
45 close(newfd); in renameat_0100()
52 if (renameat(oldfd, oldPath, newfd, newPath) == -1) { in renameat_0100()
56 newfd = open(newPath, O_RDWR); in renameat_0100()
57 int bytes = read(newfd, buf, len); in renameat_0100()
66 close(newfd); in renameat_0100()
Ddup3.c55 int newfd = -1; in dup3_0300() local
58 int ret = dup3(fd, newfd, O_CLOEXEC); in dup3_0300()
/third_party/mesa3d/src/util/
Dos_file.c54 int newfd = fcntl(fd, F_DUPFD_CLOEXEC, minfd); in os_dupfd_cloexec() local
56 if (newfd >= 0) in os_dupfd_cloexec()
57 return newfd; in os_dupfd_cloexec()
62 newfd = fcntl(fd, F_DUPFD, minfd); in os_dupfd_cloexec()
64 if (newfd < 0) in os_dupfd_cloexec()
67 long flags = fcntl(newfd, F_GETFD); in os_dupfd_cloexec()
69 close(newfd); in os_dupfd_cloexec()
73 if (fcntl(newfd, F_SETFD, flags | FD_CLOEXEC) == -1) { in os_dupfd_cloexec()
74 close(newfd); in os_dupfd_cloexec()
78 return newfd; in os_dupfd_cloexec()
/third_party/wayland_standard/src/
Dwayland-os.c78 int newfd; in wl_os_dupfd_cloexec() local
80 newfd = fcntl(fd, F_DUPFD_CLOEXEC, minfd); in wl_os_dupfd_cloexec()
81 if (newfd >= 0) in wl_os_dupfd_cloexec()
82 return newfd; in wl_os_dupfd_cloexec()
86 newfd = fcntl(fd, F_DUPFD, minfd); in wl_os_dupfd_cloexec()
87 return set_cloexec_or_close(newfd); in wl_os_dupfd_cloexec()
/third_party/grpc/src/core/lib/iomgr/
Dsocket_utils_common_posix.cc451 grpc_dualstack_mode* dsmode, int* newfd) { in grpc_create_dualstack_socket() argument
453 nullptr, resolved_addr, type, protocol, dsmode, newfd); in grpc_create_dualstack_socket()
465 int type, int protocol, grpc_dualstack_mode* dsmode, int* newfd) { in grpc_create_dualstack_socket_using_factory() argument
471 *newfd = create_socket(factory, family, type, protocol); in grpc_create_dualstack_socket_using_factory()
473 *newfd = -1; in grpc_create_dualstack_socket_using_factory()
477 if (*newfd >= 0 && grpc_set_socket_dualstack(*newfd)) { in grpc_create_dualstack_socket_using_factory()
484 return error_for_fd(*newfd, resolved_addr); in grpc_create_dualstack_socket_using_factory()
487 if (*newfd >= 0) { in grpc_create_dualstack_socket_using_factory()
488 close(*newfd); in grpc_create_dualstack_socket_using_factory()
493 *newfd = create_socket(factory, family, type, protocol); in grpc_create_dualstack_socket_using_factory()
[all …]
Dsocket_utils_posix.h155 int* newfd);
161 int protocol, grpc_dualstack_mode* dsmode, int* newfd);
/third_party/mesa3d/src/gallium/winsys/crocus/drm/
Dcrocus_drm_winsys.c35 int newfd = os_dupfd_cloexec(fd); in crocus_drm_screen_create() local
36 if (newfd < 0) in crocus_drm_screen_create()
38 return crocus_screen_create(newfd, config); in crocus_drm_screen_create()
/third_party/libuv/src/unix/
Dtty.c126 int newfd; in uv_tty_init() local
142 newfd = -1; in uv_tty_init()
181 newfd = r; in uv_tty_init()
183 r = uv__dup2_cloexec(newfd, fd); in uv_tty_init()
189 uv__close(newfd); in uv_tty_init()
193 fd = newfd; in uv_tty_init()
210 if (newfd != -1) in uv_tty_init()
211 uv__close(newfd); in uv_tty_init()
/third_party/mesa3d/src/gallium/winsys/iris/drm/
Diris_drm_winsys.c35 int newfd = os_dupfd_cloexec(fd); in iris_drm_screen_create() local
36 if (newfd < 0) in iris_drm_screen_create()
38 return iris_screen_create(newfd, config); in iris_drm_screen_create()
/third_party/musl/src/unistd/
Drenameat.c4 int renameat(int oldfd, const char *old, int newfd, const char *new) in renameat() argument
7 return syscall(SYS_renameat, oldfd, old, newfd, new); in renameat()
9 return syscall(SYS_renameat2, oldfd, old, newfd, new, 0); in renameat()
/third_party/ltp/testcases/kernel/syscalls/recvmsg/
Drecvmsg01.c452 int newfd; in do_child() local
455 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
456 if (newfd >= 0) { in do_child()
457 FD_SET(newfd, &afds); in do_child()
458 nfds = MAX(nfds, newfd + 1); in do_child()
460 (void)write(newfd, "hoser\n", 6); in do_child()
464 int newfd; in do_child() local
467 newfd = accept(ufd, (struct sockaddr *)&fsun, &fromlen); in do_child()
468 if (newfd >= 0) { in do_child()
469 FD_SET(newfd, &afds); in do_child()
[all …]
/third_party/ltp/testcases/kernel/syscalls/dup3/
Ddup3_02.c29 int *newfd; member
41 TST_EXP_FAIL2(dup3(*tc->oldfd, *tc->newfd, tc->flags), EINVAL, in run()
42 "dup3(%d, %d, %d)", *tc->oldfd, *tc->newfd, tc->flags); in run()
/third_party/toybox/toys/pending/
Dtcpsvd.c271 int hash, fd, newfd, j; in tcpsvd_main() local
311 newfd = fd; in tcpsvd_main()
313 newfd = accept(fd, (struct sockaddr *)buf, &len); in tcpsvd_main()
314 if (newfd < 0) perror_exit("Error on accept"); in tcpsvd_main()
331 if (ptr) write(newfd, ptr, strlen(ptr)+1); in tcpsvd_main()
332 close(newfd); in tcpsvd_main()
389 if (TT.udp) xconnect(newfd, (struct sockaddr *)buf, sizeof(buf)); in tcpsvd_main()
393 dup2(newfd, 0); in tcpsvd_main()
394 dup2(newfd, 1); in tcpsvd_main()
398 xclose(newfd); //close and reopen for next client. in tcpsvd_main()
/third_party/ltp/testcases/kernel/syscalls/recv/
Drecv01.c286 int newfd; in do_child() local
289 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
290 if (newfd >= 0) { in do_child()
291 FD_SET(newfd, &afds); in do_child()
292 nfds = MAX(nfds, newfd + 1); in do_child()
294 (void)write(newfd, "hoser\n", 6); in do_child()
/third_party/ltp/testcases/kernel/syscalls/recvfrom/
Drecvfrom01.c315 int newfd; in do_child() local
318 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
319 if (newfd >= 0) { in do_child()
320 FD_SET(newfd, &afds); in do_child()
321 nfds = MAX(nfds, newfd + 1); in do_child()
323 (void)write(newfd, "hoser\n", 6); in do_child()
/third_party/ltp/testcases/kernel/io/direct_io/
Ddiotest4.c196 int fd, newfd; in main() local
310 newfd = -1; in main()
311 ret = runtest_f(newfd, buf2, offset, count, EBADF, 5, "negative fd"); in main()
318 if ((newfd = getdtablesize()) < 0) { in main()
323 ret = runtest_f(newfd, buf2, offset, count, EBADF, 6, in main()
328 close(newfd); in main()
345 if ((newfd = open("/dev/null", O_DIRECT | O_RDWR)) < 0) { in main()
348 ret = runtest_s(newfd, buf2, offset, count, 9, "/dev/null"); in main()
352 close(newfd); in main()
/third_party/flutter/skia/experimental/Networking/
DSkSockets.cpp265 int newfd; in acceptConnections() local
284 newfd = accept(fSockfd, (struct sockaddr*)&clientAddr, &clientLen); in acceptConnections()
285 if (newfd< 0) { in acceptConnections()
289 SkDebugf("New incoming connection - %d\n", newfd); in acceptConnections()
292 this->setNonBlocking(newfd); in acceptConnections()
294 this->addToMasterSet(newfd); in acceptConnections()
/third_party/ltp/testcases/kernel/syscalls/connect/
Dconnect01.c306 int newfd; in do_child() local
309 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
310 if (newfd >= 0) { in do_child()
311 FD_SET(newfd, &afds); in do_child()
312 nfds = MAX(nfds, newfd + 1); in do_child()
/third_party/ltp/testcases/kernel/syscalls/send/
Dsend01.c229 int newfd; in do_child() local
232 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
233 if (newfd >= 0) { in do_child()
234 FD_SET(newfd, &afds); in do_child()
235 nfds = MAX(nfds, newfd + 1); in do_child()
/third_party/ltp/testcases/kernel/syscalls/sendmsg/
Dsendmsg01.c504 int newfd; in do_child() local
507 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
508 if (newfd >= 0) { in do_child()
509 FD_SET(newfd, &afds); in do_child()
510 nfds = MAX(nfds, newfd + 1); in do_child()
514 int newfd; in do_child() local
517 newfd = accept(ufd, (struct sockaddr *)&fsun, &fromlen); in do_child()
518 if (newfd >= 0) in do_child()
519 FD_SET(newfd, &afds); in do_child()
/third_party/ltp/testcases/kernel/syscalls/fanotify/
Dfanotify07.c161 int newfd; in test_fanotify() local
172 newfd = setup_instance(); in test_fanotify()
174 SAFE_CLOSE(newfd); in test_fanotify()
/third_party/gstreamer/gstreamer/tests/benchmarks/
Dgstpollstress.c101 GstPollFD *newfd = g_new0 (GstPollFD, 1); in mess_some_more() local
103 gst_poll_add_fd (set, newfd); in mess_some_more()
104 fds = g_list_prepend (fds, newfd); in mess_some_more()
/third_party/ltp/testcases/kernel/syscalls/sendto/
Dsendto01.c299 int newfd; in do_child() local
302 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
303 if (newfd >= 0) { in do_child()
304 FD_SET(newfd, &afds); in do_child()
305 nfds = MAX(nfds, newfd + 1); in do_child()
/third_party/NuttX/fs/vfs/
Dfs_link.c36 int do_link(int oldfd, const char *oldpath, int newfd, const char *newpath, int flag) in do_link() argument
59 ret = vfs_normalize_pathat(newfd, newpath, &fullnewpath); in do_link()
/third_party/ltp/lib/
Dtst_safe_macros.c494 int safe_dup2(const char *file, const int lineno, int oldfd, int newfd) in safe_dup2() argument
498 rval = dup2(oldfd, newfd); in safe_dup2()
502 "dup2(%i, %i) failed", oldfd, newfd); in safe_dup2()
503 } else if (rval != newfd) { in safe_dup2()
506 oldfd, newfd, rval); in safe_dup2()

12