- Added wait3() and wait4() to the bsd compatibility library.

- Untested, but should work (will test it when I get home later today).
- This is my first attempt at adding something for compatibility reasons. Let
  me know if something in wrong.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34091 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Bruno G. Albuquerque 2009-11-17 15:53:17 +00:00
parent 931d8b07e8
commit ada17216f9
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,25 @@
/*
* Copyright 2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BSD_SYS_WAIT_H_
#define _BSD_SYS_WAIT_H_
#include_next <sys/wait.h>
#include <sys/resource.h>
#ifdef __cplusplus
extern "C" {
#endif
pid_t wait3(int *status, int options, struct rusage *rusage);
pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage);
#ifdef __cplusplus
}
#endif
#endif /* _BSD_SYS_WAIT_H_ */

View File

@ -18,4 +18,5 @@ SharedLibrary libbsd.so :
unvis.c
usershell.c
vis.c
wait.c
;

26
src/libs/bsd/wait.c Normal file
View File

@ -0,0 +1,26 @@
/*
* Copyright 2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Bruno Albuquerque, bga@bug-br.org.br
*/
#include <sys/wait.h>
pid_t
wait3(int *status, int options, struct rusage *rusage) {
return wait4(-1, status, options, rusage);
}
pid_t
wait4(pid_t pid, int *status, int options, struct rusage *rusage) {
pid_t waitPid = waitpid(pid, status, options);
getrusage(RUSAGE_CHILDREN, rusage);
return waitPid;
}