Searched defs:fd (Results 1 - 25 of 201) sorted by relevance

123456789

/ast/src/lib/libast/stdio/
H A D_stdopen.c29 _stdopen(int fd, const char* mode) argument
31 return fdopen(fd, mode);
H A Dfdopen.c27 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 Dcscontrol.c25 * 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 Dmsgrecv.c29 * 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 Dcsdaemon.c27 * (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 Dmsgread.c31 * 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 Dtsetfd.c25 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 Dtstkpk.c27 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 Dtpipemove.c24 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 Ddup23d.c29 dup23d(int fd, register int r) argument
33 r = DUP2(fd, r);
36 fs3d_dup(fd, r);
H A Dfchdir3d.c29 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 Dfchmod3d.c29 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 Dfstatvfs3d.c31 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 Dfsync3d.c29 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 Dclose3d.c27 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 Dfchown3d.c29 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 Dpeek.c29 * 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 Dpipe3d.c33 int fd; local
39 for (fd = 0; fd < OPEN_MAX; fd++)
40 if ((fds[0] = DUP(fd)) >= 0)
H A Ddup3d.c74 dup3d(int fd) argument
79 r = DUP(fd);
82 fs3d_dup(fd, r);
H A Dfcntl3d.c31 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 Dfpathconf3d.c29 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 Dgetdents3d.c29 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 Dmnt_imount.h30 int fd; member in struct:istate_t
/ast/src/lib/libast/sfio/
H A Dsfsetfd.c30 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 Dvecfile.c44 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);

Completed in 57 milliseconds

123456789