Lines Matching refs:fd
156 ASSERT_EQ(0, close(tf.fd)); in TEST()
166 ASSERT_EQ(0, close(tf.fd)); in TEST()
176 ASSERT_EQ(0, ftruncate(tf.fd, 123)); in TEST()
177 ASSERT_EQ(0, close(tf.fd)); in TEST()
186 ASSERT_EQ(0, ftruncate64(tf.fd, 123)); in TEST()
187 ASSERT_EQ(0, close(tf.fd)); in TEST()
197 ASSERT_EQ(-1, ftruncate(tf.fd, -123)); in TEST()
216 int fd = open("/proc/version", O_RDONLY); in TEST() local
217 ASSERT_TRUE(fd != -1); in TEST()
220 ASSERT_EQ(5, read(fd, buf, 5)); in TEST()
226 close(fd); in TEST()
367 int fd; in TestFsyncFunction() local
376 ASSERT_NE(-1, tf.fd); in TestFsyncFunction()
378 EXPECT_EQ(0, fn(tf.fd)); in TestFsyncFunction()
380 ASSERT_NE(-1, fd = open(tf.filename, O_RDONLY)); in TestFsyncFunction()
381 EXPECT_EQ(0, fn(fd)); in TestFsyncFunction()
382 close(fd); in TestFsyncFunction()
384 ASSERT_NE(-1, fd = open(tf.filename, O_RDWR)); in TestFsyncFunction()
385 EXPECT_EQ(0, fn(fd)); in TestFsyncFunction()
386 close(fd); in TestFsyncFunction()
389 ASSERT_NE(-1, fd = open("/data/local/tmp", O_RDONLY)); in TestFsyncFunction()
390 EXPECT_EQ(0, fn(fd)); in TestFsyncFunction()
391 close(fd); in TestFsyncFunction()
395 ASSERT_NE(-1, fd = open("/proc/version", O_RDONLY)); in TestFsyncFunction()
396 EXPECT_EQ(-1, fn(fd)); in TestFsyncFunction()
398 close(fd); in TestFsyncFunction()
532 rc = fpathconf(tf.fd, _PC_ALLOC_SIZE_MIN); in TEST()
534 rc = fpathconf(tf.fd, _PC_REC_MIN_XFER_SIZE); in TEST()
536 rc = fpathconf(tf.fd, _PC_REC_XFER_ALIGN); in TEST()
857 int fd = open("/proc/version", O_RDONLY); in TEST() local
858 ASSERT_TRUE(fd != -1); in TEST()
859 ASSERT_EQ(fd, dup2(fd, fd)); in TEST()
860 ASSERT_EQ(0, close(fd)); // Check that dup2 didn't close fd. in TEST()
864 ASSERT_EQ(-1, dup2(fd, fd)); in TEST()
872 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
875 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
876 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
879 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
880 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
883 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
884 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
887 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
888 ASSERT_EQ(0, lockf64(tf.fd, F_ULOCK, file_size)); in TEST()
895 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
898 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
899 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, 0)); in TEST()
902 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
903 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
906 ASSERT_EQ(0, ftruncate(tf.fd, 2*file_size)); in TEST()
909 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
910 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, 2*file_size)); in TEST()
917 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
920 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
921 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, -file_size)); in TEST()
924 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
925 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
932 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
935 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
936 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
943 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
944 ASSERT_EQ(-1, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
947 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
948 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size)); in TEST()
959 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
962 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
963 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size/2)); in TEST()
970 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
971 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
973 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
974 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
977 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
978 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
986 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
987 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()