xref: /csrg-svn/lib/libc/gen/isatty.c (revision 46597)
11970Swnj /*
235453Sbostic  * Copyright (c) 1988 The Regents of the University of California.
335453Sbostic  * All rights reserved.
435453Sbostic  *
542625Sbostic  * %sccs.include.redist.c%
61970Swnj  */
71970Swnj 
835453Sbostic #if defined(LIBC_SCCS) && !defined(lint)
9*46597Sdonn static char sccsid[] = "@(#)isatty.c	5.6 (Berkeley) 02/23/91";
1035453Sbostic #endif /* LIBC_SCCS and not lint */
1135453Sbostic 
1240100Smarc #include <termios.h>
13*46597Sdonn #include <unistd.h>
141970Swnj 
15*46597Sdonn int
1635453Sbostic isatty(fd)
1735453Sbostic 	int fd;
181970Swnj {
1940100Smarc 	struct termios t;
201970Swnj 
2140100Smarc 	return(tcgetattr(fd, &t) != -1);
221970Swnj }
23