Lines Matching refs:fd
178 ASSERT_EQ(0, close(tf.fd)); in TEST()
188 ASSERT_EQ(0, close(tf.fd)); in TEST()
198 ASSERT_EQ(0, ftruncate(tf.fd, 123)); in TEST()
199 ASSERT_EQ(0, close(tf.fd)); in TEST()
208 ASSERT_EQ(0, ftruncate64(tf.fd, 123)); in TEST()
209 ASSERT_EQ(0, close(tf.fd)); in TEST()
219 ASSERT_EQ(-1, ftruncate(tf.fd, -123)); in TEST()
238 int fd = open("/proc/version", O_RDONLY); in TEST() local
239 ASSERT_TRUE(fd != -1); in TEST()
242 ASSERT_EQ(5, read(fd, buf, 5)); in TEST()
248 close(fd); in TEST()
392 int fd; in TestSyncFunction() local
401 ASSERT_NE(-1, tf.fd); in TestSyncFunction()
403 EXPECT_EQ(0, fn(tf.fd)); in TestSyncFunction()
405 ASSERT_NE(-1, fd = open(tf.path, O_RDONLY)); in TestSyncFunction()
406 EXPECT_EQ(0, fn(fd)); in TestSyncFunction()
407 close(fd); in TestSyncFunction()
409 ASSERT_NE(-1, fd = open(tf.path, O_RDWR)); in TestSyncFunction()
410 EXPECT_EQ(0, fn(fd)); in TestSyncFunction()
411 close(fd); in TestSyncFunction()
414 ASSERT_NE(-1, fd = open("/data/local/tmp", O_RDONLY)); in TestSyncFunction()
415 EXPECT_EQ(0, fn(fd)); in TestSyncFunction()
416 close(fd); in TestSyncFunction()
424 int fd = open("/proc/version", O_RDONLY); in TestFsyncFunction() local
425 ASSERT_NE(-1, fd); in TestFsyncFunction()
426 EXPECT_EQ(-1, fn(fd)); in TestFsyncFunction()
428 close(fd); in TestFsyncFunction()
783 l = fpathconf(tf.fd, _PC_ALLOC_SIZE_MIN); in TEST()
785 l = fpathconf(tf.fd, _PC_REC_MIN_XFER_SIZE); in TEST()
787 l = fpathconf(tf.fd, _PC_REC_XFER_ALIGN); in TEST()
799 ASSERT_EQ(-1, fpathconf(tf.fd, names[i])) << names[i]; in TEST()
1235 int fd = open("/proc/version", O_RDONLY); in TEST() local
1236 ASSERT_TRUE(fd != -1); in TEST()
1237 ASSERT_EQ(fd, dup2(fd, fd)); in TEST()
1238 ASSERT_EQ(0, close(fd)); // Check that dup2 didn't close fd. in TEST()
1242 ASSERT_EQ(-1, dup2(fd, fd)); in TEST()
1247 int fd = open("/proc/version", O_RDONLY); in TEST() local
1248 ASSERT_EQ(666, dup3(fd, 666, 0)); in TEST()
1251 ASSERT_EQ(667, dup3(fd, 667, O_CLOEXEC)); in TEST()
1254 close(fd); in TEST()
1261 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1264 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1265 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1268 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1269 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1272 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1273 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1276 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1277 ASSERT_EQ(0, lockf64(tf.fd, F_ULOCK, file_size)); in TEST()
1284 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1287 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1288 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, 0)); in TEST()
1291 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1292 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1295 ASSERT_EQ(0, ftruncate(tf.fd, 2*file_size)); in TEST()
1298 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1299 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, 2*file_size)); in TEST()
1306 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1309 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1310 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, -file_size)); in TEST()
1313 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1314 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1321 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1324 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1325 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1332 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1333 ASSERT_EQ(-1, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1336 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1337 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1348 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1351 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1352 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size/2)); in TEST()
1359 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1360 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
1362 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1363 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
1366 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1367 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
1375 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1376 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
1576 ASSERT_EQ(0, close(tf.fd)); in TEST()
1618 int fd = open("/", O_RDONLY); in TEST() local
1619 ASSERT_NE(-1, fd); in TEST()
1620 ASSERT_EQ(-1, fexecve(fd, eth.GetArgs(), eth.GetEnv())); in TEST()
1622 close(fd); in TEST()
1724 int fd = open("/proc/version", O_RDONLY); in TEST()
1725 ASSERT_GE(fd, 0); in TEST()
1727 int rc = close_range(fd, fd, 0); in TEST()
1732 ASSERT_EQ(close(fd), -1); in TEST()
1742 ASSERT_TRUE(android::base::WriteStringToFd("hello world", tf.fd)); in TEST()
1743 ASSERT_EQ(0, lseek(tf.fd, SEEK_SET, 0)); in TEST()
1745 ASSERT_EQ(11, copy_file_range(tf.fd, NULL, tf2.fd, NULL, 11, 0)); in TEST()
1746 ASSERT_EQ(0, lseek(tf2.fd, SEEK_SET, 0)); in TEST()
1748 ASSERT_TRUE(android::base::ReadFdToString(tf2.fd, &content)); in TEST()