Get LIBC_MEM and LIBC_STDIO building with aarch64

This commit is contained in:
Justine Tunney 2023-05-09 08:08:56 -07:00
parent ae0ee59614
commit d04430f4ef
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
81 changed files with 440 additions and 1064 deletions

View file

@ -18,6 +18,7 @@
*/
#include "libc/calls/calls.h"
#include "libc/errno.h"
#include "libc/mem/mem.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/internal.h"
#include "libc/stdio/stdio.h"
@ -26,7 +27,8 @@
int __fflush_impl(FILE *f) {
size_t i;
ssize_t rc;
free_s(&f->getln);
free(f->getln);
f->getln = 0;
if (f->beg && !f->end && (f->iomode & O_ACCMODE) != O_RDONLY) {
for (i = 0; i < f->beg; i += rc) {
if ((rc = write(f->fd, f->buf + i, f->beg - i)) == -1) {