[PATCH 3/5] Bionic lacks ttyname_r; provide a workaround

Matt Whitlock busybox at mattwhitlock.name
Fri Apr 24 19:10:06 UTC 2015


On Friday, 24 April 2015, at 1:04 pm, walter harms wrote:
> perhaps it is better to move the code to missing_syscalls.c ?
> (this is a question)

The reason I didn't put it there is that ttyname_r() is defined in Bionic, but it's a stub that prints out a diagnostic message at runtime and returns -1 unconditionally, thereby causing xmalloc_ttyname() to fail, even when the specified file descriptor does refer to a TTY.

I'll provide an alternative patch that places the workaround in missing_syscalls.c since I can see good arguments for both ways.


More information about the busybox mailing list