diff options
author | Sevan Janiyan | 2018-09-29 15:49:02 +0200 |
---|---|---|
committer | Karel Zak | 2018-10-03 15:43:45 +0200 |
commit | 671295131e7c88e5ea53b5a045e3244da5ff8207 (patch) | |
tree | 46c9ee3d5677669e1271f21657de4c550d5a10a2 /include | |
parent | include/c: add NAME_MAX compat (diff) | |
download | kernel-qcow2-util-linux-671295131e7c88e5ea53b5a045e3244da5ff8207.tar.gz kernel-qcow2-util-linux-671295131e7c88e5ea53b5a045e3244da5ff8207.tar.xz kernel-qcow2-util-linux-671295131e7c88e5ea53b5a045e3244da5ff8207.zip |
include/ttyutils: define values if missing.
Upstreamed from pkgsrc.
Addresses: https://github.com/karelzak/util-linux/pull/695
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/ttyutils.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/ttyutils.h b/include/ttyutils.h index b3ed4faf1..af979159a 100644 --- a/include/ttyutils.h +++ b/include/ttyutils.h @@ -33,6 +33,34 @@ #define DEF_EOL 0 #define DEF_SWITCH 0 /* default switch char */ +/* Fallback for termios->c_cc[] */ +#ifndef CREPRINT +# define CREPRINT ('r' & 037) +#endif +#ifndef CDISCARD +# define CDISCARD ('o' & 037) +#endif + +/* Default termios->iflag */ +#ifndef TTYDEF_IFLAG +# define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY) +#endif + +/* Default termios->oflag */ +#ifndef TTYDEF_OFLAG +# define TTYDEF_OFLAG (OPOST | ONLCR /*| OXTABS*/) +#endif + +/* Default termios->lflag */ +#ifndef TTYDEF_LFLAG +# define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) +#endif + +/* Default termios->cflag */ +#ifndef TTYDEF_CFLAG +# define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) +#endif + /* Storage for things detected while the login name was read. */ struct chardata { int erase; /* erase character */ @@ -115,6 +143,12 @@ static inline void reset_virtual_console(struct termios *tp, int flags) #ifndef FFDLY # define FFDLY 0 #endif +#ifndef TAB0 +# define TAB0 0 +#endif +#ifndef TABDLY +# define TABDLY 0 +#endif tp->c_iflag |= (BRKINT | ICRNL | IMAXBEL); tp->c_iflag &= ~(IGNBRK | INLCR | IGNCR | IXOFF | IUCLC | IXANY | ISTRIP); |