diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-05-19 20:34:45 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-20 08:31:31 +0200 |
commit | 754112220645222d145da82091d31f7c35d5dc33 (patch) | |
tree | c5568318218c6f67fd99b56ff4672dae3ceebac0 /Libraries | |
parent | f9cffda0e09470c41afad6da1dd8ac75ccde068f (diff) | |
download | serenity-754112220645222d145da82091d31f7c35d5dc33.zip |
Kernel+LibC: Switch isatty() to use a fcntl()
We would want it to work with only stdio pledged.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibC/fcntl.h | 1 | ||||
-rw-r--r-- | Libraries/LibC/unistd.cpp | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibC/fcntl.h b/Libraries/LibC/fcntl.h index d56dae85f5..1aa6e6cd09 100644 --- a/Libraries/LibC/fcntl.h +++ b/Libraries/LibC/fcntl.h @@ -36,6 +36,7 @@ __BEGIN_DECLS #define F_SETFD 2 #define F_GETFL 3 #define F_SETFL 4 +#define F_ISTTY 5 #define FD_CLOEXEC 1 diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp index 652eaabe43..ec01ad1be4 100644 --- a/Libraries/LibC/unistd.cpp +++ b/Libraries/LibC/unistd.cpp @@ -413,8 +413,7 @@ int rmdir(const char* pathname) int isatty(int fd) { - struct termios dummy; - return tcgetattr(fd, &dummy) == 0; + return fcntl(fd, F_ISTTY); } int dup(int old_fd) |