Searched refs:fds (Results 1 - 24 of 24) sorted by relevance

/ast/src/lib/libcs/
H A Dcspipe.c31 cspipe(Cs_t* state, int* fds) argument
38 return socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
42 return pipe(fds);
49 _cs_pipe(int* fds) argument
51 return cspipe(&cs, fds);
H A Dcsdaemon.c27 * (1<<fd) bits not in fds will be modified:
40 csdaemon(register Cs_t* state, int fds) argument
46 messagef((state->id, NiL, -8, "daemon(%o) call", fds));
96 * redirect {0,1,2} to /dev/null if not in fds
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);
103 if (!(fds & (1<<i)))
112 * close any other garbage fds
116 if (!(fds & (1<<i)) && !fcntl(i, F_GETFD, 0))
136 messagef((state->id, NiL, -8, "daemon(%o) = 0", fds));
141 _cs_daemon(int fds) argument
[all...]
H A Dcsclient.c71 Cspoll_t fds[2]; local
98 fds[0].fd = 1;
99 fds[0].events = CS_POLL_WRITE;
104 fds[0].fd = 0;
105 fds[0].events = CS_POLL_READ;
107 fds[1].fd = fd;
108 fds[1].events = CS_POLL_READ;
110 if (promptlen = (!argv && prompt && isatty(fds[0].fd) && isatty(1)) ? strlen(prompt) : 0)
114 while (cspoll(cs, fds, elementsof(fds), timeou
[all...]
H A Dcssend.c25 * send n fds to stream fd
31 cssend(register Cs_t* state, int fd, int* fds, int n) argument
59 if (ioctl(fd, I_SENDFD, FDARG(fds[i])))
84 int fds[OPEN_MAX + 1];
89 if (n >= elementsof(ctl.fds))
122 ctl.fds[0] = i;
124 ctl.fds[i + 1] = fds[i];
136 msg.msg_controllen = (char*)&ctl.fds[n + 1] - (char*)&ctl;
150 close(ctl.fds[
220 _cs_send(int fd, int* fds, int n) argument
[all...]
H A Dcsrecv.c26 * receive up to n fds from stream fd
27 * number of fds received is returned
39 sockrecv(int fd, Csid_t* id, int* fds, int n) argument
47 int fds[OPEN_MAX + 1]; member in struct:__anon338
62 msg.msg_controllen = (char*)&ctl.fds[n] - (char*)&ctl;
67 msg.msg_control = (caddr_t)fds;
68 msg.msg_controllen = n * sizeof(fds[0]);
78 n = (ctl.hdr.cmsg_len - sizeof(ctl.hdr)) / sizeof(fds[0]);
80 fds[fd] = ctl.fds[f
90 csrecv(register Cs_t* state, int fd, Csid_t* id, int* fds, int n) argument
382 _cs_recv(int fd, Csid_t* id, int* fds, int n) argument
[all...]
H A Dcspoll.c25 * poll for read/write/control on fds with ms timeout
44 cspoll(Cs_t* state, Cspoll_t* fds, int num, int ms) argument
74 for (mp = (pp = fds) + num; pp < mp; pp++)
116 for (num = 0, pp = fds; pp < mp; pp++)
156 n = poll(num, fds, ms);
158 n = poll(fds, num, ms);
170 for (mp = (pp = fds) + num, i = n; pp < mp; pp++)
204 _cs_poll(Cspoll_t* fds, int num, int ms)
206 return cspoll(&cs, fds, num, ms);
H A Dcsopen.c371 int fds[2]; local
389 if (pipe(fds))
397 if ((n = ioctl(fds[1], FIOPUSHLD, &conn_ld)) || fmount(3, fds[1], path, 0))
401 if ((n = ioctl(fds[1], I_PUSH, "connld")) || fattach(fds[1], path))
407 close(fds[0]);
408 close(fds[1]);
412 close(fds[1]);
413 fd = fds[
[all...]
/ast/src/cmd/3d/
H A Dpipe3d.c29 pipe3d(int* fds) argument
40 if ((fds[0] = DUP(fd)) >= 0)
42 fds[1] = DUP(fds[0]);
43 CLOSE(fds[1]);
44 CLOSE(fds[0]);
49 r = PIPE(fds);
57 fscall(mp, MSG_pipe, 0, fds);
H A Dlib.c75 int fds[2]; local
79 n = cspipe(&cs, fds);
81 n = pipe(fds);
84 if (!n && fds[1] == TABLE_FD)
87 fds[1] = fds[0];
88 fds[0] = TABLE_FD;
90 CLOSE(fds[0]);
92 n = pipe(fds);
99 if (fds[
[all...]
/ast/src/cmd/3d/features/
H A Dpeek.c38 int fds[2]; local
44 if (pipe(fds) || write(fds[1], msg, sizeof(msg)) != sizeof(msg))
54 if (ioctl(fds[0], I_PEEK, &pk) > 0 && pk.databuf.len == sizeof(msg))
61 if (recv(fds[0], msg, sizeof(msg), MSG_PEEK) == sizeof(msg))
/ast/src/lib/libast/sfio/
H A Dsfpoll.c106 { struct pollfd* fds; local
114 if(!(fds = (struct pollfd*)malloc(m*sizeof(struct pollfd))) )
120 fds[m].fd = f->file;
121 fds[m].events = fds[m].revents = 0;
124 fds[m].events |= POLLOUT;
130 fds[m].fd = f->proc->file;
131 fds[m].revents = 0;
134 fds[m].events |= POLLIN;
138 while((np = SFPOLL(fds,
[all...]
H A Dsfpkrd.c229 { int fds[2], r; local
236 if(recv_peek_pipe == 1 && pipe(fds) < 0)
238 if(recv_peek_pipe == 1 && write(fds[1], tst, 2) != 2)
243 if(recv_peek_pipe == 1 && (r = recv(fds[0], tst, 1, MSG_PEEK)) != 1)
250 if(recv_peek_pipe == 1 && (r = recv(fds[0], tst, 2, MSG_PEEK)) != 2)
255 close(fds[0]);
256 close(fds[1]);
/ast/src/cmd/tests/sfio/
H A Dterrno.c28 int fds[2]; local
65 if(pipe(fds) < 0)
68 if(!(fw = sfnew(fw, NIL(Void_t*), (size_t)SF_UNBOUND, fds[1], SF_WRITE)) )
/ast/src/cmd/coshell/
H A Dcommand.c49 CSPOLL fds[5]; local
74 fds[n].fd = state.indirect.con;
75 fds[n++].events = CS_POLL_READ|CS_POLL_CONNECT;
76 if (fds[n].fd = state.indirect.err)
77 fds[n++].events = CS_POLL_READ;
78 fds[n].fd = state.indirect.out;
79 fds[n++].events = CS_POLL_READ;
81 while (cspoll(fds, n, 0) > 0)
83 if (fds[m].status & CS_POLL_CONNECT)
85 if (n < elementsof(fds)
[all...]
H A Dmain.c240 state.con[fd].info.user.fds[0] = fd;
241 state.con[fd].info.user.fds[1] = -1;
242 state.con[fd].info.user.fds[2] = -1;
291 int fds[5]; local
453 if ((i = csrecv(fd, &id, fds, elementsof(fds))) < 0) /* error */;
460 close(fds[0]);
461 fds[0] = n = fd;
467 csfd(n = fds[0], CS_POLL_READ);
468 fds[
796 int fds[4]; local
[all...]
H A Dshell.c227 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "invalid exec message");
247 if (att) error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s && %s: invalid host", s, att);
248 else error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: invalid host", s);
250 else if (att) error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: invalid host", att);
251 else error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "all hosts closed");
254 if (sp->fd <= 0 && shellopen(sp, con[fd].info.user.fds[2]))
256 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: cannot open", sp->name);
273 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "job table full");
325 sfprintf(state.string, "print '#%05d.%05d'\n", jp - state.job, con[fd].info.user.fds[1]);
331 if (!out && con[fd].info.user.fds[
[all...]
H A Djob.c55 for (i = 0; i < elementsof(state.con[fd].info.user.fds); i++)
56 if ((n = state.con[fd].info.user.fds[i]) != fd && n >= 0 && state.con[n].type)
134 error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "%s: job=%d pid=%d %s", sp->name, jp - state.job, jp->pid, state.migrate);
139 error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "out of space");
146 error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "%s: job=%d pid=%d stopped", sp->name, jp - state.job, jp->pid);
149 error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "%s: job=%d pid=%d is a hog", sp->name, jp - state.job, jp->pid);
160 error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "job %d pid %d restarted on %s", jp - state.job, jp->pid, sp->name);
163 error(ERROR_OUTPUT|2, state.con[jp->fd].info.user.fds[2], "job %d pid %d is no longer hogging %s", jp - state.job, jp->pid, sp->name);
258 if (cswrite(state.con[jp->fd].info.user.fds[0], buf, n) != n)
H A Dservice.h248 short fds[3]; member in struct:__anon62
/ast/src/lib/libcoshell/
H A Dcoexec.c40 int fds[2]; local
53 if (pipe(fds) < 0)
59 for (i = 0; i < elementsof(fds); i++)
60 if (fds[i] < 10 && (j = fcntl(fds[i], F_DUPFD, 10)) >= 0)
62 close(fds[i]);
63 fds[i] = j;
65 cs->fd = fds[1];
66 ops[0] = PROC_FD_DUP(fds[0], 0, PROC_FD_PARENT);
67 ops[1] = PROC_FD_CLOSE(fds[
[all...]
/ast/src/cmd/cs/vcs_src/
H A Difs_network.c41 Cs_poll_t fds; local
56 fds.fd = nFile->socket;
57 fds.events = CS_POLL_READ;
59 rtn = cspoll( &fds, 1, timeout );
80 } else if( fds.status == CS_POLL_READ ) {
82 num = read( fds.fd, nFile->netbuf + nFile->size, num );
/ast/src/cmd/ksh93/sh/
H A Dsubshell.c138 int fds[3]; local
140 fds[2] = 0;
141 sh_pipe(fds);
142 sp->pipefd = fds[0];
146 write(fds[1],sfsetbuf(sfstdout,(Void_t*)sfstdout,0),(size_t)off);
148 if((sh_fcntl(fds[1],F_DUPFD, 1)) != 1)
150 sh_close(fds[1]);
/ast/src/cmd/kshlib/dbm_t/
H A Ddbm_t.c340 int fds[10],n=0; local
384 while((fds[n] = open("/dev/null",NV_RDONLY)) < 10)
392 close(fds[--n]);
/ast/src/lib/libcmd/
H A DMakefile23 comm.c cp.c cut.c dirname.c date.c expr.c fds.c fmt.c fold.c \
/ast/src/cmd/nmake/
H A Dparse.c1909 fds(int details) function
2132 else if (streq(s, "fds"))
2135 fds(1);

Completed in 41 milliseconds