mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibC: Move waitpid() to sys/wait.h
That's where POSIX says it should be.
This commit is contained in:
parent
4e79a60b78
commit
a6e7797a31
Notes:
sideshowbarker
2024-07-19 09:41:00 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/a6e7797a314 Pull-request: https://github.com/SerenityOS/serenity/pull/1171
6 changed files with 10 additions and 8 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <LibGUI/GApplication.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern "C" {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue