This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: [RFC] libstdc++/8399


In article <3DD0C099.8080900@unitus.it>,
Paolo Carlini<pcarlini@unitus.it> writes:

>> isatty() is the only simple POSIX call I know to check whether
>> something is a terminal.  For systems that don't have the call, we'd
>> punt.

> Sorry for being a little naive (not yet carried out real tests): what
> happens when there is /piped/ input from the terminal??
> (my original tests for 2211 where conducted like this)

In my environment (but I can't speak for all such environments), piped
input would return 0 from isatty().  Here is one source for a
non-system-specific man page:

http://www.opennc.org/onlinepubs/7908799/xsh/isatty.html

From that, I'd say most implementations should do similar.  In the
worst case, if isatty() returns true for non-interactive cases
(terminal is always considered interactive, I'd say), it would run
slower but still correctly.

Regards,
Loren


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