Lines Matching refs:fd
195 int fd = open(rdc_devr, O_RDONLY);
197 if (fd < 0)
200 return (rdc_fdr = fd);
220 int fd;
232 fd = t_open(nconf->nc_device, O_RDWR, (struct t_info *)NULL);
233 if (fd == -1) {
237 fd = t_open(nconf->nc_device, O_RDWR, NULL);
239 if (fd == -1) {
254 if (ioctl(fd, I_POP, 0) < 0) {
256 if (t_close(fd) == -1) {
258 syslog(LOG_ERR, "t_close failed on %d: %m", fd);
261 fd, t_errlist[t_errno]);
271 if (ioctl(fd, I_PUSH, "rpcmod") < 0) {
273 (void) t_close(fd);
277 if (ioctl(fd, I_PUSH, "rpcmod") < 0) {
279 if (t_close(fd) == -1) {
282 "t_close failed on %d: %m", fd);
286 fd, t_errlist[t_errno]);
297 if (ioctl(fd, I_STR, &strioc) < 0) {
299 if (t_close(fd) == -1) {
302 "t_close failed on %d: %m", fd);
306 fd, t_errlist[t_errno]);
317 if (ioctl(fd, I_PUSH, "timod") < 0) {
319 if (t_close(fd) == -1) {
321 syslog(LOG_ERR, "t_close failed on %d: %m", fd);
324 fd, t_errlist[t_errno]);
330 return (fd);
335 rdcd_log_tli_error(char *tli_name, int fd, struct netconfig *nconf)
346 tli_name, fd, nconf->nc_proto);
350 tli_name, fd, nconf->nc_proto, t_errno);
681 reuseaddr(int fd)
706 if (t_optmgmt(fd, &req, &resp) < 0 || resp.flags != T_SUCCESS) {
778 poll_array[i].fd, i);
781 poll_array[i].fd, i);
795 poll_array[i].fd,
797 (void) t_close(poll_array[i].fd);
798 remove_from_poll_list(poll_array[i].fd);
813 add_to_poll_list(int fd, struct netconfig *nconf)
865 poll_array[num_fds].fd = fd;
879 if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) {
894 remove_from_poll_list(int fd)
900 if (poll_array[i].fd == fd) {
916 syslog(LOG_ERR, "attempt to remove nonexistent fd from poll list");
923 int fd;
938 num_conns, poll_array[i1].fd);
941 num_conns, poll_array[i1].fd);
943 fd = poll_array[i1].fd;
949 (void) t_snddis(fd, (struct t_call *)0);
951 remove_from_poll_list(fd);
952 (void) t_close(fd);
959 if (t_sndrel(fd) == 0)
965 conn_get(int fd, struct netconfig *nconf, struct conn_ind **connp)
977 conn->conn_call = (struct t_call *)t_alloc(fd, T_CALL, T_ALL);
980 rdcd_log_tli_error("t_alloc", fd, nconf);
984 if (t_listen(fd, conn->conn_call) == -1) {
985 rdcd_log_tli_error("t_listen", fd, nconf);
998 (void) t_snddis(fd, conn->conn_call);
1018 discon_get(int fd, struct netconfig *nconf, struct conn_ind **connp)
1025 if (t_rcvdis(fd, &discon) == -1) {
1026 rdcd_log_tli_error("t_rcvdis", fd, nconf);
1055 cots_listen_event(int fd, int conn_index)
1067 (void) conn_get(fd, nconf, &conn_head);
1097 (void) t_snddis(fd, call);
1108 (void) t_snddis(fd, call);
1114 while (t_accept(fd, new_fd, call) == -1) {
1116 rdcd_log_tli_error("t_accept", fd, nconf);
1118 (void) t_snddis(fd, call);
1123 while (event = t_look(fd)) {
1126 (void) conn_get(fd, nconf, &conn_head);
1130 (void) discon_get(fd, nconf,
1140 (void) t_snddis(fd, call);
1186 do_poll_cots_action(int fd, int conn_index)
1196 while (event = t_look(fd)) {
1199 cots_listen_event(fd, conn_index);
1206 i1 = t_rcv(fd, buf, sizeof (buf), &flags);
1226 (void) t_snddis(fd, (struct t_call *)0);
1236 if (t_sndrel(fd) == -1) {
1248 if (t_rcvrel(fd) == 0) {
1249 /* T_ORDREL on listen fd's should be ignored */
1250 if (!is_listen_fd_index(fd)) {
1251 (void) t_sndrel(fd);
1259 rdcd_log_tli_error("t_rcvrel", fd, nconf);
1262 * listen fd
1264 if (!is_listen_fd_index(fd))
1271 if (t_rcvdis(fd, (struct t_discon *)NULL) == -1)
1272 rdcd_log_tli_error("t_rcvdis", fd, nconf);
1275 * T_DISCONNECT on listen fd's should be ignored.
1277 if (!is_listen_fd_index(fd))
1297 event, nconf->nc_proto, fd, errorstr);
1302 remove_from_poll_list(fd);
1303 (void) t_close(fd);
1317 do_poll_clts_action(int fd, int conn_index)
1351 if (oldfd != fd) {
1352 oldfd = fd;
1369 unitdata = (struct t_unitdata *)t_alloc(fd, T_UNITDATA, T_ALL);
1382 fd, nconf->nc_proto);
1387 fd, nconf->nc_proto, t_errno);
1409 ret = t_rcvudata(fd, unitdata, &flags);
1413 fd, nconf->nc_proto, unitdata->udata.len);
1439 fd, nconf->nc_proto);
1446 fd, nconf->nc_proto, t_errno);
1450 ret = t_look(fd);
1468 fd, nconf->nc_proto);
1473 fd, nconf->nc_proto, t_errno);
1480 fd, nconf->nc_proto, ret, T_UDERR);
1485 uderr = (struct t_uderr *)t_alloc(fd, T_UDERROR, T_ALL);
1498 fd, nconf->nc_proto);
1503 fd, nconf->nc_proto, t_errno);
1508 ret = t_rcvuderr(fd, uderr);
1526 progname, fd, nconf->nc_proto);
1582 fd, nconf->nc_proto);
1587 fd, nconf->nc_proto, t_errno);
1595 * and one isn't present, that is all right, because fd is in
1600 fd, nconf->nc_proto);
1612 ret = getmsg(fd, ctl, data, &flags);
1624 rdcsvc(int fd, struct netbuf addrmask, struct netconfig *nconf)
1633 nsa.fd = fd;
1683 int fd;
1691 if ((fd = rdc_transport_open(nconf)) == -1) {
1704 (void) t_close(fd);
1717 if (reuseaddr(fd) == -1) {
1729 ntb = (struct t_bind *)t_alloc(fd, T_BIND, T_ALL);
1732 (void) t_close(fd);
1739 if (t_bind(fd, &tb, ntb) == -1) {
1743 (void) t_close(fd);
1753 (void) t_close(fd);
1784 if (t_optmgmt(fd, &req, &resp) < 0 ||
1792 return (fd);
1829 * For listen fd's index is always less than end_listen_fds.
1849 set_addrmask(int fd, struct netconfig *nconf, struct netbuf *mask)
1856 if (t_getinfo(fd, &info) < 0) {