Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 96) sorted by relevance

1234

/third_party/ulib/musl/src/legacy/
A Dgetpass.c9 int fd; in getpass() local
14 if ((fd = open("/dev/tty", O_RDWR | O_NOCTTY | O_CLOEXEC)) < 0) in getpass()
17 tcgetattr(fd, &t); in getpass()
23 tcsetattr(fd, TCSAFLUSH, &t); in getpass()
24 tcdrain(fd); in getpass()
26 dprintf(fd, "%s", prompt); in getpass()
28 l = read(fd, password, sizeof password); in getpass()
35 tcsetattr(fd, TCSAFLUSH, &s); in getpass()
37 dprintf(fd, "\n"); in getpass()
38 close(fd); in getpass()
A Dfutimes.c5 int futimes(int fd, const struct timeval tv[2]) { in futimes() argument
8 return futimens(fd, 0); in futimes()
13 return futimens(fd, times); in futimes()
/third_party/ulib/musl/stubs/
A Dsocketstubs.c17 static int stub_socketpair(int domain, int type, int protocol, int fd[2]) { in stub_socketpair()
23 static int stub_shutdown(int fd, int how) { in stub_shutdown() argument
29 static int stub_bind(int fd, const struct sockaddr* addr, socklen_t len) { in stub_bind() argument
35 static int stub_connect(int fd, const struct sockaddr* addr, socklen_t len) { in stub_connect() argument
41 static int stub_listen(int fd, int backlog) { in stub_listen() argument
53 static int stub_getsockname(int fd, struct sockaddr* restrict addr, socklen_t* restrict len) { in stub_getsockname() argument
59 static int stub_getpeername(int fd, struct sockaddr* restrict addr, socklen_t* restrict len) { in stub_getpeername() argument
77 static ssize_t stub_sendmsg(int fd, const struct msghdr* msg, int flags) { in stub_sendmsg() argument
83 static ssize_t stub_recvmsg(int fd, struct msghdr* msg, int flags) { in stub_recvmsg() argument
89 static int stub_sendmmsg(int fd, struct mmsghdr* msgvec, unsigned int vlen, unsigned int flags) { in stub_sendmmsg() argument
[all …]
A Diostubs.c44 static int stub_close(int fd) { in stub_close() argument
72 static int stub_isatty(int fd) { in stub_isatty() argument
198 static int stub_fstat(int fd, struct stat* s) { in stub_fstat() argument
289 static DIR* stub_fdopendir(int fd) { in stub_fdopendir() argument
355 static int stub_fchmod(int fd, mode_t mode) { in stub_fchmod() argument
397 static int stub_fcntl(int fd, int cmd, ...) { in stub_fcntl() argument
404 static int stub_fdatasync(int fd) { in stub_fdatasync() argument
411 static int stub_fsync(int fd) { in stub_fsync() argument
418 static int stub_ftruncate(int fd, off_t length) { in stub_ftruncate() argument
480 static int stub_syncfs(int fd) { in stub_syncfs() argument
[all …]
/third_party/ulib/musl/src/stdio/
A Dfopen.c9 int fd; in fopen() local
21 fd = open(filename, flags, 0666); in fopen()
22 if (fd < 0) in fopen()
25 fcntl(fd, F_SETFD, FD_CLOEXEC); in fopen()
27 f = __fdopen(fd, mode); in fopen()
31 close(fd); in fopen()
A D__fdopen.c9 FILE* __fdopen(int fd, const char* mode) { in __fdopen() argument
19 int flags = fcntl(fd, F_GETFL); in __fdopen()
37 fcntl(fd, F_SETFD, FD_CLOEXEC); in __fdopen()
42 fcntl(fd, F_SETFL, flags | O_APPEND); in __fdopen()
46 f->fd = fd; in __fdopen()
52 if (!(f->flags & F_NOWR) && isatty(fd)) in __fdopen()
A Dtmpfile.c13 int fd; in tmpfile() local
19 fd = open(s, O_RDWR | O_CREAT | O_EXCL, 0600); in tmpfile()
20 if (fd >= 0) { in tmpfile()
22 f = __fdopen(fd, "w+"); in tmpfile()
24 close(fd); in tmpfile()
A Dfreopen.c23 fcntl(f->fd, F_SETFD, FD_CLOEXEC); in freopen()
25 if (fcntl(f->fd, F_SETFL, fl) < 0) in freopen()
31 if (f2->fd == f->fd) in freopen()
32 f2->fd = -1; /* avoid closing in fclose */ in freopen()
33 else if (dup3(f2->fd, f->fd, fl & O_CLOEXEC) < 0) in freopen()
A Dvdprintf.c7 int vdprintf(int fd, const char* restrict fmt, va_list ap) { in vdprintf() argument
9 .fd = fd, .lbf = EOF, .write = wrap_write, .buf = (void*)fmt, .buf_size = 0, .lock = -1}; in vdprintf()
/third_party/ulib/musl/src/network/
A Dnetlink.c7 static int __netlink_enumerate(int fd, unsigned int seq, int type, int af, in __netlink_enumerate() argument
26 r = send(fd, &u.req, sizeof(u.req), 0); in __netlink_enumerate()
31 r = recv(fd, u.buf, sizeof(u.buf), MSG_DONTWAIT); in __netlink_enumerate()
48 int fd, r; in __rtnetlink_enumerate() local
50 fd = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); in __rtnetlink_enumerate()
51 if (fd < 0) in __rtnetlink_enumerate()
53 r = __netlink_enumerate(fd, 1, RTM_GETLINK, link_af, cb, ctx); in __rtnetlink_enumerate()
55 r = __netlink_enumerate(fd, 2, RTM_GETADDR, addr_af, cb, ctx); in __rtnetlink_enumerate()
56 close(fd); in __rtnetlink_enumerate()
A Dif_nametoindex.c10 int fd, r; in if_nametoindex() local
12 if ((fd = socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) in if_nametoindex()
15 r = ioctl(fd, SIOCGIFINDEX, &ifr); in if_nametoindex()
16 close(fd); in if_nametoindex()
A Dif_indextoname.c10 int fd, r; in if_indextoname() local
12 if ((fd = socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0) in if_indextoname()
15 r = ioctl(fd, SIOCGIFNAME, &ifr); in if_indextoname()
16 close(fd); in if_indextoname()
A Dres_msend.c24 int fd; in __res_msend_rc() local
59 fd = socket(family, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0); in __res_msend_rc()
62 if (fd < 0 && family == AF_INET6 && errno == EAFNOSUPPORT) { in __res_msend_rc()
63 fd = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0); in __res_msend_rc()
66 if (fd < 0 || bind(fd, (void*)&sa, sl) < 0) in __res_msend_rc()
75 setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &(int){0}, sizeof 0); in __res_msend_rc()
89 pfd.fd = fd; in __res_msend_rc()
102 sendto(fd, queries[i], qlens[i], 0, (void*)&ns[j], sl); in __res_msend_rc()
111 while ((rlen = recvfrom(fd, answers[next], asize, 0, (void*)&sa, (socklen_t[1]){sl})) >= in __res_msend_rc()
143 sendto(fd, queries[i], qlens[i], 0, (void*)&ns[j], sl); in __res_msend_rc()
/third_party/ulib/usbhost/
A Dusbhost.c71 int fd; member
142 if (context->fd < 0) { in usb_host_init()
151 close(context->fd); in usb_host_cleanup()
156 return context->fd; in usb_host_get_fd()
314 close(device->fd); in usb_device_close()
329 device->fd = fd; in usb_device_new()
337 close(fd); in usb_device_new()
346 if (fd >= 0) { in usb_device_reopen_writeable()
348 device->fd = fd; in usb_device_reopen_writeable()
359 return device->fd; in usb_device_get_fd()
[all …]
/third_party/uapp/dash/src/
A Dinput.c416 int fd; in setinputfile() local
425 if (fd < 10) in setinputfile()
426 fd = savefd(fd, fd); in setinputfile()
430 return fd; in setinputfile()
446 parsefile->fd = fd; in setinputfd()
484 pf->fd = -1; in pushfile()
498 if (pf->fd >= 0) in popfile()
499 close(pf->fd); in popfile()
532 if (parsefile->fd > 0) { in closescript()
533 close(parsefile->fd); in closescript()
[all …]
A Dredir.c103 int fd; in redirect() local
125 fd = n->nfile.fd; in redirect()
128 p = &sv->renamed[fd]; in redirect()
133 if (fd != newfd) { in redirect()
134 i = savefd(fd, fd); in redirect()
135 fd = -1; in redirect()
146 if (fd == newfd) in redirect()
254 int fd = redir->nfile.fd; local
258 memory[fd] = 0;
265 memory[fd] = 1;
[all …]
/third_party/ulib/musl/src/time/
A D__map_file.c11 int fd = open(pathname, O_RDONLY | O_CLOEXEC | O_NONBLOCK); in __map_file() local
12 if (fd < 0) in __map_file()
14 if (!fstat(fd, &st)) { in __map_file()
15 map = __mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0); in __map_file()
18 close(fd); in __map_file()
/third_party/ulib/ngunwind/include/ngunwind/private/
A Delfxx.h73 int fd; in elf_map_image() local
75 fd = open (path, O_RDONLY); in elf_map_image()
76 if (fd < 0) in elf_map_image()
79 if (fstat (fd, &stat) < 0) in elf_map_image()
81 close (fd); in elf_map_image()
86 ei->image = mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0); in elf_map_image()
87 close (fd); in elf_map_image()
/third_party/ulib/musl/src/passwd/
A Dnscd_query.c17 int fd; in __nscd_query() local
30 fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); in __nscd_query()
31 if (fd < 0) in __nscd_query()
34 if (!(f = fdopen(fd, "r"))) { in __nscd_query()
35 close(fd); in __nscd_query()
42 if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { in __nscd_query()
54 if (sendmsg(fd, &msg, 0) < 0) in __nscd_query()
/third_party/lib/acpica/source/os_specific/service_layers/
A Dosunixmap.c114 int fd; in AcpiOsMapMemory() local
117 fd = open (SYSTEM_MEMORY, O_RDONLY | O_BINARY); in AcpiOsMapMemory()
118 if (fd < 0) in AcpiOsMapMemory()
132 fd, (Where - Offset)); in AcpiOsMapMemory()
136 close (fd); in AcpiOsMapMemory()
140 close (fd); in AcpiOsMapMemory()
/third_party/ulib/musl/src/misc/
A Dpty.c12 int grantpt(int fd) { in grantpt() argument
16 int unlockpt(int fd) { in unlockpt() argument
18 return ioctl(fd, TIOCSPTLCK, &unlock); in unlockpt()
21 int __ptsname_r(int fd, char* buf, size_t len) { in __ptsname_r() argument
A Dlockf.c5 int lockf(int fd, int op, off_t size) { in lockf() argument
12 if (fcntl(fd, F_GETLK, &l) < 0) in lockf()
21 return fcntl(fd, F_SETLK, &l); in lockf()
23 return fcntl(fd, F_SETLKW, &l); in lockf()
/third_party/ulib/jemalloc/test/unit/
A Dprof_idump.c21 int fd; in prof_dump_open_intercept() local
25 fd = open("/dev/null", O_WRONLY); in prof_dump_open_intercept()
26 assert_d_ne(fd, -1, "Unexpected open() failure"); in prof_dump_open_intercept()
28 return (fd); in prof_dump_open_intercept()
/third_party/ulib/musl/src/process/
A Dposix_spawn_file_actions_addclose.c6 int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* fa, int fd) { in posix_spawn_file_actions_addclose() argument
11 op->fd = fd; in posix_spawn_file_actions_addclose()
A Dposix_spawn_file_actions_adddup2.c6 int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* fa, int srcfd, int fd) { in posix_spawn_file_actions_adddup2() argument
12 op->fd = fd; in posix_spawn_file_actions_adddup2()

Completed in 31 milliseconds

1234