2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
8 #include <exec/execbase.h>
9 #include <proto/exec.h>
10 #include <dos/dosextens.h>
12 /*****************************************************************************
15 #include <proto/dos.h>
17 AROS_LH0(ULONG
, MaxCli
,
22 struct DosLibrary
*, DOSBase
, 92, Dos
)
25 Returns the highest Cli number currently in use. Since processes
26 may be added and removed at any time the returned value may already
32 Maximum Cli number (_not_ the number of Clis).
44 *****************************************************************************/
48 IPTR
*taskarray
= BADDR(DOSBase
->dl_Root
->rn_TaskArray
);
50 The first IPTR in the taskarray contains the size of the
51 taskarray = the max. number of processes the taskarray
54 IPTR retval
= taskarray
[0];
57 Not all of the fields in the array may contain a valid
58 pointer to a process and they might be NULL instead. So
59 I search that array backwards until I find a valid entry.
61 while (retval
&& (IPTR
)NULL
!= taskarray
[retval
])