Incorporate more small improvements

This commit is contained in:
Justine Tunney 2023-07-23 10:57:18 -07:00
parent 1d4eb08fa1
commit f83eb440f7
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
20 changed files with 121 additions and 256 deletions

View file

@ -51,6 +51,7 @@
#include "libc/runtime/internal.h"
#include "libc/runtime/memtrack.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/symbols.internal.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/o.h"
@ -349,14 +350,20 @@ textwindows int sys_fork_nt(uint32_t dwCreationFlags) {
}
} else {
rc = 0;
// re-apply code morphing for thread-local storage
if (tib && _weaken(__set_tls) && _weaken(__morph_tls)) {
_weaken(__set_tls)(tib);
_weaken(__morph_tls)();
__tls_enabled_set(true);
}
// re-apply code morphing for synchronization nops
if (threaded && !__threaded && _weaken(__enable_threads)) {
_weaken(__enable_threads)();
}
// re-apply code morphing for function tracing
if (ftrace_stackdigs) {
_weaken(__hook)(_weaken(ftrace_hook), _weaken(GetSymbolTable)());
}
}
if (untrackpid != -1) {
__releasefd(untrackpid);