mes: Add isatty?.
* src/posix.c (isatty_p): New function.
This commit is contained in:
parent
ece39a9a18
commit
bb45012c39
|
@ -424,7 +424,7 @@ sprintf (char *str, char const* format, ...)
|
|||
int
|
||||
isatty (int fd)
|
||||
{
|
||||
return ioctl (fd, TCGETS, 0) == -14; // MAGIC
|
||||
return ioctl (fd, TCGETS, 0) & 0xf0;
|
||||
}
|
||||
|
||||
#endif //!POSIX
|
||||
|
|
|
@ -199,3 +199,9 @@ force_output (SCM p) ///((arity . n))
|
|||
{
|
||||
return cell_unspecified;
|
||||
}
|
||||
|
||||
SCM
|
||||
isatty_p (SCM port)
|
||||
{
|
||||
return isatty (VALUE (port)) ? cell_t : cell_f;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue