Lines Matching refs:fd
176 ASSERT_EQ(0, close(tf.fd)); in TEST()
186 ASSERT_EQ(0, close(tf.fd)); in TEST()
196 ASSERT_EQ(0, ftruncate(tf.fd, 123)); in TEST()
197 ASSERT_EQ(0, close(tf.fd)); in TEST()
206 ASSERT_EQ(0, ftruncate64(tf.fd, 123)); in TEST()
207 ASSERT_EQ(0, close(tf.fd)); in TEST()
217 ASSERT_EQ(-1, ftruncate(tf.fd, -123)); in TEST()
236 int fd = open("/proc/version", O_RDONLY); in TEST() local
237 ASSERT_TRUE(fd != -1); in TEST()
240 ASSERT_EQ(5, read(fd, buf, 5)); in TEST()
246 close(fd); in TEST()
387 int fd; in TestSyncFunction() local
396 ASSERT_NE(-1, tf.fd); in TestSyncFunction()
398 EXPECT_EQ(0, fn(tf.fd)); in TestSyncFunction()
400 ASSERT_NE(-1, fd = open(tf.path, O_RDONLY)); in TestSyncFunction()
401 EXPECT_EQ(0, fn(fd)); in TestSyncFunction()
402 close(fd); in TestSyncFunction()
404 ASSERT_NE(-1, fd = open(tf.path, O_RDWR)); in TestSyncFunction()
405 EXPECT_EQ(0, fn(fd)); in TestSyncFunction()
406 close(fd); in TestSyncFunction()
409 ASSERT_NE(-1, fd = open("/data/local/tmp", O_RDONLY)); in TestSyncFunction()
410 EXPECT_EQ(0, fn(fd)); in TestSyncFunction()
411 close(fd); in TestSyncFunction()
419 int fd = open("/proc/version", O_RDONLY); in TestFsyncFunction() local
420 ASSERT_NE(-1, fd); in TestFsyncFunction()
421 EXPECT_EQ(-1, fn(fd)); in TestFsyncFunction()
423 close(fd); in TestFsyncFunction()
767 rc = fpathconf(tf.fd, _PC_ALLOC_SIZE_MIN); in TEST()
769 rc = fpathconf(tf.fd, _PC_REC_MIN_XFER_SIZE); in TEST()
771 rc = fpathconf(tf.fd, _PC_REC_XFER_ALIGN); in TEST()
1159 int fd = open("/proc/version", O_RDONLY); in TEST() local
1160 ASSERT_TRUE(fd != -1); in TEST()
1161 ASSERT_EQ(fd, dup2(fd, fd)); in TEST()
1162 ASSERT_EQ(0, close(fd)); // Check that dup2 didn't close fd. in TEST()
1166 ASSERT_EQ(-1, dup2(fd, fd)); in TEST()
1171 int fd = open("/proc/version", O_RDONLY); in TEST() local
1172 ASSERT_EQ(666, dup3(fd, 666, 0)); in TEST()
1175 ASSERT_EQ(667, dup3(fd, 667, O_CLOEXEC)); in TEST()
1178 close(fd); in TEST()
1185 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1188 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1189 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1192 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1193 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1196 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1197 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1200 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1201 ASSERT_EQ(0, lockf64(tf.fd, F_ULOCK, file_size)); in TEST()
1208 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1211 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1212 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, 0)); in TEST()
1215 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1216 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1219 ASSERT_EQ(0, ftruncate(tf.fd, 2*file_size)); in TEST()
1222 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1223 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, 2*file_size)); in TEST()
1230 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1233 ASSERT_EQ(file_size, lseek64(tf.fd, file_size, SEEK_SET)); in TEST()
1234 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, -file_size)); in TEST()
1237 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1238 ASSERT_EQ(0, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1245 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1248 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1249 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size)); in TEST()
1256 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1257 ASSERT_EQ(-1, lockf64(tf.fd, F_TLOCK, file_size)); in TEST()
1260 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1261 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size)); in TEST()
1272 ASSERT_EQ(0, ftruncate(tf.fd, file_size)); in TEST()
1275 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1276 ASSERT_EQ(0, lockf64(tf.fd, F_LOCK, file_size/2)); in TEST()
1283 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1284 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
1286 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1287 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
1290 ASSERT_EQ(0, lseek64(tf.fd, 0, SEEK_SET)); in TEST()
1291 ASSERT_EQ(-1, lockf64(tf.fd, F_TEST, file_size/2)); in TEST()
1299 ASSERT_EQ(file_size/2, lseek64(tf.fd, file_size/2, SEEK_SET)); in TEST()
1300 ASSERT_EQ(0, lockf64(tf.fd, F_TLOCK, file_size/2)); in TEST()
1481 ASSERT_EQ(0, close(tf.fd)); in TEST()
1513 int fd = open("/", O_RDONLY); in TEST() local
1514 ASSERT_NE(-1, fd); in TEST()
1515 ASSERT_EQ(-1, fexecve(fd, eth.GetArgs(), eth.GetEnv())); in TEST()
1517 close(fd); in TEST()