Lines Matching refs:fd
67 int fd;
72 fd = open(path, O_RDWR | O_CREAT, 0600);
74 if (fd >= 0) {
77 ATF_REQUIRE_ERRNO(0, write(fd, wbuf, 3) == 3);
80 ATF_REQUIRE_ERRNO(EINVAL, write(fd, wbuf, SIZE_MAX) == -1);
83 ATF_REQUIRE_ERRNO(EFAULT, write(fd, (void *)-1, 1) == -1);
89 ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0);
90 ATF_REQUIRE(read(fd, rbuf, 3) == 3);
93 (void)close(fd);
142 int fd;
144 fd = open(path, O_RDWR | O_CREAT, 0600);
145 ATF_REQUIRE(fd >= 0);
148 ATF_REQUIRE(write(fd, "x", 1) == 1);
149 ATF_REQUIRE(lseek(fd, 0, SEEK_CUR) == (off_t)(i + 1));
152 ATF_REQUIRE(close(fd) == 0);
172 int fd;
174 fd = open(path, O_WRONLY | O_CREAT, 0600);
175 ATF_REQUIRE(fd >= 0);
180 j += write(fd, buf, sizeof(buf));
185 (void)close(fd);
228 int fd[2];
229 ATF_REQUIRE(pipe(fd) != -1);
235 ssize_t retval = write(fd[1], map, SIZE);
241 close(fd[0]);
242 close(fd[1]);
255 int fd = open(_PATH_DEVZERO, O_RDONLY);
256 ATF_REQUIRE(fd != -1);
261 ssize_t retval = read(fd, map, SIZE);
267 close(fd);