get console compiling on netbsd
This commit is contained in:
parent
85554b62a8
commit
ea29d3bce6
|
@ -1,6 +1,10 @@
|
||||||
#undef _POSIX_C_SOURCE
|
#undef _POSIX_C_SOURCE
|
||||||
#define _POSIX_C_SOURCE 200112L
|
#define _POSIX_C_SOURCE 200112L
|
||||||
|
|
||||||
|
#ifdef __NetBSD__
|
||||||
|
#define _NETBSD_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -16,6 +20,7 @@
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#ifdef __NetBSD__
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/termios.h>
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -225,7 +230,7 @@ host_raw_tty()
|
||||||
/* corresponds to `stty raw -echo` */
|
/* corresponds to `stty raw -echo` */
|
||||||
term.c_cflag |= (CS8);
|
term.c_cflag |= (CS8);
|
||||||
term.c_iflag &= ~(IGNBRK | BRKINT | IGNPAR | PARMRK | INPCK | ISTRIP);
|
term.c_iflag &= ~(IGNBRK | BRKINT | IGNPAR | PARMRK | INPCK | ISTRIP);
|
||||||
term.c_iflag &= ~(INLCR | IGNCR | ICRNL | IXON | IXOFF | IUCLC | IXANY | IMAXBEL);
|
term.c_iflag &= ~(INLCR | IGNCR | ICRNL | IXON | IXOFF | IXANY | IMAXBEL);
|
||||||
term.c_lflag &= ~(ICANON | ISIG | ECHO);
|
term.c_lflag &= ~(ICANON | ISIG | ECHO);
|
||||||
term.c_oflag &= ~(OPOST);
|
term.c_oflag &= ~(OPOST);
|
||||||
term.c_cc[VMIN] = 0;
|
term.c_cc[VMIN] = 0;
|
||||||
|
|
Loading…
Reference in New Issue