mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:07:36 +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 {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<bool> isatty(int fd)
|
||||||
|
{
|
||||||
|
int rc = ::isatty(fd);
|
||||||
|
if (rc < 0)
|
||||||
|
return Error::from_syscall("isatty"sv, -errno);
|
||||||
|
return rc == 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,5 +59,6 @@ ErrorOr<void> setuid(uid_t);
|
||||||
ErrorOr<void> seteuid(uid_t);
|
ErrorOr<void> seteuid(uid_t);
|
||||||
ErrorOr<void> setgid(gid_t);
|
ErrorOr<void> setgid(gid_t);
|
||||||
ErrorOr<void> setegid(gid_t);
|
ErrorOr<void> setegid(gid_t);
|
||||||
|
ErrorOr<bool> isatty(int fd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue