Fix BSD regressions

The recent change to crt.S that aggressively aligns the system-provided
stack has been rolled back on non-Linux until we can find a better way,
since it can cause a segfault early in execution on several platforms.

This change fixes a regression in tcgetattr() and tcsetattr() on OpenBSD
and NetBSD caused by 4778cd4d27.

This change has been tested across the runitd test fleet which is green.
This commit is contained in:
Justine Tunney 2023-07-01 00:17:33 -07:00
parent 5a77db2cd5
commit 053681cb97
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 34 additions and 37 deletions

View file

@ -73,12 +73,6 @@ extern const uint32_t TAB1;
extern const uint32_t TAB2;
extern const uint32_t TAB3;
extern const uint32_t TABDLY;
extern const int TCIFLUSH;
extern const int TCIOFLUSH;
extern const int TCOFLUSH;
extern const int TCSADRAIN;
extern const int TCSAFLUSH;
extern const int TCSANOW;
extern const uint64_t TIOCCONS;
extern const uint64_t TIOCGETD;
extern const uint64_t TIOCGWINSZ;
@ -116,11 +110,6 @@ extern const uint32_t XCASE;
extern const uint32_t XTABS;
extern const uint32_t CRTSCTS;
#define TCOOFF 0
#define TCOON 1
#define TCIOFF 2
#define TCION 3
#define BRKINT 0x02
#define ICRNL 0x0100
#define IGNBRK 0x01
@ -202,12 +191,6 @@ extern const uint32_t CRTSCTS;
#define PARENB PARENB
#define PARODD PARODD
#define PENDIN PENDIN
#define TCIFLUSH TCIFLUSH
#define TCIOFLUSH TCIOFLUSH
#define TCOFLUSH TCOFLUSH
#define TCSADRAIN 1
#define TCSAFLUSH 2
#define TCSANOW 0
#define TIOCCONS TIOCCONS
#define TIOCGETD TIOCGETD
#define TIOCGWINSZ TIOCGWINSZ
@ -240,8 +223,26 @@ extern const uint32_t CRTSCTS;
#define VWERASE VWERASE
#define XCASE XCASE
/* tcsetattr() */
#define TCSANOW 0
#define TCSAFLUSH 2
#define TCSADRAIN 1
extern const unsigned long TCGETS; /* use tcgetattr() */
extern const unsigned long TCSETS; /* use tcsetattr() */
/* tcflush() */
extern const int TCIFLUSH;
extern const int TCOFLUSH;
extern const int TCIOFLUSH;
#define TCIFLUSH TCIFLUSH
#define TCOFLUSH TCOFLUSH
#define TCIOFLUSH TCIOFLUSH
/* tcflow() */
#define TCOOFF 0
#define TCOON 1
#define TCIOFF 2
#define TCION 3
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */