blob: a530dfa893b607be0e46dce7b9ed68125e951b64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "sys/types.h"
#include "sys/resource.h"
#include <sys/wait.h>
pid_t wait3(int *stat_loc, int options, struct rusage *resource_usage)
{
pid_t ret = waitpid((pid_t)-1, stat_loc, options);
if (ret == (pid_t)-1) {
return (pid_t)-1;
}
if (getrusage(RUSAGE_CHILDREN, resource_usage) == -1) {
return (pid_t)-1;
}
return ret;
}
/*
XOPEN(400,600)
*/
|