Updated PCI IDs to latest snapshot.
[tangerine.git] / rom / dos / maxcli.c
blob0fa17cbfaf7f5765f132a0ba488cbbb1a95a03ae
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <exec/execbase.h>
9 #include <proto/exec.h>
10 #include <dos/dosextens.h>
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH0(ULONG, MaxCli,
19 /* SYNOPSIS */
21 /* LOCATION */
22 struct DosLibrary *, DOSBase, 92, Dos)
24 /* FUNCTION
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
27 be wrong.
29 INPUTS
31 RESULT
32 Maximum Cli number (_not_ the number of Clis).
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 *****************************************************************************/
46 AROS_LIBFUNC_INIT
48 ULONG * taskarray = (ULONG *)BADDR(DOSBase->dl_Root->rn_TaskArray);
49 /*
50 The first ULONG in the taskarray contains the size of the
51 taskarray = the max. number of processes the taskarray
52 can currently hold.
54 ULONG retval = taskarray[0];
56 /*
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 endtry.
61 while (retval && NULL != taskarray[retval])
62 retval--;
64 return retval;
65 AROS_LIBFUNC_EXIT
66 } /* MaxCli */