On Thu, Sep 28, 2006 at 03:09:54AM -0300, Gustavo Rios wrote: > Dear folks, > > after reading setrlimit(2) instructions for RLIMIT_NPROC, i started > two terminals into my desktop. > In one of them, i issued "ulimit -p 30". > > Since, the number of process per user is global, i was expecting the > output of ulimit -a on both of them to be the same. It was not what i > saw: > > # On terminal 0 i got this : > $ ulimit -a > time(cpu-seconds) 3840 > file(blocks) unlimited > coredump(blocks) unlimited > data(kbytes) 524288 > stack(kbytes) 4096 > lockedmem(kbytes) 157902 > memory(kbytes) 32768 > nofiles(descriptors) 64 > processes 30 > $ > > # On terminal 1 i got this (of course, after the steps in terminal 0). > $ ulimit -a > time(cpu-seconds) 3840 > file(blocks) unlimited > coredump(blocks) unlimited > data(kbytes) 524288 > stack(kbytes) 4096 > lockedmem(kbytes) 157902 > memory(kbytes) 32768 > nofiles(descriptors) 64 > processes 32 > $ > > My doubt is about the maximum number of current proccess for my user id.
A process can freely alter the limit from 0 to the hard limit; this will apply to both itself and any child processes, but not to any other processes run by the same user. While the effect of the limit is global, the setting is local. Joachim