mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibCore: Add wrapper for posix_openpt(), grantpt() and unlockpt()
This commit is contained in:
parent
ddf9987c39
commit
5d29f64c99
Notes:
sideshowbarker
2024-07-17 18:03:16 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/5d29f64c99 Pull-request: https://github.com/SerenityOS/serenity/pull/12845
2 changed files with 27 additions and 0 deletions
|
@ -1084,4 +1084,28 @@ ErrorOr<void> setenv(StringView name, StringView value, bool overwrite)
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<int> posix_openpt(int flags)
|
||||
{
|
||||
int const rc = ::posix_openpt(flags);
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("posix_openpt", -errno);
|
||||
return rc;
|
||||
}
|
||||
|
||||
ErrorOr<void> grantpt(int fildes)
|
||||
{
|
||||
auto const rc = ::grantpt(fildes);
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("grantpt", -errno);
|
||||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> unlockpt(int fildes)
|
||||
{
|
||||
auto const rc = ::unlockpt(fildes);
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("unlockpt", -errno);
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -146,5 +146,8 @@ ErrorOr<Vector<gid_t>> getgroups();
|
|||
ErrorOr<void> mknod(StringView pathname, mode_t mode, dev_t dev);
|
||||
ErrorOr<void> mkfifo(StringView pathname, mode_t mode);
|
||||
ErrorOr<void> setenv(StringView, StringView, bool);
|
||||
ErrorOr<int> posix_openpt(int flags);
|
||||
ErrorOr<void> grantpt(int fildes);
|
||||
ErrorOr<void> unlockpt(int fildes);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue