This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ftstc implementation


Hi Carlos
Sorry about replying late. Yes, I am attempting port a stripped down
version of uboot to the GNU compiler toolchain. The comments in uboot
code imply that tstc() and ftstc() are used to test for the presence
of a character in stdin or a file, without actually reading it. For
now I have thought of implementing it as a getc() followed by
ungetc(). Do you think that's a good enough implementation?

Regards
Suhas

On Sat, Aug 9, 2014 at 8:28 PM, Carlos O'Donell <carlos@systemhalted.org> wrote:
> On Wed, Aug 6, 2014 at 2:26 PM, Suhas Chakravarty
> <suhas.chakravarty@gmail.com> wrote:
>> Is ftstc()'s implementation provided as part of libc? It tests for the
>> presence of a char in stdin/file.
>
> The ftstc() function is not provided by glibc.
>
> I'm not that familiar with these functions, but believe they are BSD
> extensions and that tstc() also exists, but is not implemented by
> glibc.
>
> Why do you ask? Are you porting software to GNU/Linux and finding that
> glibc doesn't provide these functions?
>
> Do you have a reference anywhere that explains what these functions do?
>
> Cheers,
> Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]