Searched refs:fd (Results 1 - 25 of 171) sorted by relevance

1234567

/bionic/libc/upstream-openbsd/lib/libc/gen/
H A Ddaemon.c39 int fd; local
56 if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
57 (void)dup2(fd, STDIN_FILENO);
58 (void)dup2(fd, STDOUT_FILENO);
59 (void)dup2(fd, STDERR_FILENO);
60 if (fd > 2)
61 (void)close(fd);
/bionic/libc/kernel/uapi/linux/
H A Dkcm.h22 int fd; member in struct:kcm_attach
26 int fd; member in struct:kcm_unattach
29 int fd; member in struct:kcm_clone
/bionic/libc/versioner-dependencies/common/kernel_uapi/linux/
H A Dkcm.h22 int fd; member in struct:kcm_attach
26 int fd; member in struct:kcm_unattach
29 int fd; member in struct:kcm_clone
/bionic/tools/versioner/dependencies/common/kernel_uapi/linux/
H A Dkcm.h22 int fd; member in struct:kcm_attach
26 int fd; member in struct:kcm_unattach
29 int fd; member in struct:kcm_clone
/bionic/libc/bionic/
H A Dclose.cpp34 int close(int fd) { argument
35 int rc = ___close(fd);
37 // POSIX says that if close returns with EINTR, the fd must not be closed.
H A Deventfd_read.cpp32 int eventfd_read(int fd, eventfd_t* value) { argument
33 return (read(fd, value, sizeof(*value)) == sizeof(*value)) ? 0 : -1;
H A Deventfd_write.cpp32 int eventfd_write(int fd, eventfd_t value) { argument
33 return (write(fd, &value, sizeof(value)) == sizeof(value)) ? 0 : -1;
H A Dfutimens.cpp32 int futimens(int fd, const struct timespec times[2]) { argument
33 return utimensat(fd, NULL, times, 0);
H A Disatty.c34 isatty (int fd) argument
38 return tcgetattr (fd, &term) == 0;
H A Dposix_fallocate.cpp33 int posix_fallocate(int fd, off_t offset, off_t length) { argument
35 return (fallocate(fd, 0, offset, length) == 0) ? 0 : errno;
38 int posix_fallocate64(int fd, off64_t offset, off64_t length) { argument
40 return (fallocate64(fd, 0, offset, length) == 0) ? 0 : errno;
H A Dsys_signalfd.cpp35 int signalfd(int fd, const sigset_t* mask, int flags) { argument
38 return signalfd64(fd, &set.sigset64, flags);
41 int signalfd64(int fd, const sigset64_t* mask, int flags) { argument
42 return __signalfd4(fd, mask, sizeof(*mask), flags);
H A Dtermios.cpp38 pid_t tcgetpgrp(int fd) { argument
40 return (ioctl(fd, TIOCGPGRP, &pid) == -1) ? -1 : pid;
44 int tcsetpgrp(int fd, pid_t pid) { argument
45 return ioctl(fd, TIOCSPGRP, &pid);
H A Dposix_fadvise.cpp37 int posix_fadvise(int fd, off_t offset, off_t length, int advice) { argument
38 return posix_fadvise64(fd, offset, length, advice);
42 int posix_fadvise64(int fd, off64_t offset, off64_t length, int advice) { argument
44 return (__arm_fadvise64_64(fd, advice, offset, length) == 0) ? 0 : errno;
47 int posix_fadvise64(int fd, off64_t offset, off64_t length, int advice) { argument
49 return (__fadvise64(fd, offset, length, advice) == 0) ? 0 : errno;
H A Dsync_file_range.cpp34 int sync_file_range(int fd, off64_t offset, off64_t length, unsigned int flags) { argument
36 return __sync_file_range2(fd, flags, offset, length);
38 return __sync_file_range(fd, offset, length, flags);
H A Dtmpfile.cpp50 int fd; local
53 fd = mkstemp(path);
54 if (fd == -1) {
66 int rc = fstat(fd, &sb);
69 close(fd);
75 FILE* fp = fdopen(fd, "w+");
82 close(fd);
H A Dsys_epoll.cpp44 int epoll_pwait(int fd, epoll_event* events, int max_events, int timeout, const sigset_t* ss) { argument
52 return epoll_pwait64(fd, events, max_events, timeout, ss_ptr);
55 int epoll_pwait64(int fd, epoll_event* events, int max_events, int timeout, const sigset64_t* ss) { argument
56 return __epoll_pwait(fd, events, max_events, timeout, ss, sizeof(*ss));
59 int epoll_wait(int fd, struct epoll_event* events, int max_events, int timeout) { argument
60 return epoll_pwait64(fd, events, max_events, timeout, nullptr);
H A Dsys_time.cpp37 static int futimesat(int fd, const char* path, const timeval tv[2], int flags) { argument
43 return utimensat(fd, path, tv ? ts : nullptr, flags);
54 int futimesat(int fd, const char* path, const timeval tv[2]) { argument
55 return futimesat(fd, path, tv, 0);
58 int futimes(int fd, const timeval tv[2]) { argument
64 return futimens(fd, tv ? ts : nullptr);
H A Dfchmod.cpp40 int fchmod(int fd, mode_t mode) { argument
42 int result = ___fchmod(fd, mode);
47 // fd could be an O_PATH file descriptor, and the kernel
49 // Use /proc/self/fd instead to emulate this support.
55 int fd_flag = fcntl(fd, F_GETFL);
62 result = chmod(FdPath(fd).c_str(), mode);
/bionic/libc/include/sys/
H A Dselect.h49 #define __FDELT(fd) ((fd) / NFDBITS)
50 #define __FDMASK(fd) (1UL << ((fd) % NFDBITS))
66 #define __FD_CLR(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] &= ~__FDMASK(fd))
67 #define __FD_SET(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] |= __FDMASK(fd))
[all...]
/bionic/tests/
H A Deventfd_test.cpp39 int fd = eventfd(initial_value, O_NONBLOCK); local
40 ASSERT_NE(fd, -1);
43 ASSERT_EQ(0, eventfd_read(fd, &value));
47 ASSERT_EQ(-1, eventfd_read(fd, &value));
51 ASSERT_EQ(0, eventfd_write(fd, 1));
52 ASSERT_EQ(0, eventfd_write(fd, 1));
53 ASSERT_EQ(0, eventfd_write(fd, 1));
55 ASSERT_EQ(0, eventfd_read(fd, &value));
58 close(fd);
H A Dfcntl_test.cpp36 int fd = open("/proc/version", O_RDONLY); local
37 ASSERT_TRUE(fd != -1);
39 int flags = fcntl(fd, F_GETFD);
43 int rc = fcntl(fd, F_SETFD, FD_CLOEXEC);
46 flags = fcntl(fd, F_GETFD);
50 close(fd);
54 int fd; local
56 fd = open("/proc/version", O_RDONLY);
57 ASSERT_TRUE(fd != -1);
58 close(fd);
66 int fd; local
153 int fd = open64("/proc/version", O_RDONLY); local
310 int fd = open(dir.dirname, O_TMPFILE | O_RDWR, perms); local
[all...]
H A Dsys_sendfile_test.cpp28 ASSERT_EQ(5, TEMP_FAILURE_RETRY(write(src_file.fd, "hello", 5)));
34 ssize_t rc = sendfile(dst_file.fd, src_file.fd, &offset, count);
38 ASSERT_EQ(0, lseek(dst_file.fd, 0, SEEK_SET));
41 ASSERT_EQ(2, TEMP_FAILURE_RETRY(read(dst_file.fd, &buf, 2)));
47 ASSERT_EQ(5, TEMP_FAILURE_RETRY(write(src_file.fd, "hello", 5)));
53 ssize_t rc = sendfile64(dst_file.fd, src_file.fd, &offset, count);
57 ASSERT_EQ(0, lseek(dst_file.fd, 0, SEEK_SET));
60 ASSERT_EQ(2, TEMP_FAILURE_RETRY(read(dst_file.fd,
[all...]
/bionic/tools/versioner/current/sys/
H A Dselect.h49 #define __FDELT(fd) ((fd) / NFDBITS)
50 #define __FDMASK(fd) (1UL << ((fd) % NFDBITS))
66 #define __FD_CLR(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] &= ~__FDMASK(fd))
67 #define __FD_SET(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] |= __FDMASK(fd))
[all...]
/bionic/libc/private/
H A DFdPath.h21 explicit FdPath(int fd) { argument
22 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
/bionic/libc/tzcode/
H A Dbionic.cpp111 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY | O_CLOEXEC)); local
112 if (fd == -1) {
117 ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fd, &header, sizeof(header)));
121 close(fd);
127 close(fd);
131 if (TEMP_FAILURE_RETRY(lseek(fd, ntohl(header.index_offset), SEEK_SET)) == -1) {
133 close(fd);
140 close(fd);
146 close(fd);
154 close(fd);
200 int fd; local
[all...]

Completed in 188 milliseconds

1234567