From 0c9282bb61b0d7c463045139655b3f1f1ec5422b Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Fri, 17 Nov 2023 21:28:16 +0100 Subject: LibC: Add isatty() --- userland/libc/unistd/isatty.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 userland/libc/unistd/isatty.c (limited to 'userland/libc/unistd/isatty.c') diff --git a/userland/libc/unistd/isatty.c b/userland/libc/unistd/isatty.c new file mode 100644 index 0000000..d8b08c3 --- /dev/null +++ b/userland/libc/unistd/isatty.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int isatty(int fd) { + int rc = syscall(SYS_ISATTY, fd, 0, 0, 0, 0); + if (1 == rc) + return rc; + errno = -rc; + return 0; +} -- cgit v1.2.3