/ast/src/lib/libast/port/ |
H A D | astcopy.c | 27 * copy from rfd to wfd (with conditional mmap hacks) 45 * copy n bytes from rfd to wfd 51 astcopy(int rfd, int wfd, off_t n) argument 67 if (!fstat(rfd, &st) && S_ISREG(st.st_mode) && (pos = lseek(rfd, (off_t)0, 1)) != ((off_t)-1)) 72 if (mapsize >= BUFSIZ * 2 && (mapbuf = (char*)mmap(NiL, mapsize, PROT_READ, MAP_SHARED, rfd, pos)) != ((caddr_t)-1)) 74 if (write(wfd, mapbuf, mapsize) != mapsize || lseek(rfd, mapsize, 1) == ((off_t)-1)) return(-1); 88 if ((c = read(rfd, buf, (size_t)n)) > 0 && write(wfd, buf, (size_t)c) != c) c = -1;
|
H A D | astconf.c | 1391 if (sp = sfnew(NiL, NiL, SF_UNBOUND, (*pp)->rfd, SF_READ))
|
/ast/src/cmd/3d/ |
H A D | copy.c | 49 * copy rfd to wfd 54 fs3d_copy(int rfd, int wfd, struct stat* st) argument 69 if (!st && FSTAT(rfd, st = &stbuf)) return -1; 75 if ((filesize > COPYBUF) && ((mapbuf = mmap((caddr_t)0, mapsize, PROT_READ, MAP_SHARED, rfd, 0)) != ((caddr_t)-1))) 90 if (mmap(mapbuf, mapsize, PROT_READ, MAP_SHARED|MAP_FIXED, rfd, offset) == (caddr_t)-1) 101 while ((n = read(rfd, buf, COPYBUF)) > 0)
|
H A D | pathreal.c | 454 int rfd; local 457 if ((rfd = OPEN(sp, O_RDONLY, 0)) < 0) 468 if (fs3d_copy(rfd, wfd, st)) 472 CLOSE(rfd);
|
/ast/src/lib/libast/misc/ |
H A D | procclose.c | 42 if (p->rfd >= 0) 43 close(p->rfd); 44 if (p->wfd >= 0 && p->wfd != p->rfd)
|
H A D | procopen.c | 468 proc->rfd = -1; 874 proc->rfd = pio[0]; 878 if (proc->rfd > 2) 879 fcntl(proc->rfd, F_SETFD, FD_CLOEXEC);
|
/ast/src/lib/libcs/ |
H A D | csrecv.c | 103 int rfd[OPEN_MAX + 1]; local 179 if (sockrecv(fds[0], id, rfd, 1) != 1) 184 if (fstat(rfd[0], &st)) 186 messagef((state->id, NiL, -1, "recv: %d: %d: authentication stat error", fd, rfd[0])); 188 close(rfd[0]); 196 messagef((state->id, NiL, -1, "recv: %d: %d: invalid authentication mode %04o", fd, rfd[0], st.st_mode & CS_AUTH_MASK)); 199 close(rfd[0]); 294 if ((i = sockrecv(fd, id, rfd, n + 1)) <= 1) 301 while (--i >= 0) close(rfd[i]); 305 if (fstat(rfd[ [all...] |
H A D | csopen.c | 313 if ((m = csread(state, proc->rfd, buf, sizeof(buf), CS_LINE)) <= 1) 324 if ((m = csread(state, proc->rfd, buf, sizeof(buf), CS_LINE)) <= 1) 337 if ((m = csread(state, proc->rfd, buf, sizeof(buf), CS_LINE)) <= 0)
|
/ast/src/cmd/mailx/ |
H A D | tty.c | 226 * Output label on wfd and return next char on rfd with no echo. 231 ttyquery(int rfd, int wfd, const char* label) argument 243 tcgetattr(rfd, &old); 248 tcsetattr(rfd, TCSADRAIN, &tty); 249 if ((r = read(rfd, &c, 1)) == 1) { 261 tcsetattr(rfd, TCSADRAIN, &old); 272 * Edit buf on rfd,wfd with label. 277 ttyedit(int rfd, int wfd, const char* label, char* buf, size_t size) argument 290 tcgetattr(rfd, &old); 295 tcsetattr(rfd, TCSADRAI [all...] |
/ast/src/cmd/pax/ |
H A D | copy.c | 84 * if rfd<0 && st_size>0 then input from bread() 356 register int rfd; local 366 if ((rfd = openin(state.out, f)) >= 0) 377 if ((hole = lseek(rfd, data, SEEK_HOLE)) < data) 379 hole = lseek(rfd, 0, SEEK_END); 386 if (lseek(rfd, data, SEEK_SET) != data || (n = read(rfd, state.tmp.buffer, (size_t)c)) <= 0) 403 if ((data = lseek(rfd, hole, SEEK_DATA)) < hole) 405 if ((data = lseek(rfd, -1, SEEK_END)) < 0 || lseek(wfd, data, SEEK_SET) != data || write(wfd, "", 1) != 1) 415 if ((n = read(rfd, stat [all...] |
H A D | file.c | 52 int rfd; local 59 if ((rfd = open(f->st->st_size ? f->path : "/dev/null", O_RDONLY|O_BINARY)) < 0) 61 return rfd; 69 if ((rfd = open(state.tmp.file, O_RDONLY|O_BINARY)) < 0) 103 close(rfd); 117 close(rfd); 122 while ((n = read(proc->rfd, state.tmp.buffer, state.buffersize)) > 0) 141 return rfd; 153 int rfd; local 156 rfd 1392 int rfd; local [all...] |
H A D | pax-slt.c | 852 slt_putdata(Pax_t* pax, Archive_t* ap, File_t* f, int rfd) argument 887 if (rfd >= 0) 888 n = read(rfd, state.tmp.buffer, m); 889 else if (bp = getbuffer(rfd)) 918 if (rfd >= 0) 919 close(rfd); 921 else if (rfd < 0) 923 else if (!(rfp = sfnew(NiL, NiL, SF_UNBOUND, rfd, SF_READ))) 926 close(rfd);
|
H A D | format.c | 135 ap->io->fd = proc->rfd;
|
/ast/src/lib/libast/disc/ |
H A D | sfdcmore.c | 77 * output label on wfd and return next char on rfd with no echo 98 int rfd = sffileno(rp); local 105 tcgetattr(rfd, &old); 110 tcsetattr(rfd, TCSADRAIN, &tty); 111 if ((r = read(rfd, &c, 1)) == 1) 124 tcsetattr(rfd, TCSADRAIN, &old);
|
/ast/src/lib/libast/include/ |
H A D | proc.h | 88 int rfd; /* read fd if applicable */ member in struct:__anon273
|
/ast/src/cmd/cs/ |
H A D | css.c | 218 if (!(fp = cssfd(css, state.proc->rfd, CS_POLL_READ)))
|
/ast/src/lib/libcmd/ |
H A D | cp.c | 242 int rfd; local 593 if (ent->fts_statp->st_size > 0 && (rfd = open(ent->fts_path, O_RDONLY|O_BINARY|O_cloexec)) < 0) 602 close(rfd); 607 if (!(ip = sfnew(NiL, NiL, SF_UNBOUND, rfd, SF_READ))) 610 close(rfd);
|
/ast/src/cmd/probe/ |
H A D | probe.c | 529 else if (!(options & TEST) && (!(pf = sfnew(NiL, NiL, SF_UNBOUND, pp->rfd, SF_READ)) || !(pp->rfd = -1) || sfmove(pf, fp, SF_UNBOUND, -1) < 0 || sfclose(pf) || sfclose(fp)))
|
/ast/src/lib/libast/path/ |
H A D | pathprobe.c | 266 if ((r = read(pp->rfd, k, v)) < 0)
|
/ast/src/lib/libast/sfio/ |
H A D | sfpopen.c | 172 (sflags&SF_READ) ? proc->rfd : proc->wfd, sflags|((sflags&SF_RDWR)?0:SF_READ))) ||
|
/ast/src/cmd/ss/ |
H A D | ssd.c | 500 n = read(proc->rfd, buf, sizeof(buf)); 612 n = read(proc->rfd, buf, sizeof(buf) - 1);
|