Lines Matching refs:fd
40 int fd = open("/proc/version", O_RDONLY); in TEST() local
41 ASSERT_TRUE(fd != -1); in TEST()
43 int flags = fcntl(fd, F_GETFD); in TEST()
47 int rc = fcntl(fd, F_SETFD, FD_CLOEXEC); in TEST()
50 flags = fcntl(fd, F_GETFD); in TEST()
54 close(fd); in TEST()
58 int fd; in TEST() local
60 fd = open("/proc/version", O_RDONLY); in TEST()
61 ASSERT_TRUE(fd != -1); in TEST()
62 close(fd); in TEST()
64 fd = open64("/proc/version", O_RDONLY); in TEST()
65 ASSERT_TRUE(fd != -1); in TEST()
66 close(fd); in TEST()
70 int fd; in TEST() local
72 fd = openat(AT_FDCWD, "/proc/version", O_RDONLY); in TEST()
73 ASSERT_TRUE(fd != -1); in TEST()
74 close(fd); in TEST()
76 fd = openat64(AT_FDCWD, "/proc/version", O_RDONLY); in TEST()
77 ASSERT_TRUE(fd != -1); in TEST()
78 close(fd); in TEST()
98 EXPECT_EQ(EINVAL, posix_fadvise(tf.fd, 0, 0, -1)); in TEST()
101 EXPECT_EQ(EINVAL, posix_fadvise64(tf.fd, 0, 0, -1)); in TEST()
104 EXPECT_EQ(0, posix_fadvise(tf.fd, 0, 0, POSIX_FADV_NORMAL)); in TEST()
105 EXPECT_EQ(0, posix_fadvise64(tf.fd, 0, 0, POSIX_FADV_NORMAL)); in TEST()
115 ASSERT_EQ(-1, fallocate(tf.fd, 0, 0, -1)); in TEST()
119 ASSERT_EQ(-1, fallocate64(tf.fd, 0, 0, -1)); in TEST()
123 ASSERT_EQ(EINVAL, posix_fallocate(tf.fd, 0, -1)); in TEST()
127 ASSERT_EQ(EINVAL, posix_fallocate64(tf.fd, 0, -1)); in TEST()
134 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
138 ASSERT_EQ(0, fallocate(tf.fd, 0, 0, 1)); in TEST()
139 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
142 ASSERT_EQ(0, fallocate64(tf.fd, 0, 0, 2)); in TEST()
143 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
147 ASSERT_EQ(0, posix_fallocate(tf.fd, 0, 3)); in TEST()
148 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
151 ASSERT_EQ(0, posix_fallocate64(tf.fd, 0, 4)); in TEST()
152 ASSERT_EQ(0, fstat(tf.fd, &sb)); in TEST()
157 int fd = open("/proc/version", O_RDONLY); in TEST() local
158 ASSERT_TRUE(fd != -1); in TEST()
166 ASSERT_EQ(0, fcntl(fd, F_GETLK, &check_lock)); in TEST()
167 close(fd); in TEST()
171 int fd = open64("/proc/version", O_RDONLY); in TEST() local
172 ASSERT_TRUE(fd != -1); in TEST()
180 ASSERT_EQ(0, fcntl(fd, F_GETLK64, &check_lock)); in TEST()
181 close(fd); in TEST()
196 …ssize_t bytes_written = splice(pipe_fds[0], nullptr, tf.fd, nullptr, bytes_read, SPLICE_F_MORE | S… in TEST()
282 ASSERT_EQ(0, sync_file_range(tf.fd, 0, 0, 0)); in TEST()
287 ASSERT_EQ(-1, sync_file_range(tf.fd, 0, 0, ~0)); in TEST()
312 ASSERT_EQ(0, fstatfs(tf.fd, &sfs)); in TEST()
314 ASSERT_EQ(-1, fallocate(tf.fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 1)); in TEST()
326 int fd = open(dir.path, O_TMPFILE | O_RDWR, perms); in TEST() local
329 if (fd == -1 && (errno == EISDIR || errno == EINVAL || errno == EOPNOTSUPP)) return; in TEST()
331 ASSERT_TRUE(fd != -1) << strerror(errno); in TEST()
335 ASSERT_EQ(0, fstat(fd, &sb)); in TEST()
342 ASSERT_EQ(0, linkat(AT_FDCWD, android::base::StringPrintf("/proc/self/fd/%d", fd).c_str(), in TEST()
345 ASSERT_EQ(0, close(fd)); in TEST()
352 fd = open(dir.path, O_TMPFILE | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR); in TEST()
353 ASSERT_TRUE(fd != -1) << strerror(errno); in TEST()
355 ASSERT_EQ(-1, linkat(AT_FDCWD, android::base::StringPrintf("/proc/self/fd/%d", fd).c_str(), in TEST()
359 ASSERT_EQ(0, close(fd)); in TEST()