diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index c86c22f083..d4807c8b17 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -480,4 +480,12 @@ ErrorOr mkdir(StringView path, mode_t mode) #endif } +ErrorOr fork() +{ + pid_t pid = ::fork(); + if (pid < 0) + return Error::from_syscall("fork"sv, -errno); + return pid; +} + } diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 7032b5553e..c4b668739a 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -64,5 +64,6 @@ ErrorOr setegid(gid_t); ErrorOr isatty(int fd); ErrorOr symlink(StringView target, StringView link_path); ErrorOr mkdir(StringView path, mode_t); +ErrorOr fork(); }