mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +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
6 changed files with 10 additions and 8 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include <LibGUI/GApplication.h>
|
#include <LibGUI/GApplication.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Kernel/Syscall.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -35,3 +36,9 @@ pid_t wait(int* wstatus)
|
||||||
return waitpid(-1, wstatus, 0);
|
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 WEXITED 4
|
||||||
#define WCONTINUED 8
|
#define WCONTINUED 8
|
||||||
|
|
||||||
|
pid_t waitpid(pid_t, int* wstatus, int options);
|
||||||
pid_t wait(int* wstatus);
|
pid_t wait(int* wstatus);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
|
@ -272,12 +272,6 @@ int close(int fd)
|
||||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
__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)
|
int lstat(const char* path, struct stat* statbuf)
|
||||||
{
|
{
|
||||||
if (!path) {
|
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 read(int fd, void* buf, size_t count);
|
||||||
ssize_t write(int fd, const void* buf, size_t count);
|
ssize_t write(int fd, const void* buf, size_t count);
|
||||||
int close(int fd);
|
int close(int fd);
|
||||||
pid_t waitpid(pid_t, int* wstatus, int options);
|
|
||||||
pid_t wait(int* wstatus);
|
|
||||||
int chdir(const char* path);
|
int chdir(const char* path);
|
||||||
int fchdir(int fd);
|
int fchdir(int fd);
|
||||||
char* getcwd(char* buffer, size_t size);
|
char* getcwd(char* buffer, size_t size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue