mes: Add isatty?.

* src/posix.c (isatty_p): New function.
This commit is contained in:
Jan Nieuwenhuizen 2018-04-22 11:48:38 +02:00
parent ece39a9a18
commit bb45012c39
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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;
}