Lines Matching +full:wake +full:- +full:up
31 * -i <device instance>
32 * VCC device instance to use, e.g. virtual-console-concentrator@0.
34 * -p <ip address>
36 * -d
38 * -t timeout for inactivity 0 = indefinite
39 * -A enable Authorization checking. Mutually exclusive with -p.
64 #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
76 #define VNTSD_INVALID_LISTEN_ADDR ((in_addr_t)-1)
92 if (thr_self() != vntsdp->tid) { in exit_sig_handler()
94 (void) thr_kill(vntsdp->tid, sig); in exit_sig_handler()
102 * it can be waken up if a client does not access the connection for
112 if (vntsdp->timeout == 0) { in vntsd_attach_timer()
116 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_attach_timer()
117 rv = vntsd_que_append(&vntsdp->tmoq, (void *)tmop); in vntsd_attach_timer()
118 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_attach_timer()
128 if (vntsdp->timeout == 0) { in vntsd_detach_timer()
132 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_detach_timer()
133 rv = vntsd_que_rm(&vntsdp->tmoq, (void *)tmop); in vntsd_detach_timer()
134 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_detach_timer()
143 tmop->minutes++; in chk_timeout()
145 if (tmop->minutes == vntsdp->timeout) { in chk_timeout()
146 /* wake up the thread */ in chk_timeout()
147 tmop->clientp->status |= VNTSD_CLIENT_TIMEOUT; in chk_timeout()
148 (void) thr_kill(tmop->tid, SIGALRM); in chk_timeout()
162 if (tmop->tid == tid) { in reset_timeout()
163 tmop->minutes = 0; in reset_timeout()
172 if (vntsdp->timeout == 0) { in vntsd_reset_timer()
176 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_reset_timer()
177 (void) vntsd_que_find(vntsdp->tmoq, reset_timeout, in vntsd_reset_timer()
179 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_reset_timer()
183 * When alarm goes off, wake up timeout threads. Alarm is set off every
192 if (vntsdp->timeout == 0) { in vntsd_alarm_sig_handler()
208 (void) mutex_lock(&vntsdp->tmo_lock); in vntsd_alarm_sig_handler()
210 /* wake up timeout threads */ in vntsd_alarm_sig_handler()
211 (void) vntsd_que_walk(vntsdp->tmoq, (el_func_t)chk_timeout); in vntsd_alarm_sig_handler()
212 (void) mutex_unlock(&vntsdp->tmo_lock); in vntsd_alarm_sig_handler()
238 (void) mutex_lock(&vntsdp->lock); in vntsd_exit()
240 if (vntsdp->timeout > 0) { in vntsd_exit()
245 vntsd_free_que(&vntsdp->grouppq, (clean_func_t)vntsd_clean_group); in vntsd_exit()
248 (void) close(vntsdp->ctrl_fd); in vntsd_exit()
250 assert(vntsdp->tmoq == NULL); in vntsd_exit()
251 (void) mutex_unlock(&vntsdp->lock); in vntsd_exit()
253 /* clean up vntsdp */ in vntsd_exit()
254 (void) mutex_destroy(&vntsdp->tmo_lock); in vntsd_exit()
255 (void) mutex_destroy(&vntsdp->lock); in vntsd_exit()
267 (void) fprintf(stderr, gettext("Usage: vntsd -i <VCC device instance> " in vntsd_help()
268 "[-p <listen address>] [-t <timeout in minutes>] [-A]\n")); in vntsd_help()
292 if ((int)(addr = inet_addr(listen_addr)) == -1) in get_listen_ip_addr()
309 sa = (struct sockaddr_in *)infop->ai_addr; in get_listen_ip_addr()
310 if (sa->sin_addr.s_addr == addr) { in get_listen_ip_addr()
315 infop = infop->ai_next; in get_listen_ip_addr()
362 (void) enable_extended_FILE_stdio(-1, -1); in main()
370 vntsdp->ctrl_fd = -1; in main()
371 vntsdp->devinst = NULL; in main()
373 (void) mutex_init(&vntsdp->lock, USYNC_THREAD|LOCK_ERRORCHECK, NULL); in main()
374 (void) mutex_init(&vntsdp->tmo_lock, USYNC_THREAD|LOCK_ERRORCHECK, in main()
382 vntsdp->options |= VNTSD_OPT_DAEMON_OFF; in main()
386 vntsdp->devinst = optarg; in main()
393 n = sscanf(optarg, "%d", &(vntsdp->timeout)); in main()
395 vntsdp->timeout = -1; in main()
409 * connect to vntsd. The '-p' option if specified while in main()
414 vntsdp->options |= VNTSD_OPT_AUTH_CHECK; in main()
423 if ((vntsdp->devinst == NULL) || (vntsdp->timeout == -1)) { in main()
432 vntsdp->ip_addr.s_addr = htonl(INADDR_LOOPBACK); in main()
433 } else if ((vntsdp->options & VNTSD_OPT_AUTH_CHECK) != 0) { in main()
437 vntsdp->ip_addr.s_addr = htonl(INADDR_LOOPBACK); in main()
439 vntsdp->ip_addr.s_addr = htonl(INADDR_ANY); in main()
441 vntsdp->ip_addr.s_addr = get_listen_ip_addr(listen_addr); in main()
442 if (vntsdp->ip_addr.s_addr == VNTSD_INVALID_LISTEN_ADDR) { in main()
451 vntsdp->options, vntsdp->devinst, in main()
455 sz = strlen(VCC_DEVICE_CTL_PATH) + strlen(vntsdp->devinst) + 1; in main()
461 (void) snprintf(path, sz-1, VCC_DEVICE_CTL_PATH, vntsdp->devinst, in main()
462 sizeof (vntsdp->devinst)); in main()
463 vntsdp->ctrl_fd = open(path, O_RDWR); in main()
465 if (vntsdp->ctrl_fd == -1) { in main()
476 if ((vntsdp->options & VNTSD_OPT_DAEMON_OFF) == 0) { in main()
495 for (i = 3; i < vntsdp->ctrl_fd; i++) { in main()
498 closefrom(vntsdp->ctrl_fd + 1); in main()
525 /* set up signal handlers */ in main()
556 if (vntsdp->timeout > 0) { in main()
560 vntsdp->tid = thr_self(); in main()
569 poll_drv[0].fd = vntsdp->ctrl_fd; in main()
572 if (poll(poll_drv, 1, -1) == -1) { in main()
574 /* wake up because a consle was deleted */ in main()
588 * Main thread may miss a console-delete signal when it is in main()
603 return (vntsdp->ip_addr); in vntsd_ip_addr()
629 if (ioctl(vntsdp->ctrl_fd, ioctl_code, (caddr_t)buf)) { in vntsd_vcc_ioctl()
639 * wake up main thread to cleanup the console.
647 groupp = consp->group; in vntsd_vcc_err()
650 if (consp->status & VNTSD_CONS_DELETED) { in vntsd_vcc_err()
661 (void) mutex_lock(&consp->lock); in vntsd_vcc_err()
662 consp->status |= VNTSD_CONS_DELETED; in vntsd_vcc_err()
668 (void) mutex_unlock(&consp->lock); in vntsd_vcc_err()
671 (void) mutex_lock(&groupp->lock); in vntsd_vcc_err()
672 groupp->status |= VNTSD_GROUP_CLEAN_CONS; in vntsd_vcc_err()
673 (void) mutex_unlock(&groupp->lock); in vntsd_vcc_err()
676 (void) thr_kill(vntsdp->tid, SIGUSR1); in vntsd_vcc_err()