Lines Matching refs:fd

280 copy_to_tmpfile (int fd, char *buf, idx_t bufsize)  in copy_to_tmpfile()  argument
288 while (0 < (r = read (fd, buf, bufsize))) in copy_to_tmpfile()
301 r = dup2 (fileno (tmp), fd); in copy_to_tmpfile()
315 input_file_size (int fd, struct stat const *st, char *buf, idx_t bufsize) in input_file_size() argument
320 ssize_t n_read = read (fd, buf + size, bufsize - size); in input_file_size()
329 || (cur = lseek (fd, 0, SEEK_CUR)) < 0 in input_file_size()
331 || (end = lseek (fd, 0, SEEK_END)) < 0) in input_file_size()
334 end = copy_to_tmpfile (fd, tmpbuf, bufsize); in input_file_size()
350 off_t r = lseek (fd, cur, SEEK_SET); in input_file_size()
480 int fd = open (name, oflags | O_EXCL, MODE_RW_UGO); in create() local
481 if (0 <= fd || errno != EEXIST) in create()
482 return fd; in create()
483 fd = open (name, oflags, MODE_RW_UGO); in create()
484 if (fd < 0) in create()
485 return fd; in create()
487 if (fstat (fd, &out_stat_buf) != 0) in create()
495 && ftruncate (fd, 0) < 0 && regularish) in create()
498 return fd; in create()
561 closeout (FILE *fp, int fd, pid_t pid, char const *name) in closeout() argument
565 if (fd >= 0) in closeout()
567 if (fp == nullptr && close (fd) < 0) in closeout()
572 if (open_pipes[j] == fd) in closeout()
1082 int fd; in ofile_open() local
1091 fd = create (files[i_check].of_name); in ofile_open()
1108 fd = open (files[i_check].of_name, in ofile_open()
1112 if (0 <= fd) in ofile_open()
1136 files[i_check].ofd = fd; in ofile_open()
1137 FILE *ofile = fdopen (fd, "a"); in ofile_open()