Lines Matching refs:fd
16 test_for_content(int fd, off_t start, const char* contents, size_t length)
22 if (pread(fd, buffer, toRead, start) != (ssize_t)toRead) {
40 test_for_zero(int fd, off_t start, off_t end)
46 if (pread(fd, buffer, length, start) != (ssize_t)length) {
85 int fd = open(name, O_RDWR | O_TRUNC | O_CREAT, 0644);
86 if (fd < 0) {
99 if (write(fd, buffer, sizeof(buffer)) != (ssize_t)sizeof(buffer)) {
108 ftruncate(fd, 0);
112 pwrite(fd, "---", 3, 100 * 1024);
113 pwrite(fd, "+++", 3, 200 * 1024);
117 test_for_zero(fd, 0, 100 * 1024);
118 test_for_content(fd, 100 * 1024, "---", 3);
119 test_for_zero(fd, 100 * 1024 + 256, 200 * 1024);
120 test_for_content(fd, 200 * 1024, "+++", 3);