From b1af1b399e5b6289e535b7ba64401a8c7590f11a Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Tue, 1 Mar 2022 20:05:14 +0100 Subject: [PATCH] LibCore: Add tcsetpgrp(int, pid_t) wrapper --- Userland/Libraries/LibCore/System.cpp | 8 ++++++++ Userland/Libraries/LibCore/System.h | 1 + 2 files changed, 9 insertions(+) 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 tcsetattr(int fd, int optional_actions, struct termios const& ios) return {}; } +ErrorOr tcsetpgrp(int fd, pid_t pgrp) +{ + int rc = ::tcsetpgrp(fd, pgrp); + if (rc < 0) + return Error::from_syscall("tcsetpgrp"sv, -errno); + return { rc }; +} + ErrorOr 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 getcwd(); ErrorOr ioctl(int fd, unsigned request, ...); ErrorOr tcgetattr(int fd); ErrorOr tcsetattr(int fd, int optional_actions, struct termios const&); +ErrorOr tcsetpgrp(int fd, pid_t pgrp); ErrorOr chmod(StringView pathname, mode_t mode); ErrorOr lchown(StringView pathname, uid_t uid, gid_t gid); ErrorOr chown(StringView pathname, uid_t uid, gid_t gid);