Skip to content

Commit

Permalink
i#2154 Android64: Fix write syscall in nolibc_print()
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 committed Jan 15, 2025
1 parent 51ccee3 commit 6386b83
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion suite/tests/tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,10 @@ nolibc_print(const char *str)
SYS_write,
# endif
3,
# if defined(MACOS) || defined(ANDROID)
# if defined(MACOS)
stderr->_file,
# elif defined(ANDROID)
STDERR_FILENO,
# else
stderr->_fileno,
# endif
Expand Down

0 comments on commit 6386b83

Please sign in to comment.