I am porting an application from Tru64 to Linux and it uses PID_MAX defined in limits.h. Linux doesn\'t have that define. How do I find PID_MAX in c withou
From the proc(5) man page:
/proc/sys/kernel/pid_max(since Linux 2.5.34)This file specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). PIDs greater than this value are not allocated; thus, the value in this file also acts as a system-wide limit on the total number of processes and threads. The default value for this file, 32768, results in the same range of PIDs as on earlier kernels. On 32-bit platforms, 32768 is the maximum value for pid_max. On 64-bit systems,
pid_maxcan be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million).