LibC: Move waitpid() to sys/wait.h

That's where POSIX says it should be.
This commit is contained in:
Sergey Bugaev 2020-02-03 18:51:48 +03:00 committed by Andreas Kling
parent 4e79a60b78
commit a6e7797a31
Notes: sideshowbarker 2024-07-19 09:41:00 +09:00
6 changed files with 10 additions and 8 deletions

View file

@ -28,6 +28,7 @@
#include <LibGUI/GApplication.h>
#include <signal.h>
#include <stdio.h>
#include <sys/wait.h>
int main(int argc, char** argv)
{

View file

@ -37,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
extern "C" {

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <Kernel/Syscall.h>
#include <assert.h>
#include <sys/wait.h>
#include <unistd.h>
@ -35,3 +36,9 @@ pid_t wait(int* wstatus)
return waitpid(-1, wstatus, 0);
}
}
pid_t waitpid(pid_t waitee, int* wstatus, int options)
{
int rc = syscall(SC_waitpid, waitee, wstatus, options);
__RETURN_WITH_ERRNO(rc, rc, -1);
}

View file

@ -44,6 +44,7 @@ __BEGIN_DECLS
#define WEXITED 4
#define WCONTINUED 8
pid_t waitpid(pid_t, int* wstatus, int options);
pid_t wait(int* wstatus);
__END_DECLS

View file

@ -272,12 +272,6 @@ int close(int fd)
__RETURN_WITH_ERRNO(rc, rc, -1);
}
pid_t waitpid(pid_t waitee, int* wstatus, int options)
{
int rc = syscall(SC_waitpid, waitee, wstatus, options);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
int lstat(const char* path, struct stat* statbuf)
{
if (!path) {

View file

@ -101,8 +101,6 @@ int tcsetpgrp(int fd, pid_t pgid);
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);
int fchdir(int fd);
char* getcwd(char* buffer, size_t size);