mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibCore: Add syscall wrapper for isatty()
This commit is contained in:
parent
9e9662b695
commit
92e6532bf1
2 changed files with 9 additions and 0 deletions
|
@ -416,4 +416,12 @@ ErrorOr<void> setegid(gid_t gid)
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<bool> isatty(int fd)
|
||||
{
|
||||
int rc = ::isatty(fd);
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("isatty"sv, -errno);
|
||||
return rc == 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue