Make improvements for Actually Portable Emacs

- Get SIGWINCH working again on the New Technology
- Correctly handle O_NOFOLLOW in open() on Windows
- Implement synthetic umask() functionality on Windows
- Do a better job managing file execute access on Windows
- Fill in `st_uid` and `st_gid` with username hash on Windows
- Munge UNICODE control pictures into control codes on Windows
- Do a better job ensuring Windows console settings are restored
- Introduce KPRINTF_LOG environment variable to log kprintf to a file
This commit is contained in:
Justine Tunney 2023-08-19 06:41:06 -07:00
parent 9c7b81ee0f
commit 965516e313
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
108 changed files with 1126 additions and 807 deletions

View file

@ -67,11 +67,6 @@ extern char ape_stack_prot[] __attribute__((__weak__));
extern pthread_mutex_t __mmi_lock_obj;
extern int hostos asm("__hostos");
void cosmo2(int, char **, char **, unsigned long *) wontreturn;
void __switch_stacks(int, char **, char **, unsigned long *,
void (*)(int, char **, char **, unsigned long *),
void *) wontreturn;
static const char *DecodeMagnum(const char *p, long *r) {
int k = 0;
unsigned long c, x = 0;
@ -96,6 +91,15 @@ wontreturn textstartup void cosmo(long *sp, struct Syslib *m1) {
unsigned long *auxv = (unsigned long *)(sp + 1 + argc + 1);
while (*auxv++) donothing;
// set helpful globals
__argc = argc;
__argv = argv;
__envp = envp;
__auxv = auxv;
environ = envp;
program_invocation_name = argv[0];
__oldstack = (intptr_t)sp;
// detect apple m1 environment
char *magnums;
if (SupportsXnu() && (__syslib = m1)) {
@ -134,16 +138,7 @@ wontreturn textstartup void cosmo(long *sp, struct Syslib *m1) {
sys_sigaction(SIGSYS, act, 0, 8, 0);
}
// set helpful globals
__argc = argc;
__argv = argv;
__envp = envp;
__auxv = auxv;
environ = envp;
program_invocation_name = argv[0];
// needed by kisdangerous()
__oldstack = (intptr_t)sp;
__pid = sys_getpid().ax;
// initialize memory manager