Home
last modified time | relevance | path

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

123

/third_party/elfutils/src/
Dar.c423 copy_content (Elf *elf, int newfd, off_t off, size_t n) in copy_content() argument
435 return write_retry (newfd, rawfile + off, n) != (ssize_t) n; in copy_content()
758 int newfd = mkstemp (tmpfname); in do_oper_extract() local
759 if (unlikely (newfd == -1)) in do_oper_extract()
768 if (unlikely (write_retry (newfd, ARMAG, SARMAG) != SARMAG)) in do_oper_extract()
773 if (newfd != -1) in do_oper_extract()
774 close (newfd); in do_oper_extract()
789 && ((write_retry (newfd, symtab.symsoff, in do_oper_extract()
792 || (write_retry (newfd, symtab.symsname, in do_oper_extract()
799 && copy_content (elf, newfd, SARMAG, index_off - SARMAG)) in do_oper_extract()
[all …]
Dranlib.c117 copy_content (Elf *elf, int newfd, off_t off, size_t n) in copy_content() argument
129 return write_retry (newfd, rawfile + off, n) != (ssize_t) n; in copy_content()
217 int newfd = mkstemp (tmpfname); in handle_file() local
218 if (unlikely (newfd == -1)) in handle_file()
227 if (unlikely (write_retry (newfd, ARMAG, SARMAG) != SARMAG)) in handle_file()
232 if (newfd != -1) in handle_file()
233 close (newfd); in handle_file()
248 && ((write_retry (newfd, symtab.symsoff, in handle_file()
251 || (write_retry (newfd, symtab.symsname, in handle_file()
259 && copy_content (arelf, newfd, SARMAG, index_off - SARMAG)) in handle_file()
[all …]
/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/musl/libc-test/src/functional/
Drenameat2_test.c25 int oldfd, newfd; in main() local
36 if ((newfd = creat(newPath, S_IWUSR)) < 0) in main()
41 close(newfd); in main()
49 if (renameat2(oldfd, oldPath, newfd, newPath, 0) == -1) in main()
54 newfd = open(newPath, O_RDWR); in main()
55 int bytes = read(newfd, buf, len); in main()
66 close(newfd); in main()
/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/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()
13 int renameat2(int oldfd, const char *old, int newfd, const char *new, unsigned int flags) in renameat2() argument
15 return syscall(SYS_renameat2, oldfd, old, newfd, new, flags); in renameat2()
/third_party/ltp/testcases/kernel/syscalls/recvmsg/
Drecvmsg01.c454 int newfd; in do_child() local
457 newfd = SAFE_ACCEPT(sfd, (struct sockaddr *)&fsin, &fromlen); in do_child()
458 if (newfd >= 0) { in do_child()
459 FD_SET(newfd, &afds); in do_child()
460 nfds = MAX(nfds, newfd + 1); in do_child()
462 SAFE_SEND(1, newfd, "hi", 2, 0); in do_child()
466 int newfd; in do_child() local
469 newfd = SAFE_ACCEPT(ufd, (struct sockaddr *)&fsun, &fromlen); in do_child()
470 if (newfd >= 0) { in do_child()
471 FD_SET(newfd, &afds); in do_child()
[all …]
/third_party/node/deps/uv/src/unix/
Dtty.c139 int newfd; in uv_tty_init() local
155 newfd = -1; in uv_tty_init()
194 newfd = r; in uv_tty_init()
196 r = uv__dup2_cloexec(newfd, fd); in uv_tty_init()
202 uv__close(newfd); in uv_tty_init()
206 fd = newfd; in uv_tty_init()
223 if (newfd != -1) in uv_tty_init()
224 uv__close(newfd); in uv_tty_init()
/third_party/libuv/src/unix/
Dtty.c139 int newfd; in uv_tty_init() local
155 newfd = -1; in uv_tty_init()
194 newfd = r; in uv_tty_init()
196 r = uv__dup2_cloexec(newfd, fd); in uv_tty_init()
202 uv__close(newfd); in uv_tty_init()
206 fd = newfd; in uv_tty_init()
223 if (newfd != -1) in uv_tty_init()
224 uv__close(newfd); in uv_tty_init()
/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/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/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/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/ltp/testcases/kernel/io/direct_io/
Ddiotest4.c195 int fd, newfd; in main() local
309 newfd = -1; in main()
310 ret = runtest_f(newfd, buf2, offset, count, EBADF, 5, "negative fd"); in main()
317 if ((newfd = getdtablesize()) < 0) { in main()
322 ret = runtest_f(newfd, buf2, offset, count, EBADF, 6, in main()
327 close(newfd); in main()
344 if ((newfd = open("/dev/null", O_DIRECT | O_RDWR)) < 0) { in main()
347 ret = runtest_s(newfd, buf2, offset, count, 9, "/dev/null"); in main()
351 close(newfd); in main()
/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/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/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/fanotify/
Dfanotify07.c159 int newfd; in test_fanotify() local
170 newfd = setup_instance(); in test_fanotify()
172 SAFE_CLOSE(newfd); in test_fanotify()
/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/ltp/lib/
Dtst_safe_macros.c533 int safe_dup2(const char *file, const int lineno, int oldfd, int newfd) in safe_dup2() argument
537 rval = dup2(oldfd, newfd); in safe_dup2()
541 "dup2(%i, %i) failed", oldfd, newfd); in safe_dup2()
542 } else if (rval != newfd) { in safe_dup2()
545 oldfd, newfd, rval); in safe_dup2()
/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()
Dfs_symlink.c93 int do_symlink(const char *target, int newfd, const char *path) in do_symlink() argument
120 ret = vfs_normalize_pathat(newfd, path, &fullpath); in do_symlink()
/third_party/libfuse/example/
Dpassthrough_ll.c312 int newfd; in lo_do_lookup() local
322 newfd = openat(lo_fd(req, parent), name, O_PATH | O_NOFOLLOW); in lo_do_lookup()
323 if (newfd == -1) in lo_do_lookup()
326 res = fstatat(newfd, "", &e->attr, AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW); in lo_do_lookup()
332 close(newfd); in lo_do_lookup()
333 newfd = -1; in lo_do_lookup()
343 inode->fd = newfd; in lo_do_lookup()
366 if (newfd != -1) in lo_do_lookup()
367 close(newfd); in lo_do_lookup()

123