/ast/src/lib/libast/stdio/ |
H A D | _stdopen.c | 29 _stdopen(int fd, const char* mode) argument 31 return fdopen(fd, mode);
|
H A D | fdopen.c | 27 fdopen(int fd, const char* mode) argument 31 if (fd < 0 || !(flags = _sftype(mode, NiL, NiL, NiL))) 33 return sfnew(NiL, NiL, (size_t)SF_UNBOUND, fd, flags);
|
/ast/src/lib/libcs/ |
H A D | cscontrol.c | 25 * output control mark on fd 31 cscontrol(register Cs_t* state, int fd) argument 34 return send(fd, "", 1, MSG_OOB) == 1 ? 0 : -1; 40 return putmsg(fd, NiL, &buf, RS_HIPRI); 42 return write(fd, "", 1) == 1 ? 0 : -1; 48 _cs_control(int fd) argument 50 return cscontrol(&cs, fd);
|
H A D | msgrecv.c | 29 * read and blast message from fd into msg 33 msgrecv(int fd, register Msg_call_t* msg) argument 37 if ((n = msgread(fd, msg->data, sizeof(msg->data))) <= 0)
|
H A D | csdaemon.c | 27 * (1<<fd) bits not in fds will be modified: 42 register int fd; local 99 if ((fds & ((1<<0)|(1<<1)|(1<<2))) != ((1<<0)|(1<<1)|(1<<2)) && (fd = open("/dev/null", O_RDWR)) >= 0) 101 fds |= (1<<fd); 106 dup(fd); 108 close(fd);
|
H A D | msgread.c | 31 * read a message from fd into buf,siz 32 * handles record boundaries on fd 37 msgread(int fd, char* buf, size_t siz) argument 42 if ((n = cspeek(&cs, fd, buf, MSG_SIZE_SIZE)) >= 0) o = 0; 45 n = csread(&cs, fd, buf, MSG_SIZE_SIZE, CS_EXACT); 50 if (n <= MSG_SIZE_SIZE || n > siz || csread(&cs, fd, buf + o, n - o, CS_EXACT) != n - o) return -1;
|
/ast/src/cmd/tests/sfio/ |
H A D | tsetfd.c | 25 int fd; local 30 fd = sffileno(f); 37 if(sfsetfd(f,fd) != fd) 49 if((sk = lseek(fd, (off_t)0, 1)) != (off_t)1) 54 if(sfsetfd(f,fd) != fd)
|
H A D | tstkpk.c | 27 int fd[2]; local 30 if(pipe(fd) < 0 || fd[0] != 0) 40 if(write(fd[1],"ab",2) != 2) 48 if(write(fd[1],"cd",2) != 2) 50 close(fd[1]);
|
H A D | tpipemove.c | 24 int fd[2]; local 29 if(pipe(fd) < 0) 32 if(!(fr = sfnew(NIL(Sfio_t*),NIL(Void_t*),(size_t)SF_UNBOUND,fd[0],SF_READ)) || 33 !(fw = sfnew(NIL(Sfio_t*),NIL(Void_t*),(size_t)SF_UNBOUND,fd[1],SF_WRITE)) )
|
/ast/src/cmd/3d/ |
H A D | dup23d.c | 29 dup23d(int fd, register int r) argument 33 r = DUP2(fd, r); 36 fs3d_dup(fd, r);
|
H A D | fchdir3d.c | 29 fchdir3d(int fd) argument 34 if (fd >= 0 && fd < elementsof(state.file) && (dp = state.file[fd].dir) && !FSTAT(fd, &st) && dp->dev == st.st_dev && dp->ino == st.st_ino) 36 else if (FCHDIR(fd))
|
H A D | fchmod3d.c | 29 fchmod3d(int fd, mode_t mode) argument 34 if (!fscall(NiL, MSG_fchmod, 0, fd, mode)) 38 if (FCHMOD(fd, mode)) 42 fscall(mp, MSG_fchmod, 0, fd, mode); 45 fscall(mp, MSG_fchmod, 0, fd, mode);
|
H A D | fstatvfs3d.c | 31 fstatvfs3d(int fd, struct statvfs* fs) argument 36 if (!fscall(NiL, MSG_fstatfs, 0, fd, fs)) 40 if (FSTATVFS(fd, fs)) 44 fscall(mp, MSG_fstatfs, 0, fd, fs); 47 fscall(mp, MSG_fstatfs, 0, fd, fs);
|
H A D | fsync3d.c | 29 fsync3d(int fd) argument 34 if (!fscall(NiL, MSG_fsync, 0, fd)) 38 if (FSYNC(fd)) 42 fscall(mp, MSG_fsync, 0, fd); 45 fscall(mp, MSG_fsync, 0, fd);
|
H A D | close3d.c | 27 close3d(int fd) argument 30 if (fd >= 0 && fd < elementsof(state.file)) 39 if (state.file[fd].dir) 41 free(state.file[fd].dir); 42 state.file[fd].dir = 0; 45 if (rp = state.file[fd].reserved) 47 if ((nfd = FCNTL(fd, F_DUPFD, fd + 1)) < 0) 55 state.file[fd] [all...] |
H A D | fchown3d.c | 29 fchown3d(int fd, uid_t uid, gid_t gid) argument 34 if (!fscall(NiL, MSG_fchown, 0, fd, uid, gid)) 38 if (FCHOWN(fd, uid, gid)) 42 fscall(mp, MSG_fchown, 0, fd, uid, gid); 45 fscall(mp, MSG_fchown, 0, fd, uid, gid);
|
H A D | peek.c | 29 * peek siz chars from fd into buf 34 peek(int fd, void* buf, size_t siz) argument 38 n = cspeek(&cs, fd, buf, siz); 42 if (!FSTAT(fd, &state.path.st) && state.path.st.st_size <= siz) 44 while ((n = read(fd, buf, siz)) != state.path.st.st_size && lseek(fd, 0L, 1) > 0 && lseek(fd, 0L, 0) == 0);
|
H A D | pipe3d.c | 33 int fd; local 39 for (fd = 0; fd < OPEN_MAX; fd++) 40 if ((fds[0] = DUP(fd)) >= 0)
|
H A D | dup3d.c | 74 dup3d(int fd) argument 79 r = DUP(fd); 82 fs3d_dup(fd, r);
|
H A D | fcntl3d.c | 31 fcntl3d(int fd, int op, ...) argument 45 r = FCNTL(fd, op, arg); 51 fs3d_dup(fd, r); 57 state.file[fd].flags &= ~FILE_CLOEXEC; 58 else if (!(state.file[fd].flags & FILE_OPEN)) 59 fileinit(fd, NiL, NiL, 1); 61 state.file[fd].flags |= FILE_CLOEXEC;
|
H A D | fpathconf3d.c | 29 fpathconf3d(int fd, int op) argument 36 if (!fscall(NiL, MSG_fpathconf, 0, fd, op)) 42 r = FPATHCONF(fd, op); 48 fscall(mp, MSG_fpathconf, 0, fd, op); 51 fscall(mp, MSG_fpathconf, 0, fd, op);
|
H A D | getdents3d.c | 29 getdents3d(int fd, void* buf, size_t n) argument 36 if (!fscall(NiL, MSG_getdents, 0, fd, buf, n)) 40 if ((r = GETDENTS(fd, buf, n)) >= 0) 44 fscall(mp, MSG_getdents, r, fd, buf, n); 47 fscall(mp, MSG_getdents, r, fd, buf, n); 62 getdents643d(int fd, void* buf, size_t n) 69 if (!fscall(NiL, MSG_getdents, 0, fd, buf, n)) 73 if ((r = GETDENTS64(fd, buf, n)) >= 0) 77 fscall(mp, MSG_getdents, r, fd, buf, n); 80 fscall(mp, MSG_getdents, r, fd, bu [all...] |
/ast/src/cmd/cs/vcs_src/ |
H A D | mnt_imount.h | 30 int fd; member in struct:istate_t
|
/ast/src/lib/libast/sfio/ |
H A D | sfsetfd.c | 30 static int _sfdup(int fd, int newfd) argument 32 static int _sfdup(fd,newfd) 33 int fd; 40 while((dupfd = sysfcntlf(fd,F_DUPFD,newfd)) < 0 && errno == EINTR) 45 if((dupfd = sysdupf(fd)) < 0 || dupfd >= newfd) 49 newfd = _sfdup(fd,newfd);
|
/ast/src/lib/libast/vec/ |
H A D | vecfile.c | 44 int fd; local 48 if ((fd = open(file, O_RDONLY|O_cloexec)) >= 0) 50 if (!fstat(fd, &st) && S_ISREG(st.st_mode) && (n = st.st_size) > 0 && (buf = newof(0, char, n + 1, 0))) 52 if (read(fd, buf, n) == n) 59 close(fd);
|