2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Find a CLI process by number
9 #include <exec/lists.h>
10 #include <exec/execbase.h>
11 #include <proto/exec.h>
12 #include <dos/dosextens.h>
13 #include "dos_intern.h"
15 /*****************************************************************************
18 #include <proto/dos.h>
20 AROS_LH1(struct Process
*, FindCliProc
,
23 AROS_LHA(ULONG
, num
, D1
),
26 struct DosLibrary
*, DOSBase
, 91, Dos
)
29 Find a CLI process by its task number. The number must be greater
33 num - The task number of the CLI to find.
36 Pointer to the process if found, NULL otherwise.
40 The process calling this function doesn't need to do any locking.
51 *****************************************************************************/
55 struct RootNode
*root
= DOSBase
->dl_Root
;
56 struct Process
*cliProc
= NULL
;
59 ObtainSemaphoreShared(&root
->rn_RootLock
);
61 ForeachNode(&root
->rn_CliList
, node
)
63 if (node
->ci_Process
->pr_TaskNum
== num
)
65 cliProc
= node
->ci_Process
;
70 ReleaseSemaphore(&root
->rn_RootLock
);