mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 15:03:34 +00:00
This change fixes an issue with the tcflow() magic numbers that was causing bash to freeze up on Linux. While auditing termios polyfills, several other issues were identified with XNU/BSD compatibility. Out of an abundance of caution this change undefines as much surface area from libc/calls/struct/termios.h as possible, so that autoconf scripts are less likely to detect non-POSIX teletypewriter APIs that haven't been polyfilled by Cosmopolitan. This is a *breaking change* for your static archives in /opt/cosmos if you use the cosmocc toolchain. That's because this change disables the ioctl() undiamonding trick for code outside the monorepo, specifically because it'll lead to brittle ABI breakages like this. If you're using the cosmocc toolchain, you'll need to rebuild libraries like ncurses, readline, etc. Yes diamonds cause bloat. To work around that, consider using tcgetwinsize() instead of ioctl(TIOCGWINSZ) since it'll help you avoid pulling every single ioctl-related polyfill into the linkage. The cosmocc script was specifying -DNDEBUG for some reason. It's fixed.
34 lines
987 B
C
34 lines
987 B
C
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_PTY_H_
|
|
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_PTY_H_
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
COSMOPOLITAN_C_START_
|
|
|
|
extern const int TIOCPKT;
|
|
extern const int TIOCPKT_DATA;
|
|
extern const int TIOCPKT_DOSTOP;
|
|
extern const int TIOCPKT_FLUSHREAD;
|
|
extern const int TIOCPKT_FLUSHWRITE;
|
|
extern const int TIOCPKT_IOCTL;
|
|
extern const int TIOCPKT_NOSTOP;
|
|
extern const int TIOCPKT_START;
|
|
extern const int TIOCPKT_STOP;
|
|
extern const int TIOCSPTLCK;
|
|
|
|
#define TIOCPKT_DATA 0x00
|
|
#define TIOCPKT_DOSTOP 0x01
|
|
#define TIOCPKT_FLUSHREAD 0x02
|
|
#define TIOCPKT_FLUSHWRITE 0x04
|
|
#define TIOCPKT_IOCTL 0x08
|
|
#define TIOCPKT_NOSTOP 0x10
|
|
#define TIOCPKT_START 0x20
|
|
#define TIOCPKT_STOP 0x40
|
|
|
|
#define TIOCPKT TIOCPKT
|
|
#define TIOCSPTLCK TIOCSPTLCK
|
|
|
|
#define __tmpcosmo_TIOCPKT -1036987649
|
|
#define __tmpcosmo_TIOCSPTLCK 372918192
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_PTY_H_ */
|