On Thu, Feb 08, 2018 at 12:06:07PM +0100, Thomas Huth wrote: > On 07.02.2018 20:03, Andrew Jones wrote: > > Move the unit test specific h_get_term_char() to powerpc common code > > and call it getchar(). Other architectures may want to implement > > getchar() too (ARM will in a coming patch), so put the prototype in > > libcflat.h > > Using the libc name getchar() here sounds wrong. h_get_term_char() > behaves differently compared to the libc getchar(), e.g. it does not > block if there are no characters available. > I think you should either name this function differently, or implement a > behavior that is more close to the libc getchar() to avoid future confusion. > Good point. I guess I should rename it, because we'd need to anyway in order to share getchar()'s implementation among other architectures, unless we duplicated the looping and EOF returning. Any suggestion for the name? __getchar() or stdin_readb()? Note, I see we got things wrong for puts() too. Maybe we should do a quick libc function audit and send a cleanup series. Thanks, drew