Lines Matching refs:fd

299 dosync (int fd, char const *qname)  in dosync()  argument
303 if (fdatasync (fd) == 0) in dosync()
313 if (fsync (fd) == 0) in dosync()
330 direct_mode (int fd, bool enable) in direct_mode() argument
334 int fd_flags = fcntl (fd, F_GETFL); in direct_mode()
341 fcntl (fd, F_SETFL, new_flags); in direct_mode()
347 directio (fd, enable ? DIRECTIO_ON : DIRECTIO_OFF); in direct_mode()
353 dorewind (int fd, struct stat const *st) in dorewind() argument
364 if (ioctl (fd, MTIOCTOP, &op) == 0) in dorewind()
368 off_t offset = lseek (fd, 0, SEEK_SET); in dorewind()
393 dopass (int fd, struct stat const *st, char const *qname, off_t *sizep, in dopass() argument
428 direct_mode (fd, true); in dopass()
430 if (! dorewind (fd, st)) in dopass()
475 ssize = write (fd, pbuf + soff, lim - soff); in dopass()
496 direct_mode (fd, false); in dopass()
515 if (lseek (fd, offset + soff1, SEEK_SET) != -1) in dopass()
590 if (dosync (fd, qname) != 0) in dopass()
604 if (dosync (fd, qname) != 0) in dopass()
814 do_wipefd (int fd, char const *qname, struct randint_source *s, in do_wipefd() argument
830 if (fstat (fd, &st)) in do_wipefd()
839 if ((S_ISCHR (st.st_mode) && isatty (fd)) in do_wipefd()
880 size = lseek (fd, 0, SEEK_END); in do_wipefd()
925 err = dopass (fd, &st, qname, &pass_size, type, rs, i + 1, pn); in do_wipefd()
941 if (flags->remove_file && ftruncate (fd, 0) != 0 in do_wipefd()
956 wipefd (int fd, char const *qname, struct randint_source *s, in wipefd() argument
959 int fd_flags = fcntl (fd, F_GETFL); in wipefd()
971 return do_wipefd (fd, qname, s, flags); in wipefd()
1122 int fd; in wipefile() local
1124 fd = open (name, O_WRONLY | O_NOCTTY | O_BINARY); in wipefile()
1125 if (fd < 0 in wipefile()
1128 fd = open (name, O_WRONLY | O_NOCTTY | O_BINARY); in wipefile()
1129 if (fd < 0) in wipefile()
1135 ok = do_wipefd (fd, qname, s, flags); in wipefile()
1136 if (close (fd) != 0) in wipefile()