On Thu, Oct 22, 2009 at 09:24:43AM -0400, stan wrote: > I have a nachine that has run out of process table entries. One of my > co-workers asked how one could check for this, and I am afraid that I did > not know the answwer. > > So, how can one read the usage of kernel limits at rutime?
See sysctl(3), KERN_MAXPROC. There is also getrlimit(2), specifically RLIMIT_NPROC, but that returns a different limit. You can compare the output of ps against those (OpenBSD does not appear to expose a system call for this; /usr/src/bin/ps/* is full of calls to kvm_*, see kvm(3)). Note that kern.maxproc can be raised, e.g. via sysctl.conf(5). Joachim