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

12345

/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.h47 #define __FDELT(fd) ((fd) / NFDBITS)
48 #define __FDMASK(fd) (1UL << ((fd) % NFDBITS))
65 #define FD_CLR(fd, set) __FD_CLR_chk(fd, set, __bos(set))
66 #define FD_SET(fd, set) __FD_SET_chk(fd, set, __bos(set))
67 #define FD_ISSET(fd, set) __FD_ISSET_chk(fd, se
[all...]
/bionic/libc/bionic/
H A D__FD_chk.cpp33 extern "C" int __FD_ISSET_chk(int fd, fd_set* set, size_t set_size) { argument
34 if (__predict_false(fd < 0)) {
37 if (__predict_false(fd >= FD_SETSIZE)) {
43 return FD_ISSET(fd, set);
46 extern "C" void __FD_CLR_chk(int fd, fd_set* set, size_t set_size) { argument
47 if (__predict_false(fd < 0)) {
50 if (__predict_false(fd >= FD_SETSIZE)) {
56 FD_CLR(fd, set);
59 extern "C" void __FD_SET_chk(int fd, fd_set* set, size_t set_size) { argument
60 if (__predict_false(fd <
[all...]
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 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);
H A D__pread64_chk.cpp33 extern "C" ssize_t __pread64_chk(int fd, void* buf, size_t count, off64_t offset, size_t buf_size) { argument
42 return pread64(fd, buf, count, offset);
H A D__pread_chk.cpp33 extern "C" ssize_t __pread_chk(int fd, void* buf, size_t count, off_t offset, size_t buf_size) { argument
42 return pread(fd, buf, count, offset);
/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.cpp25 int fd = open("/proc/version", O_RDONLY); local
26 ASSERT_TRUE(fd != -1);
28 int flags = fcntl(fd, F_GETFD);
32 int rc = fcntl(fd, F_SETFD, FD_CLOEXEC);
35 flags = fcntl(fd, F_GETFD);
39 close(fd);
43 int fd; local
45 fd = open("/proc/version", O_RDONLY);
46 ASSERT_TRUE(fd != -1);
47 close(fd);
55 int fd; local
142 int fd = open64("/proc/version", O_RDONLY); 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...]
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_uio_test.cpp30 ASSERT_EQ(10, writev(tf.fd, ios, 2));
32 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET));
37 ASSERT_EQ(10, readv(tf.fd, ios, 2));
50 ASSERT_EQ(5, write_fn(tf.fd, ios, 1, 5));
51 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_CUR));
54 ASSERT_EQ(5, write_fn(tf.fd, ios, 1, 0));
55 ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_CUR));
57 ASSERT_EQ(5, read_fn(tf.fd, ios, 1, 5));
59 ASSERT_EQ(5, read_fn(tf.fd, ios, 1, 0));
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...]
/bionic/libc/include/android/
H A Dlegacy_termios_inlines.h39 static __inline int tcgetattr(int fd, struct termios *s) { argument
40 return ioctl(fd, TCGETS, s);
43 static __inline int tcsetattr(int fd, int __opt, const struct termios *s) { argument
44 return ioctl(fd, __opt, (void *)s);
47 static __inline int tcflow(int fd, int action) { argument
48 return ioctl(fd, TCXONC, (void *)(intptr_t)action);
51 static __inline int tcflush(int fd, int __queue) { argument
52 return ioctl(fd, TCFLSH, (void *)(intptr_t)__queue);
55 static __inline pid_t tcgetsid(int fd) { argument
57 return ioctl(fd, TIOCGSI
60 tcsendbreak(int fd, int __duration) argument
[all...]

Completed in 264 milliseconds

12345