最大PID在Linux中 [英] Maximum PID in Linux
问题描述
我移植从Tru64到Linux应用程序,它使用在PID_MAX定义limits.h中。
Linux没有限定。
如何找到在PID_MAX的 C 不读 PROC /内核/ PID_MAX
手?
是否有一个图书馆吗?
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 without reading proc/kernel/pid_max
by hand?
Is there a library?
推荐答案
32768默认情况下,你可以阅读您系统上的值的/ proc / sys目录/内核/ PID_MAX
。
32768 by default, you can read the value on your system in /proc/sys/kernel/pid_max
.
和可以设定值(最多2 22 = 4,194,304在32位机)与:
And you can set the value higher (up to 222 = 4,194,304 on 32-bit machines) with:
echo 4194303 > /proc/sys/kernel/pid_max
在这里阅读更多:
Read more here:
<一个href=\"http://web.archive.org/web/20111209081734/http://research.cs.wisc.edu/condor/condorg/linux_scalability.html\">http://www.cs.wisc.edu/condor/condorg/linux_scalability.html (通过archive.org)
这篇关于最大PID在Linux中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!