summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-08-17 12:21:54 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-08-17 12:07:55 +0200
commitbec646c0bbe630c8ab062dc87e3e40497b58cda0 (patch)
tree207cad1aa986095e01ede641db27937f982609e1 /Libraries
parentfde8f7f538bfacd8ae98c8f8ab86c18609c39783 (diff)
downloadserenity-bec646c0bbe630c8ab062dc87e3e40497b58cda0.zip
LibC: Implement wait()
This is a simple convenience wrapper over waitpid().
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibC/unistd.cpp5
-rw-r--r--Libraries/LibC/unistd.h1
2 files changed, 6 insertions, 0 deletions
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);