Lines Matching defs:fds

49 	CSPOLL	fds[5];
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) && csrecv(fds[m].fd, NiL, &x, 1) == 1)
88 fds[n].fd = x;
89 fds[n].status = 0;
90 fds[n++].events = CS_POLL_READ;
93 else if (fds[m].status & CS_POLL_READ)
95 if (x = svc.pass[fds[m].fd])
97 if ((c = read(fds[m].fd, cmd, sizeof(cmd))) > 0)
101 close(fds[m].fd);
102 fds[m].events = 0;
105 else if (csread(fds[m].fd, cmd, 7, CS_EXACT) == 7 && cmd[0] == '#')
106 svc.pass[fds[m].fd] = (int)strtol(cmd + 1, NiL, 10);
109 close(fds[m].fd);
110 fds[m].events = 0;
114 if (fds[i].events)
115 close(fds[i].fd);
392 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: invalid host name", s);
402 if (!(sp = search(GET, s, NiL, NiL))) error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: not found", s);
403 else if (!sp->fd) error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: host not open", s);
404 else shellclose(sp, con[fd].info.user.fds[2]);
421 message((error_info.trace, "level=%d output=%s", -arg, dat ? dat : cspath(state.indirect.con ? 2 : con[fd].info.user.fds[2], 0)));
435 dup(con[fd].info.user.fds[2]);
471 if (con[n].info.user.fds[0] == n) sfprintf(state.string, "%3d query %-3d %-3d %s\n", n, con[n].info.user.fds[1], con[n].info.user.fds[2], (sp = con[n].info.user.home) ? sp->name : "");
472 else sfprintf(state.string, "%3d user %-3d %-3d %-3d %s\n", n, con[n].info.user.fds[0], con[n].info.user.fds[1], con[n].info.user.fds[2], (sp = con[n].info.user.home) ? sp->name : "");
491 else if (arg >= state.fdtotal || !con[arg].type) error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "cannot drop CON %d", arg);
602 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "job id required");
604 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%d: invalid job id", arg);
625 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%c: invalid signal id", sub);
654 if (!(sp = search(NEW, s, NiL, NiL))) error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: invalid host name", s);
655 else if (sp->fd) error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%s: host already open", s);
656 else shellopen(sp, con[fd].info.user.fds[2]);
799 sfprintf(state.string, "%3d%6d%5d%6d %-28s %s\n", n, con[n].info.user.pid, con[n].info.user.running, con[n].info.user.total, cspath(con[n].info.user.fds[2], 0), con[n].info.user.attr.label);
808 error(ERROR_OUTPUT|2, con[fd].info.user.fds[2], "%c: unknown server op", op);
812 cswrite(con[fd].info.user.fds[1], sfstrseek(state.string, 0, SEEK_SET), n);