projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
add tcgetwinsize and tcsetwinsize functions, move struct winsize
[musl]
/
src
/
unistd
/
isatty.c
1
#include <unistd.h>
2
#include <errno.h>
3
#include <sys/ioctl.h>
4
#include <termios.h>
5
#include "syscall.h"
6
7
int isatty(int fd)
8
{
9
struct winsize wsz;
10
unsigned long r = syscall(SYS_ioctl, fd, TIOCGWINSZ, &wsz);
11
if (r == 0) return 1;
12
if (errno != EBADF) errno = ENOTTY;
13
return 0;
14
}