Lines Matching refs:fd

35   int fd = open("/proc/version", O_RDONLY);  in TEST()  local
36 ASSERT_TRUE(fd != -1); in TEST()
38 int flags = fcntl(fd, F_GETFD); in TEST()
42 int rc = fcntl(fd, F_SETFD, FD_CLOEXEC); in TEST()
45 flags = fcntl(fd, F_GETFD); in TEST()
49 close(fd); in TEST()
53 int fd; in TEST() local
55 fd = open("/proc/version", O_RDONLY); in TEST()
56 ASSERT_TRUE(fd != -1); in TEST()
57 close(fd); in TEST()
59 fd = open64("/proc/version", O_RDONLY); in TEST()
60 ASSERT_TRUE(fd != -1); in TEST()
61 close(fd); in TEST()
65 int fd; in TEST() local
67 fd = openat(AT_FDCWD, "/proc/version", O_RDONLY); in TEST()
68 ASSERT_TRUE(fd != -1); in TEST()
69 close(fd); in TEST()
71 fd = openat64(AT_FDCWD, "/proc/version", O_RDONLY); in TEST()
72 ASSERT_TRUE(fd != -1); in TEST()
73 close(fd); in TEST()
93 EXPECT_EQ(EINVAL, posix_fadvise(tf.fd, 0, 0, -1)); in TEST()
96 EXPECT_EQ(EINVAL, posix_fadvise64(tf.fd, 0, 0, -1)); in TEST()
99 EXPECT_EQ(0, posix_fadvise(tf.fd, 0, 0, POSIX_FADV_NORMAL)); in TEST()
100 EXPECT_EQ(0, posix_fadvise64(tf.fd, 0, 0, POSIX_FADV_NORMAL)); in TEST()
110 ASSERT_EQ(-1, fallocate(tf.fd, 0, 0, -1)); in TEST()
114 ASSERT_EQ(-1, fallocate64(tf.fd, 0, 0, -1)); in TEST()
118 ASSERT_EQ(EINVAL, posix_fallocate(tf.fd, 0, -1)); in TEST()
122 ASSERT_EQ(EINVAL, posix_fallocate64(tf.fd, 0, -1)); in TEST()
129 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
133 ASSERT_EQ(0, fallocate(tf.fd, 0, 0, 1)); in TEST()
134 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
137 ASSERT_EQ(0, fallocate64(tf.fd, 0, 0, 2)); in TEST()
138 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
142 ASSERT_EQ(0, posix_fallocate(tf.fd, 0, 3)); in TEST()
143 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
146 ASSERT_EQ(0, posix_fallocate64(tf.fd, 0, 4)); in TEST()
147 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
152 int fd = open("/proc/version", O_RDONLY); in TEST() local
153 ASSERT_TRUE(fd != -1); in TEST()
161 ASSERT_EQ(0, fcntl(fd, F_GETLK, &check_lock)); in TEST()
162 close(fd); in TEST()
166 int fd = open64("/proc/version", O_RDONLY); in TEST() local
167 ASSERT_TRUE(fd != -1); in TEST()
175 ASSERT_EQ(0, fcntl(fd, F_GETLK64, &check_lock)); in TEST()
176 close(fd); in TEST()
191 …ssize_t bytes_written = splice(pipe_fds[0], nullptr, tf.fd, nullptr, bytes_read, SPLICE_F_MORE | S… in TEST()
277 ASSERT_EQ(0, sync_file_range(tf.fd, 0, 0, 0)); in TEST()
282 ASSERT_EQ(-1, sync_file_range(tf.fd, 0, 0, ~0)); in TEST()
307 ASSERT_EQ(0, fstatfs(tf.fd, &sfs)); in TEST()
309 ASSERT_EQ(-1, fallocate(tf.fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 1)); in TEST()
321 int fd = open(dir.path, O_TMPFILE | O_RDWR, perms); in TEST() local
324 if (fd == -1 && (errno == EISDIR || errno == EINVAL || errno == EOPNOTSUPP)) return; in TEST()
326 ASSERT_TRUE(fd != -1) << strerror(errno); in TEST()
330 ASSERT_EQ(0, fstat(fd, &sb)); in TEST()
337 ASSERT_EQ(0, linkat(AT_FDCWD, android::base::StringPrintf("/proc/self/fd/%d", fd).c_str(), in TEST()
340 ASSERT_EQ(0, close(fd)); in TEST()
347 fd = open(dir.path, O_TMPFILE | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); in TEST()
348 ASSERT_TRUE(fd != -1) << strerror(errno); in TEST()
350 ASSERT_EQ(-1, linkat(AT_FDCWD, android::base::StringPrintf("/proc/self/fd/%d", fd).c_str(), in TEST()
354 ASSERT_EQ(0, close(fd)); in TEST()