1
Fork 0
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:
Andreas Kling 2021-12-16 19:24:58 +01:00
parent 9e9662b695
commit 92e6532bf1
2 changed files with 9 additions and 0 deletions

View file

@ -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;
}
}