Lines Matching refs:fd
73 int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0666);
74 EXPECT_TRUE(fd > 0);
76 ftruncate(fd, SIZE);
80 void *addr = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
95 lseek(fd, 0, SEEK_SET);
97 read(fd, buffer, SIZE);
101 close(fd);
114 int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0666);
115 EXPECT_TRUE(fd > 0);
117 ftruncate(fd, SIZE);
120 void *addr = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
133 lseek(fd, 0, SEEK_SET);
135 read(fd, buffer, SIZE);
139 close(fd);
152 int fd = open(TEST_FILE, O_RDWR | O_CREAT, 0666);
153 EXPECT_TRUE(fd > 0);
155 ftruncate(fd, SIZE);
158 void *addr = mmap(nullptr, SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
169 lseek(fd, 0, SEEK_SET);
171 read(fd, buffer, SIZE);
175 close(fd);