2 * Tiny test program for the `spawn console' key
3 * (should not use signal; should not use sleep)
13 #include <sys/ioctl.h>
19 sighup(int n __attribute__ ((unused))) {
20 if (system("openvt -s -l -- login -h spawn") == -1) {
24 signal(SIGHUP, sighup);
31 fd = open("/dev/tty0", 0);
32 if (fd < 0 && errno == ENOENT)
33 fd = open("/dev/vc/0", 0);
36 signal(SIGHUP, sighup);
37 ioctl(fd, KDSIGACCEPT, (long) SIGHUP);