Lines Matching refs:fd
187 int fd;
189 fd = open(saltfile, O_RDONLY);
190 if (fd == -1) {
195 fd = open(saltfile, O_RDWR|O_CREAT|O_EXCL, 0600);
196 if (fd == -1)
202 if (write(fd, saltbuf, sizeof(saltbuf))
209 if (read(fd, saltbuf, sizeof(saltbuf))
214 close(fd);
286 int fd, rv = -1;
296 if ((fd = opendev(dev, O_RDONLY, OPENDEV_PART, &rdev)) == -1) {
313 rv = ioctl(fd, VNDIOCSET, &vndio);
324 close(fd);
337 int fd, rv = -1;
340 if ((fd = opendev(vnd, O_RDONLY, OPENDEV_PART, &rdev)) == -1)
349 rv = ioctl(fd, VNDIOCCLR, &vndio);
355 close(fd);