Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!enea!zyx!aj From: aj@zyx.UUCP (Arndt Jonasson) Newsgroups: comp.unix.questions Subject: Max # of processes. Message-ID: <845@zyx.UUCP> Date: Mon, 22-Jun-87 07:48:50 EDT Article-I.D.: zyx.845 Posted: Mon Jun 22 07:48:50 1987 Date-Received: Sat, 27-Jun-87 06:55:36 EDT Reply-To: aj@zyx.SE (Arndt Jonasson) Organization: ZYX Sweden AB, Stockholm Lines: 33 How can the maximum number of processes in a Unix system be determined? Our system is HP-UX for HP9000/200 and HP9000/300, but preferably I would like to know the most portable way of obtaining this value. We don't have Unix source. HP-UX is essentially SYS5.2 with some BSD extensions. I have previously seen references to a symbol named NPROC, and there is indeed one of that name referred to in the file /usr/include/sys/space.h, but it isn't defined anywhere in /usr/include/... (which, it seems to me, makes that include file quite useless). I also thought of using nlist(3) to read the value of the appropriate symbol from the kernel, but I didn't find any symbol that seemed to be the right one. The intended use is like this in a C program: typedef struct process {...} Process; Process proc_table[NPROC]; where I obviously don't want to make the array too small. If there isn't a 'static' way to find out, this would do as well: int max_no_of_processes (); Process *proc_table; proc_table = (Process *) malloc (max_no_of_processes () * sizeof (Process)); -- Arndt Jonasson, ZYX Sweden AB, Styrmansgatan 6, 114 54 Stockholm, Sweden UUCP: ...!seismo!mcvax!zyx!aj