Remove some problematic APIs

In order to improve our chances of success building other open source
projects we shouldn't define APIs that'll lead any ./configure script
astray. For example:

- brk() and sbrk() can break mac/windows support
- syscall() is a superb way to break portability
- arch_prctl() is the greatest of all horror shows
This commit is contained in:
Justine Tunney 2023-06-08 06:12:26 -07:00
parent 7512318a2a
commit 32682f0ce7
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
24 changed files with 37 additions and 919 deletions

View file

@ -21,7 +21,6 @@
#include "libc/intrin/kprintf.h"
#include "libc/intrin/weaken.h"
#include "libc/macros.internal.h"
#include "libc/runtime/brk.internal.h"
#include "libc/runtime/memtrack.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/winargs.internal.h"
@ -29,11 +28,6 @@
#define UNSHADOW(x) ((int64_t)(MAX(0, (x)-0x7fff8000)) << 3)
#define FRAME(x) ((int)((x) >> 16))
forceinline pureconst bool IsBrkFrame(int x) {
unsigned char *p = (unsigned char *)ADDR_32_TO_48(x);
return _weaken(__brk) && p >= _end && p < _weaken(__brk)->p;
}
static const char *GetFrameName(int x) {
if (!x) {
return "null";
@ -47,8 +41,6 @@ static const char *GetFrameName(int x) {
return "arena";
} else if (IsStaticStackFrame(x)) {
return "stack";
} else if (IsBrkFrame(x)) {
return "brk";
} else if (IsGfdsFrame(x)) {
return "g_fds";
} else if (IsZiposFrame(x)) {