Searched refs:fd (Results 1 - 25 of 2333) sorted by path

1234567891011>>

/freebsd-11-stable/bin/cat/
H A Dcat.c167 int fd, i; local
172 fd = -1;
176 fd = STDIN_FILENO;
179 fd = open(path, O_RDONLY);
181 if (fd < 0 && errno == EOPNOTSUPP)
182 fd = udom_open(path, O_RDONLY);
185 if (fd < 0) {
189 if (fd == STDIN_FILENO)
192 fp = fdopen(fd, "r");
197 raw_cat(fd);
333 int fd = -1; local
[all...]
/freebsd-11-stable/bin/cp/
H A Dutils.c345 setfile(struct stat *fs, int fd) argument
352 fdval = fd != -1;
359 if (fdval ? futimens(fd, tspec) : utimensat(AT_FDCWD, to.p_path, tspec,
364 if (fdval ? fstat(fd, &ts) :
379 if (fdval ? fchown(fd, fs->st_uid, fs->st_gid) :
390 if (fdval ? fchmod(fd, fs->st_mode) :
399 fchflags(fd, fs->st_flags) :
/freebsd-11-stable/bin/dd/
H A Dposition.c100 if (lseek(in.fd, seek_offset(&in), SEEK_CUR) == -1 &&
116 if ((nr = read(in.fd, in.db, bcnt)) > 0) {
170 if (lseek(out.fd, seek_offset(&out), SEEK_CUR) == -1 &&
185 if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
192 if ((n = read(out.fd, out.db, out.dbsz)) > 0)
205 if (ioctl(out.fd, MTIOCTOP, &t_op) == -1)
209 n = write(out.fd, out.db, out.dbsz);
/freebsd-11-stable/bin/ed/
H A Dbuf.c194 int fd; local
200 if ((fd = mkstemp(sfn)) == -1 ||
201 (sfp = fdopen(fd, "w+")) == NULL) {
202 if (fd != -1)
203 close(fd);
/freebsd-11-stable/bin/pax/
H A Dar_io.c1249 * to keep the fd the same in the calling function (parent).
1252 ar_start_gzip(int fd, const char *gzip_prog, int wr) argument
1266 dup2(fds[1], fd);
1268 dup2(fds[0], fd);
1274 dup2(fd, STDOUT_FILENO);
1278 dup2(fd, STDIN_FILENO);
H A Dar_subs.c157 int fd; local
310 if ((fd = file_creat(arcn)) < 0) {
319 res = (*frmt->rd_data)(arcn, fd, &cnt);
320 file_close(arcn, fd);
363 int fd = -1; local
405 fd = -1;
433 if ((fd = open(arcn->org_name, O_RDONLY, 0)) < 0) {
449 rdfile_close(arcn, &fd);
454 if ((res > 0) || (docrc && (set_crc(arcn, fd) < 0))) {
459 rdfile_close(arcn, &fd);
[all...]
H A Dfile_subs.c77 int fd = -1; local
93 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
95 return(fd);
111 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC,
120 return(fd);
132 file_close(ARCHD *arcn, int fd) argument
136 if (fd < 0)
138 if (close(fd) < 0)
748 file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz, argument
795 if (lseek(fd, (off_
829 file_flush(int fd, char *fname, int isempt) argument
860 rdfile_close(ARCHD *arcn, int *fd) argument
890 set_crc(ARCHD *arcn, int fd) argument
[all...]
/freebsd-11-stable/bin/pax/tests/
H A Dlegacy_test.pl17 open my $fd, ">", $fn or die "$fn: $!";
18 print $fd "file $n\n";
/freebsd-11-stable/bin/rcp/
H A Drcp.c358 int amt, fd, haderr, indx, result; local
363 if ((fd = open(name, O_RDONLY, 0)) < 0)
365 if (fstat(fd, &stb)) {
404 if ((bp = allocbuf(&buffer, fd, BUFSIZ)) == NULL) {
405 next: if (fd >= 0)
406 (void)close(fd);
416 result = read(fd, bp->buf, amt);
428 if (close(fd) && !haderr)
H A Dutil.c130 allocbuf(BUF *bp, int fd, int blksize) argument
135 if (fstat(fd, &stb) < 0) {
/freebsd-11-stable/bin/rm/
H A Drm.c428 int bsize, fd, wlen; local
431 fd = -1;
444 if ((fd = open(file, O_WRONLY|O_NONBLOCK|O_NOFOLLOW, 0)) == -1)
446 if (fstat(fd, &sb2))
453 if (fstatfs(fd, &fsb) == -1)
463 if (write(fd, buf, wlen) != wlen) \
468 if (fsync(fd) || lseek(fd, (off_t)0, SEEK_SET))
471 if (fsync(fd) || lseek(fd, (off_
[all...]
/freebsd-11-stable/bin/sh/
H A Deval.c655 result->fd = -1;
705 result->fd = pip[0];
709 TRACE(("evalbackcmd done: fd=%d buf=%p nleft=%d jp=%p\n",
710 result->fd, result->buf, result->nleft, result->jp));
1173 backcmd->fd = pip[0];
H A Deval.h43 int fd; /* file descriptor to read from */ member in struct:backcmd
H A Dexpand.c473 if (in.fd < 0)
475 while ((i = read(in.fd, buf, sizeof buf)) < 0 && errno == EINTR);
511 if (in.fd >= 0)
512 close(in.fd);
1512 int fd = -1; local
1518 fd = number(shoptarg);
1527 if (fd < 0)
1528 error("missing fd");
1530 setinputfd(fd, 1);
1533 popfile(); /* will also close fd */
[all...]
H A Dmain.c253 int fd; local
260 if ((fd = open(expandedname, O_RDONLY | O_CLOEXEC)) >= 0)
261 setinputfd(fd, 1);
263 if (fd < 0)
H A Dparser.c740 synerror("Bad fd number");
1021 * specifying the fd to be redirected. The variable "c" contains the
1028 char fd = *out; local
1033 np->nfile.fd = 1;
1046 np->nfile.fd = 0;
1051 np->nfile.fd = 0;
1071 if (fd != '\0')
1072 np->nfile.fd = digit_val(fd);
H A Dredir.c66 #define CLOSED -1 /* fd was not open before redir */
114 int fd; local
135 fd = n->nfile.fd;
136 if (fd == 0)
139 n->ndup.dupfd == fd)
142 if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) {
144 if ((i = fcntl(fd, F_DUPFD_CLOEXEC, 10)) == -1) {
151 error("%d: %s", fd, strerror(errno));
155 sv->renamed[fd]
174 int fd = redir->nfile.fd; local
[all...]
H A Dshow.c151 if (np->nfile.fd != dftfd)
152 fprintf(fp, "%d", np->nfile.fd);
/freebsd-11-stable/bin/stty/
H A Dkey.c198 (void)ioctl(ip->fd, TIOCEXT, &tmp);
201 (void)ioctl(ip->fd, TIOCEXT, &tmp);
292 if (ioctl(ip->fd, TIOCSETD, &tmp) < 0)
H A Dstty.c68 i.fd = STDIN_FILENO;
83 if ((i.fd = open(optarg, O_RDONLY | O_NONBLOCK)) < 0)
98 if (tcgetattr(i.fd, &i.t) < 0)
100 if (ioctl(i.fd, TIOCGETD, &i.ldisc) < 0)
102 if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
153 if (i.set && tcsetattr(i.fd, 0, &i.t) < 0)
155 if (i.wset && ioctl(i.fd, TIOCSWINSZ, &i.win) < 0)
H A Dstty.h37 int fd; /* file descriptor */ member in struct:info
/freebsd-11-stable/cddl/compat/opensolaris/include/
H A Ddevid.h52 int devid_get(int fd, ddi_devid_t *retdevid);
53 int devid_get_minor_name(int fd, char **retminor_name);
H A Dmnttab.h29 int getmntany(FILE *fd, struct mnttab *mgetp, struct mnttab *mrefp);
/freebsd-11-stable/cddl/compat/opensolaris/misc/
H A Ddeviceid.c94 devid_get(int fd, ddi_devid_t *retdevid) argument
101 devid_get_minor_name(int fd, char **retminor_name) argument
H A Dfsshare.c72 zgetline(FILE *fd, const char *skip) argument
81 s = fgets(line, sizeof(line), fd);
156 int fd, error; local
169 fd = mkstemp(tmpfile);
170 if (fd == -1)
176 error = flock(fd, LOCK_EX);
178 newfd = fdopen(fd, "r+");

Completed in 182 milliseconds

1234567891011>>