Lines Matching refs:fd
30 /* Load a file from a fd into a buffer */
32 sshbuf_load_fd(int fd, struct sshbuf **blobp)
42 if (fstat(fd, &st) == -1)
50 if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) {
81 int r, fd, oerrno;
84 if ((fd = open(path, O_RDONLY)) == -1)
86 if ((r = sshbuf_load_fd(fd, bufp)) != 0)
92 close(fd);
101 int fd, oerrno;
103 if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
105 if (atomicio(vwrite, fd, sshbuf_mutable_ptr(buf),
106 sshbuf_len(buf)) != sshbuf_len(buf) || close(fd) != 0) {
108 close(fd);