BSD 4_3 release
[unix-history] / usr / src / lib / libc / gen / isatty.c
index d5dfbaa..42eb42e 100644 (file)
@@ -1,4 +1,7 @@
-/* @(#)isatty.c        4.1 (Berkeley) 12/21/80 */
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)isatty.c   5.2 (Berkeley) 3/9/86";
+#endif LIBC_SCCS and not lint
+
 /*
  * Returns 1 iff file is a tty
  */
 /*
  * Returns 1 iff file is a tty
  */
@@ -9,7 +12,7 @@ isatty(f)
 {
        struct sgttyb ttyb;
 
 {
        struct sgttyb ttyb;
 
-       if (gtty(f, &ttyb) < 0)
+       if (ioctl(f, TIOCGETP, &ttyb) < 0)
                return(0);
        return(1);
 }
                return(0);
        return(1);
 }