Implement isatty
This commit is contained in:
@@ -53,6 +53,7 @@ unistd/fchdir
|
||||
unistd/fsync
|
||||
unistd/ftruncate
|
||||
unistd/getopt
|
||||
unistd/isatty
|
||||
unistd/pipe
|
||||
unistd/rmdir
|
||||
unistd/sleep
|
||||
|
||||
@@ -52,6 +52,7 @@ EXPECT_BINS=\
|
||||
unistd/fsync \
|
||||
unistd/ftruncate \
|
||||
unistd/getopt \
|
||||
unistd/isatty \
|
||||
unistd/pipe \
|
||||
unistd/rmdir \
|
||||
unistd/sleep \
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Whatever a tty is, it's not me
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user