mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +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
|
@ -50,12 +50,12 @@ static struct timespec vflogf_ts;
|
|||
static void vflogf_onfail(FILE *f) {
|
||||
errno_t err;
|
||||
int64_t size;
|
||||
struct stat st;
|
||||
if (IsTiny()) return;
|
||||
err = ferror_unlocked(f);
|
||||
if (fileno_unlocked(f) != -1 &&
|
||||
(err == ENOSPC || err == EDQUOT || err == EFBIG) &&
|
||||
((size = getfiledescriptorsize(fileno_unlocked(f))) == -1 ||
|
||||
size > kNontrivialSize)) {
|
||||
(fstat(fileno_unlocked(f), &st) == -1 || st.st_size > kNontrivialSize)) {
|
||||
ftruncate(fileno_unlocked(f), 0);
|
||||
fseeko_unlocked(f, SEEK_SET, 0);
|
||||
f->beg = f->end = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue