Lines Matching full:fd
244 int fd; in TEST_F() local
252 fd = open(FULLPATH, O_WRONLY); in TEST_F()
253 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
256 iocb.aio_fildes = fd; in TEST_F()
262 leak(fd); in TEST_F()
287 int fd; in TEST_F() local
294 fd = open(FULLPATH, O_RDWR | O_APPEND); in TEST_F()
295 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
297 ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno); in TEST_F()
298 leak(fd); in TEST_F()
314 int fd; in TEST_F() local
325 fd = open(FULLPATH, O_RDWR | O_APPEND); in TEST_F()
326 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
329 ASSERT_EQ((ssize_t)oldsize, read(fd, oldbuf, oldsize)) in TEST_F()
333 ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno); in TEST_F()
334 leak(fd); in TEST_F()
347 int fd; in TEST_F() local
353 fd = open(FULLPATH, O_WRONLY | O_APPEND); in TEST_F()
354 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
356 ASSERT_EQ(BUFSIZE, write(fd, CONTENTS, BUFSIZE)) << strerror(errno); in TEST_F()
357 leak(fd); in TEST_F()
368 int fd; in TEST_F() local
377 fd = open(FULLPATH, O_RDWR); in TEST_F()
378 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
381 ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); in TEST_F()
384 ASSERT_EQ(0, fcntl(fd, F_SETFL, O_DIRECT)) << strerror(errno); in TEST_F()
385 ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); in TEST_F()
386 ASSERT_EQ(bufsize, write(fd, CONTENTS1, bufsize)) << strerror(errno); in TEST_F()
390 ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno); in TEST_F()
391 ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); in TEST_F()
392 ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); in TEST_F()
395 leak(fd); in TEST_F()
410 int fd; in TEST_F() local
421 fd = open(FULLPATH, O_WRONLY); in TEST_F()
422 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
424 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
425 leak(fd); in TEST_F()
435 int fd; in TEST_F() local
446 fd = open(FULLPATH, O_WRONLY); in TEST_F()
447 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
449 ASSERT_EQ(-1, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
456 fstat(fd, &sb); in TEST_F()
459 leak(fd); in TEST_F()
473 int fd; in TEST_F() local
481 fd = open(FULLPATH, O_WRONLY); in TEST_F()
482 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
484 ASSERT_EQ(-1, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
486 leak(fd); in TEST_F()
499 int fd; in TEST_F() local
507 fd = open(FULLPATH, O_WRONLY); in TEST_F()
508 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
510 ASSERT_EQ(halfbufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
511 leak(fd); in TEST_F()
527 int fd; in TEST_F() local
537 fd = open(FULLPATH, O_WRONLY); in TEST_F()
538 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
544 ASSERT_EQ(size0, writev(fd, iov, 2)) << strerror(errno); in TEST_F()
545 leak(fd); in TEST_F()
558 int fd, oflag; in TEST_P() local
570 fd = open(FULLPATH, O_WRONLY | oflag); in TEST_P()
572 ASSERT_LE(0, fd) << strerror(errno); in TEST_P()
574 ASSERT_EQ(-1, pwrite(fd, CONTENTS, bufsize, offset)); in TEST_P()
577 leak(fd); in TEST_P()
595 int fd, oflag; in TEST_P() local
608 fd = open(FULLPATH, O_WRONLY | oflag); in TEST_P()
610 ASSERT_LE(0, fd) << strerror(errno); in TEST_P()
612 ASSERT_EQ(bufsize / 2, pwrite(fd, CONTENTS, bufsize, offset)) in TEST_P()
614 leak(fd); in TEST_P()
636 int fd; in TEST_F() local
643 fd = open(FULLPATH, O_RDWR); in TEST_F()
644 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
646 ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset)) in TEST_F()
648 leak(fd); in TEST_F()
667 int fd; in TEST_P() local
718 fd = open(FULLPATH, O_RDWR); in TEST_P()
719 ASSERT_LE(0, fd) << strerror(errno); in TEST_P()
720 ASSERT_EQ(filesize / 2, write(fd, contents, filesize / 2)) in TEST_P()
740 int fd; in TEST_F() local
764 fd = open(FULLPATH, O_RDWR); in TEST_F()
765 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
767 p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in TEST_F()
773 close(fd); // Write mmap'd data on close in TEST_F()
778 leak(fd); in TEST_F()
788 int fd; in TEST_F() local
795 fd = open(FULLPATH, O_WRONLY); in TEST_F()
796 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
798 ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset)) in TEST_F()
800 leak(fd); in TEST_F()
812 int fd; in TEST_F() local
818 fd = open(FULLPATH, O_RDWR); in TEST_F()
819 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
820 ASSERT_EQ(0, fstat(fd, &sb0)) << strerror(errno); in TEST_F()
821 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
825 ASSERT_EQ(0, fstat(fd, &sb1)) << strerror(errno); in TEST_F()
831 leak(fd); in TEST_F()
840 int fd; in TEST_F() local
847 fd = open(FULLPATH, O_WRONLY); in TEST_F()
848 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
850 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
851 leak(fd); in TEST_F()
861 int fd; in TEST_F() local
880 fd = open(FULLPATH, O_WRONLY); in TEST_F()
881 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
883 ASSERT_EQ(bufsize, write(fd, contents, bufsize)) << strerror(errno); in TEST_F()
884 leak(fd); in TEST_F()
895 int fd; in TEST_F() local
901 fd = open(FULLPATH, O_WRONLY); in TEST_F()
902 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
904 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
905 leak(fd); in TEST_F()
914 int fd; in TEST_F() local
921 fd = open(FULLPATH, O_WRONLY); in TEST_F()
922 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
924 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
925 leak(fd); in TEST_F()
935 int fd; in TEST_F() local
953 fd = open(FULLPATH, O_RDWR); in TEST_F()
954 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
956 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
957 close(fd); in TEST_F()
966 int i, fd; in TEST_F() local
988 fd = open(FULLPATH, O_RDWR); in TEST_F()
989 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
992 ASSERT_EQ(bufsize, write(fd, wbuf, bufsize)) in TEST_F()
995 close(fd); in TEST_F()
1013 int i, fd; in TEST_F() local
1032 fd = open(FULLPATH, O_RDWR); in TEST_F()
1033 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1036 ASSERT_EQ(bufsize, write(fd, wbuf, bufsize)) in TEST_F()
1039 close(fd); in TEST_F()
1056 int fd; in TEST_F() local
1064 fd = open(FULLPATH, O_WRONLY); in TEST_F()
1065 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1067 ASSERT_EQ(bufsize, pwrite(fd, CONTENTS, bufsize, offset)) in TEST_F()
1069 leak(fd); in TEST_F()
1081 int fd; in TEST_F() local
1089 fd = open(FULLPATH, O_RDWR); in TEST_F()
1090 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1092 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1097 ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); in TEST_F()
1098 ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); in TEST_F()
1099 leak(fd); in TEST_F()
1113 int fd; in TEST_F() local
1123 fd = open(FULLPATH, O_RDWR | O_DIRECT); in TEST_F()
1124 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1126 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1128 ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); in TEST_F()
1129 ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno); in TEST_F()
1130 ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); in TEST_F()
1131 leak(fd); in TEST_F()
1140 int fd; in TEST_F() local
1150 fd = open(FULLPATH, O_RDWR); in TEST_F()
1151 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1153 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1155 ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); in TEST_F()
1156 ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno); in TEST_F()
1157 ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); in TEST_F()
1158 leak(fd); in TEST_F()
1174 int fd; in TEST_F() local
1190 fd = open(FULLPATH, O_RDWR); in TEST_F()
1191 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1193 p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in TEST_F()
1199 close(fd); // Write mmap'd data on close in TEST_F()
1213 int fd; in TEST_F() local
1226 fd = open(FULLPATH, O_RDWR); in TEST_F()
1227 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1229 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1232 leak(fd); in TEST_F()
1246 int fd; in TEST_F() local
1260 fd = open(FULLPATH, O_RDWR); in TEST_F()
1261 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1265 ASSERT_EQ(bufsize, pwrite(fd, CONTENTS0, bufsize, 0)) in TEST_F()
1269 ASSERT_EQ(0, fcntl(fd, F_SETFL, O_DIRECT)) << strerror(errno); in TEST_F()
1270 ASSERT_EQ(bufsize, pwrite(fd, CONTENTS1, bufsize, m_maxbcachebuf)) in TEST_F()
1274 ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno); in TEST_F()
1275 ASSERT_EQ(bufsize, pread(fd, readbuf, bufsize, 0)) << strerror(errno); in TEST_F()
1278 leak(fd); in TEST_F()
1292 int fd; in TEST_F() local
1309 fd = open(FULLPATH, O_RDWR); in TEST_F()
1310 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1313 ASSERT_EQ(3 * bs, pwrite(fd, zeros, 3 * bs, 0)) << strerror(errno); in TEST_F()
1324 ASSERT_EQ(0, fcntl(fd, F_SETFL, O_DIRECT)) << strerror(errno); in TEST_F()
1325 ASSERT_EQ(2 * bs, pwrite(fd, ones, 2 * bs, bs / 2)) << strerror(errno); in TEST_F()
1334 ASSERT_EQ(0, fcntl(fd, F_SETFL, 0)) << strerror(errno); in TEST_F()
1335 ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, 0)) << strerror(errno); in TEST_F()
1337 ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, 5 * bs / 2)) in TEST_F()
1340 ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, bs / 2)) in TEST_F()
1343 ASSERT_EQ(bs / 2, pread(fd, readbuf, bs / 2, 2 * bs)) in TEST_F()
1347 leak(fd); in TEST_F()
1367 int fd; in TEST_F() local
1382 fd = open(FULLPATH, O_RDWR); in TEST_F()
1383 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1386 ASSERT_EQ(wbufsize, pwrite(fd, CONTENTS1, wbufsize, offset)) in TEST_F()
1390 r = pread(fd, readbuf, rbufsize, 0); in TEST_F()
1398 ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno); in TEST_F()
1400 leak(fd); in TEST_F()
1414 int fd; in TEST_F() local
1421 char buf[CMSG_SPACE(sizeof(fd))]; in TEST_F()
1446 fd = open(FULLPATH, O_RDWR); in TEST_F()
1447 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1450 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1465 cmsg->cmsg_len = CMSG_LEN(sizeof(fd)); in TEST_F()
1466 memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd)); in TEST_F()
1469 close(fd); // Close fd within our process in TEST_F()
1471 close(s[1]); // The last copy of fd is within this socket's rcvbuf in TEST_F()
1490 int fd; in TEST_F() local
1523 fd = open(FULLPATH, O_RDWR); in TEST_F()
1524 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1525 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1527 ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno); in TEST_F()
1532 leak(fd); in TEST_F()
1544 int fd; in TEST_F() local
1562 fd = open(FULLPATH, O_RDWR); in TEST_F()
1563 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1564 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1565 ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno); in TEST_F()
1567 leak(fd); in TEST_F()
1579 int fd; in TEST_P() local
1599 fd = open(FULLPATH, O_RDWR); in TEST_P()
1600 ASSERT_LE(0, fd) << strerror(errno); in TEST_P()
1601 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_P()
1602 ASSERT_EQ(0, fchmod(fd, newmode)) << strerror(errno); in TEST_P()
1604 leak(fd); in TEST_P()
1618 int fd; in TEST_F() local
1626 fd = open(FULLPATH, O_RDWR); in TEST_F()
1627 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1629 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1634 ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); in TEST_F()
1635 ASSERT_EQ(bufsize, read(fd, readbuf, bufsize)) << strerror(errno); in TEST_F()
1636 leak(fd); in TEST_F()
1647 int fd; in TEST_F() local
1654 fd = open(FULLPATH, O_RDWR); in TEST_F()
1655 ASSERT_LE(0, fd) << strerror(errno); in TEST_F()
1657 ASSERT_EQ(bufsize, write(fd, CONTENTS, bufsize)) << strerror(errno); in TEST_F()
1659 ASSERT_EQ(0, fstat(fd, &sb)) << strerror(errno); in TEST_F()
1661 leak(fd); in TEST_F()