mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +00:00
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:
parent
7512318a2a
commit
32682f0ce7
24 changed files with 37 additions and 919 deletions
|
@ -51,7 +51,7 @@ static struct SymbolTable *OpenSymbolTableImpl(const char *filename) {
|
|||
ptrdiff_t names_offset, name_base_offset, stp_offset;
|
||||
map = MAP_FAILED;
|
||||
if ((fd = open(filename, O_RDONLY)) == -1) return 0;
|
||||
if ((filesize = getfiledescriptorsize(fd)) == -1) goto SystemError;
|
||||
if ((filesize = lseek(fd, 0, SEEK_END)) == -1) goto SystemError;
|
||||
if (filesize > INT_MAX) goto RaiseE2big;
|
||||
if (filesize < 64) goto RaiseEnoexec;
|
||||
elf = map = mmap(0, filesize, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue