From 05835518ae0989ff961f471d1b8aeebf4431ace3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 2 Sep 2004 01:41:06 +0000 Subject: [PATCH] Added a function prototype and description on how the userland waitpid() functionality could be supported. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8790 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/team.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/kernel/core/team.c b/src/kernel/core/team.c index 22df02cb63..f120be9ba1 100644 --- a/src/kernel/core/team.c +++ b/src/kernel/core/team.c @@ -1,8 +1,8 @@ /* Team functions */ /* -** Copyright 2002-2004, The OpenBeOS Team. All rights reserved. -** Distributed under the terms of the OpenBeOS License. +** Copyright 2002-2004, The Haiku Team. All rights reserved. +** Distributed under the terms of the Haiku License. ** ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. @@ -702,6 +702,31 @@ err1: // public team API +/** This is the kernel backend for waitpid(). It is a bit more powerful when it comes + * to the reason why a thread has died than waitpid() can be. + */ + +#if 0 +team_id +wait_for_child(thread_id child, uint32 flags, thread_id *_deadChild, int32 *_reason, status_t *_returnCode) +{ + // ToDo: implement me! We need to store the death of children in the team structure! + + if (child > 0) { + // wait for the specified child + } else if (child == -1) { + // wait for any children of this team to die + } else if (child == 0) { + // wait for any children of this process group to die + } else { + // wait for any children with progress group of the absolute value of "child" + } + + return B_ERROR; +} +#endif + + status_t wait_for_team(team_id id, status_t *_returnCode) {