Skip to content

Commit

Permalink
i#2154 Android64: Fix write syscall in nolibc_print() (#7190)
Browse files Browse the repository at this point in the history
Current versions of Android make the FILE struct opaque so we can't
access its members to get the file descriptor for stderr. Instead we can
use STDERR_FILENO from unistd.h.

Issue: #1874, #2154
  • Loading branch information
jackgallagher-arm authored Jan 17, 2025
1 parent fe1fb42 commit d3a91d6
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions suite/tests/tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,7 @@ nolibc_print(const char *str)
# else
SYS_write,
# endif
3,
# if defined(MACOS) || defined(ANDROID)
stderr->_file,
/* TODO i#1973: handle opaque FILE * on musl libc */
# elif defined(MUSL)
STDERR_FILENO,
# else
stderr->_fileno,
# endif
str, nolibc_strlen(str));
3, STDERR_FILENO, str, nolibc_strlen(str));
}

/* Safe print int syscall.
Expand Down

0 comments on commit d3a91d6

Please sign in to comment.