Lines Matching refs:fd
71 int fd = -1;
87 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
89 return(fd);
105 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC,
114 return(fd);
126 file_close(ARCHD *arcn, int fd)
130 if (fd < 0)
132 if (close(fd) < 0)
742 file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
789 if (lseek(fd, (off_t)wcnt, SEEK_CUR) < 0) {
806 if (write(fd, st, wcnt) != wcnt) {
823 file_flush(int fd, char *fname, int isempt)
837 if (lseek(fd, (off_t)-1, SEEK_CUR) < 0) {
842 if (write(fd, blnk, 1) < 0)
854 rdfile_close(ARCHD *arcn, int *fd)
859 if (*fd < 0)
862 (void)close(*fd);
863 *fd = -1;
884 set_crc(ARCHD *arcn, int fd)
894 if (fd < 0) {
896 * hmm, no fd, should never happen. well no crc then.
910 if ((res = read(fd, tbuf, size)) <= 0)
923 else if (fstat(fd, &sb) < 0)
927 else if (lseek(fd, (off_t)0L, SEEK_SET) < 0)