Implemented waitpid() a bit more; it now calls the _kern_wait_for_child() syscall.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8972 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -24,14 +24,30 @@ wait(int *_status)
|
|||||||
pid_t
|
pid_t
|
||||||
waitpid(pid_t pid, int *_status, int options)
|
waitpid(pid_t pid, int *_status, int options)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "waitpid(pid = %ld, options = %d): NOT IMPLEMENTED\n", pid, options);
|
status_t returnCode;
|
||||||
return -1;
|
int32 reason;
|
||||||
|
|
||||||
|
thread_id thread = _kern_wait_for_child(pid, options, &reason, &returnCode);
|
||||||
|
|
||||||
|
if (_status != NULL) {
|
||||||
|
// ToDo: fill in _status!
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thread < B_OK) {
|
||||||
|
errno = thread;
|
||||||
|
if (thread == B_WOULD_BLOCK && (options & WNOHANG) != 0)
|
||||||
|
return 0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
waitid(idtype_t idType, id_t id, siginfo_t *info, int options)
|
waitid(idtype_t idType, id_t id, siginfo_t *info, int options)
|
||||||
{
|
{
|
||||||
|
// waitid() is not available on BeOS so we may be lazy here and remove it...
|
||||||
fprintf(stderr, "waitid(): NOT IMPLEMENTED\n");
|
fprintf(stderr, "waitid(): NOT IMPLEMENTED\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user