macro and text revision (-mdoc version 3)
[unix-history] / usr / src / lib / libc / gen / isatty.c
CommitLineData
b5799bf2 1/*
81627469
KB
2 * Copyright (c) 1988 The Regents of the University of California.
3 * All rights reserved.
4 *
269a7923 5 * %sccs.include.redist.c%
b5799bf2
BJ
6 */
7
81627469 8#if defined(LIBC_SCCS) && !defined(lint)
c5980113 9static char sccsid[] = "@(#)isatty.c 5.6 (Berkeley) %G%";
81627469
KB
10#endif /* LIBC_SCCS and not lint */
11
8ff9d8b5 12#include <termios.h>
c5980113 13#include <unistd.h>
b5799bf2 14
c5980113 15int
81627469
KB
16isatty(fd)
17 int fd;
b5799bf2 18{
8ff9d8b5 19 struct termios t;
b5799bf2 20
8ff9d8b5 21 return(tcgetattr(fd, &t) != -1);
b5799bf2 22}