Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/isatty.c
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 265 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 265 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | /* |
2 | * isatty.c |
3 | */ |
4 | |
5 | #include <unistd.h> |
6 | #include <termios.h> |
7 | #include <errno.h> |
8 | |
9 | int isatty(int fd) |
10 | { |
11 | int old_errno = errno; |
12 | int istty; |
13 | pid_t dummy; |
14 | |
15 | /* All ttys support TIOCGPGRP */ |
16 | istty = !ioctl(fd, TIOCGPGRP, &dummy); |
17 | errno = old_errno; |
18 | |
19 | return istty; |
20 | } |