summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2022-03-01 20:05:14 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-02 18:08:05 +0100
commitb1af1b399e5b6289e535b7ba64401a8c7590f11a (patch)
treebe3ec9187590b6f1f558d64da8bd29aaedbd4fd9 /Userland/Libraries
parent19d5974e3af301a2ff75863e6f4d9ac01a99a327 (diff)
downloadserenity-b1af1b399e5b6289e535b7ba64401a8c7590f11a.zip
LibCore: Add tcsetpgrp(int, pid_t) wrapper
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibCore/System.cpp8
-rw-r--r--Userland/Libraries/LibCore/System.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp
index 5092437c85..484ed5b878 100644
--- a/Userland/Libraries/LibCore/System.cpp
+++ b/Userland/Libraries/LibCore/System.cpp
@@ -507,6 +507,14 @@ ErrorOr<void> tcsetattr(int fd, int optional_actions, struct termios const& ios)
return {};
}
+ErrorOr<int> tcsetpgrp(int fd, pid_t pgrp)
+{
+ int rc = ::tcsetpgrp(fd, pgrp);
+ if (rc < 0)
+ return Error::from_syscall("tcsetpgrp"sv, -errno);
+ return { rc };
+}
+
ErrorOr<void> chmod(StringView pathname, mode_t mode)
{
if (!pathname.characters_without_null_termination())
diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h
index b61bcc7626..b160462548 100644
--- a/Userland/Libraries/LibCore/System.h
+++ b/Userland/Libraries/LibCore/System.h
@@ -86,6 +86,7 @@ ErrorOr<String> getcwd();
ErrorOr<void> ioctl(int fd, unsigned request, ...);
ErrorOr<struct termios> tcgetattr(int fd);
ErrorOr<void> tcsetattr(int fd, int optional_actions, struct termios const&);
+ErrorOr<int> tcsetpgrp(int fd, pid_t pgrp);
ErrorOr<void> chmod(StringView pathname, mode_t mode);
ErrorOr<void> lchown(StringView pathname, uid_t uid, gid_t gid);
ErrorOr<void> chown(StringView pathname, uid_t uid, gid_t gid);