Implement isatty

This commit is contained in:
jD91mZM2
2018-07-26 14:19:20 +02:00
parent 7ff6940edd
commit 2bf426b0fb
19 changed files with 296 additions and 13 deletions
+1
View File
@@ -53,6 +53,7 @@ unistd/fchdir
unistd/fsync
unistd/ftruncate
unistd/getopt
unistd/isatty
unistd/pipe
unistd/rmdir
unistd/sleep
+1
View File
@@ -52,6 +52,7 @@ EXPECT_BINS=\
unistd/fsync \
unistd/ftruncate \
unistd/getopt \
unistd/isatty \
unistd/pipe \
unistd/rmdir \
unistd/sleep \
View File
+1
View File
@@ -0,0 +1 @@
Whatever a tty is, it's not me
+11
View File
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <unistd.h>
int main() {
// 1 is stdout
if (isatty(1)) {
puts("'Tis a tty :D");
} else {
puts("Whatever a tty is, it's not me");
}
}