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

123456

/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/include/sys/
H A Dselect.h48 #define __FDELT(fd) ((fd) / NFDBITS)
49 #define __FDMASK(fd) (1UL << ((fd) % NFDBITS))
66 #define FD_CLR(fd, set) __FD_CLR_chk(fd, set, __bos(set))
67 #define FD_SET(fd, set) __FD_SET_chk(fd, set, __bos(set))
68 #define FD_ISSET(fd, set) __FD_ISSET_chk(fd, se
[all...]
/bionic/tools/versioner/current/sys/
H A Dselect.h48 #define __FDELT(fd) ((fd) / NFDBITS)
49 #define __FDMASK(fd) (1UL << ((fd) % NFDBITS))
66 #define FD_CLR(fd, set) __FD_CLR_chk(fd, set, __bos(set))
67 #define FD_SET(fd, set) __FD_SET_chk(fd, set, __bos(set))
68 #define FD_ISSET(fd, set) __FD_ISSET_chk(fd, se
[all...]
/bionic/libc/kernel/uapi/linux/
H A Dkcm.h22 int fd; member in struct:kcm_attach
27 int fd; member in struct:kcm_unattach
31 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
27 int fd; member in struct:kcm_unattach
31 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 Dtermios.cpp67 int tcdrain(int fd) { argument
70 return ioctl(fd, TCSBRK, static_cast<unsigned long>(1));
73 int tcflow(int fd, int action) { argument
74 return ioctl(fd, TCXONC, static_cast<unsigned long>(action));
77 int tcflush(int fd, int queue) { argument
78 return ioctl(fd, TCFLSH, static_cast<unsigned long>(queue));
81 int tcgetattr(int fd, termios* s) { argument
82 return ioctl(fd, TCGETS, s);
85 pid_t tcgetsid(int fd) { argument
87 if (ioctl(fd, TIOCGSI
93 tcsendbreak(int fd, int duration) argument
97 tcsetattr(int fd, int optional_actions, const termios* s) argument
108 tcgetpgrp(int fd) argument
116 tcsetpgrp(int fd, pid_t pid) argument
[all...]
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 Depoll_wait.cpp31 int epoll_wait(int fd, struct epoll_event* events, int max_events, int timeout) { argument
32 return epoll_pwait(fd, events, max_events, timeout, NULL);
H A Dsignalfd.cpp33 extern "C" int __signalfd4(int fd, kernel_sigset_t* mask, size_t sizemask, int flags);
35 int signalfd(int fd, const sigset_t* mask, int flags) { argument
37 return __signalfd4(fd, &in_set, sizeof(in_set), flags);
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 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.cpp38 int fchmod(int fd, mode_t mode) { argument
40 int result = ___fchmod(fd, mode);
46 // fd could be an O_PATH file descriptor, and the kernel
48 // Use /proc/self/fd instead to emulate this support.
54 int fd_flag = fcntl(fd, F_GETFL);
61 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
H A Dfchmodat.cpp50 int fd = openat(dirfd, pathname, O_PATH | O_NOFOLLOW | O_CLOEXEC); local
51 if (fd == -1) {
60 int result = fchmod(fd, mode);
62 close(fd);
H A Dflistxattr.cpp38 ssize_t flistxattr(int fd, char *list, size_t size) { argument
40 ssize_t result = ___flistxattr(fd, list, size);
46 // fd could be an O_PATH file descriptor, and the kernel
48 // Use /proc/self/fd instead to emulate this support.
49 int fd_flag = fcntl(fd, F_GETFL);
56 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd);
/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 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...]
H A DTemporaryFile.h31 if (fd == -1) {
41 close(fd);
46 close(fd);
47 fd = open(filename, O_RDWR);
50 int fd; member in class:GenericTemporaryFile
58 fd = mk_fn(filename);
H A Dsys_xattr_test.cpp38 ASSERT_EQ(0, fsetxattr(tf.fd, "user.foo", "bar", 4, 0));
39 ASSERT_EQ(4, fgetxattr(tf.fd, "user.foo", buf, sizeof(buf)));
46 ASSERT_EQ(0, fsetxattr(tf.fd, "user.foo", "", 0, 0));
47 ASSERT_EQ(0, fgetxattr(tf.fd, "user.foo", buf, sizeof(buf)));
53 ASSERT_EQ(0, fsetxattr(tf.fd, "user.foo", "01234567890123456789", 21, 0));
54 ASSERT_EQ(-1, fgetxattr(tf.fd, "user.foo", buf, sizeof(buf)));
70 int fd = open(tf.filename, O_PATH); local
71 ASSERT_NE(-1, fd);
73 int res = fsetxattr(fd, "user.foo", "bar", 4, 0);
77 ASSERT_EQ(4, fgetxattr(fd, "use
88 int fd = open(tf.filename, O_PATH); local
117 int fd = open(tf.filename, O_PATH); local
[all...]
H A Dfcntl_test.cpp34 int fd = open("/proc/version", O_RDONLY); local
35 ASSERT_TRUE(fd != -1);
37 int flags = fcntl(fd, F_GETFD);
41 int rc = fcntl(fd, F_SETFD, FD_CLOEXEC);
44 flags = fcntl(fd, F_GETFD);
48 close(fd);
52 int fd; local
54 fd = open("/proc/version", O_RDONLY);
55 ASSERT_TRUE(fd != -1);
56 close(fd);
64 int fd; local
151 int fd = open64("/proc/version", O_RDONLY); local
[all...]

Completed in 552 milliseconds

123456