diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 358eed6c2d..86b6e69a80 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -187,4 +187,12 @@ ErrorOr dup2(int source_fd, int destination_fd) return fd; } +ErrorOr ptsname(int fd) +{ + auto* name = ::ptsname(fd); + if (!name) + return Error::from_syscall("ptsname"sv, -errno); + return String(name); +} + } diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 86cf78d60e..6345c150bf 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -31,5 +31,6 @@ ErrorOr read(int fd, void* buffer, size_t buffer_size); ErrorOr write(int fd, void const* data, size_t data_size); ErrorOr kill(pid_t, int signal); ErrorOr dup2(int source_fd, int destination_fd); +ErrorOr ptsname(int fd); }