Add siglongjmp() for aarch64

This commit is contained in:
Justine Tunney 2023-09-21 10:10:20 -07:00
parent c88f95a892
commit 22cf6e11eb
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
13 changed files with 34 additions and 49 deletions

View file

@ -214,10 +214,12 @@ static textwindows int ProcessKeyEvent(const struct NtInputRecord *r, char *p) {
}
// handle ctrl-d the end of file keystroke
if (c == __veof && __veof != _POSIX_VDISABLE) {
STRACE("encountered CTRL(%#c) c_cc[VEOF] closing console input", CTRL(c));
__keystroke.end_of_file = true;
return 0;
if (!(__ttymagic & kFdTtyUncanon)) {
if (c == __veof && __veof != _POSIX_VDISABLE) {
STRACE("encountered CTRL(%#c) c_cc[VEOF] closing console input", CTRL(c));
__keystroke.end_of_file = true;
return 0;
}
}
// insert esc prefix when alt is held

View file

@ -53,8 +53,8 @@ int setpgid(int pid, int pgid) {
rc = __winerr();
}
} else {
// irregular use cases not supported on windows
rc = einval();
// avoid bash printing scary warnings for now
rc = 0;
}
}
STRACE("setpgid(%d, %d) → %d% m", pid, pgid, rc);

View file

@ -21,7 +21,7 @@ COSMOPOLITAN_C_START_
#define kFdTtyEchoing 1 /* read()→write() (ECHO && !ICANON) */
#define kFdTtyEchoRaw 2 /* don't ^X visualize control codes */
#define kFdTtyMunging 4 /* enable input / output remappings */
#define kFdTtyUncanon 4 /* enables non-canonical (raw) mode */
#define kFdTtyNoCr2Nl 8 /* don't map \r → \n (a.k.a !ICRNL) */
#define kFdTtyNoIsigs 16
#define kFdTtyNoBlock 32

View file

@ -95,7 +95,7 @@ textwindows int tcgetattr_nt(int fd, struct termios *tio) {
if (!(__ttymagic & kFdTtyNoIsigs)) {
tio->c_lflag |= ISIG;
}
if ((inmode & kNtEnableProcessedInput) || (__ttymagic & kFdTtyMunging)) {
if (inmode & kNtEnableProcessedInput) {
tio->c_lflag |= IEXTEN;
}

View file

@ -67,7 +67,7 @@ textwindows int tcsetattr_nt(int fd, int opt, const struct termios *tio) {
}
if (opt == TCSAFLUSH) {
tcflush(fd, TCIFLUSH);
FlushConsoleInputBytes(hInput);
}
inmode &= ~(kNtEnableLineInput | kNtEnableEchoInput |
kNtEnableProcessedInput | kNtEnableVirtualTerminalInput);
@ -78,7 +78,7 @@ textwindows int tcsetattr_nt(int fd, int opt, const struct termios *tio) {
kNtEnableLineInput | kNtEnableProcessedInput | kNtEnableQuickEditMode;
} else {
inmode &= ~kNtEnableQuickEditMode;
__ttymagic |= kFdTtyMunging;
__ttymagic |= kFdTtyUncanon;
if (!tio->c_cc[VMIN]) {
__ttymagic |= kFdTtyNoBlock;
}