Lines Matching refs:fd
119 fd_t fd = OpenFile(tmpfile, WrOnly);
120 ASSERT_NE(fd, kInvalidFd);
121 ASSERT_TRUE(WriteToFile(fd, "A", 1));
122 CloseFile(fd);
124 fd = OpenFile(tmpfile, WrOnly);
125 ASSERT_NE(fd, kInvalidFd);
127 EXPECT_EQ(internal_lseek(fd, 0, SEEK_END), 0u);
130 EXPECT_TRUE(WriteToFile(fd, str1, len1, &bytes_written));
132 EXPECT_TRUE(WriteToFile(fd, str2, len2, &bytes_written));
134 CloseFile(fd);
138 fd = OpenFile(tmpfile, RdOnly);
139 ASSERT_NE(fd, kInvalidFd);
143 uptr fsize = internal_filesize(fd);
149 EXPECT_EQ(0u, internal_fstat(fd, &st3));
156 EXPECT_EQ(0u, internal_fstat(fd, &sam.st));
164 EXPECT_TRUE(ReadFromFile(fd, buf, len1, &bytes_read));
169 EXPECT_TRUE(ReadFromFile(fd, buf, len2, &bytes_read));
172 CloseFile(fd);
319 fd_t fd = OpenFile(tmpfile, RdWr);
320 ASSERT_NE(fd, kInvalidFd);
323 uptr res = internal_ftruncate(fd, page_size * 2);
326 res = internal_lseek(fd, page_size, SEEK_SET);
329 res = internal_write(fd, "AB", 2);
332 char *p = (char *)MapWritableFileToMemory(nullptr, page_size, fd, page_size);
338 CloseFile(fd);
361 fd_t fd = OpenFile(tmpfile, WrOnly);
362 ASSERT_NE(fd, kInvalidFd);
364 CloseFile(fd);