From bec646c0bbe630c8ab062dc87e3e40497b58cda0 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 17 Aug 2019 12:21:54 +0300 Subject: LibC: Implement wait() This is a simple convenience wrapper over waitpid(). --- Libraries/LibC/unistd.cpp | 5 +++++ Libraries/LibC/unistd.h | 1 + 2 files changed, 6 insertions(+) (limited to 'Libraries') diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp index 8cb27006c8..1991dbf45d 100644 --- a/Libraries/LibC/unistd.cpp +++ b/Libraries/LibC/unistd.cpp @@ -236,6 +236,11 @@ pid_t waitpid(pid_t waitee, int* wstatus, int options) __RETURN_WITH_ERRNO(rc, rc, -1); } +pid_t wait(int* wstatus) +{ + return waitpid(-1, wstatus, 0); +} + int lstat(const char* path, struct stat* statbuf) { int rc = syscall(SC_lstat, path, statbuf); diff --git a/Libraries/LibC/unistd.h b/Libraries/LibC/unistd.h index c522bba6bc..30fac6c00c 100644 --- a/Libraries/LibC/unistd.h +++ b/Libraries/LibC/unistd.h @@ -66,6 +66,7 @@ ssize_t read(int fd, void* buf, size_t count); ssize_t write(int fd, const void* buf, size_t count); int close(int fd); pid_t waitpid(pid_t, int* wstatus, int options); +pid_t wait(int* wstatus); int chdir(const char* path); char* getcwd(char* buffer, size_t size); char* getwd(char* buffer); -- cgit v1.2.3