diff -urN 17wt6-2i/kernel/fork.c 17wt6/kernel/fork.c --- 17wt6-2i/kernel/fork.c Sun Jan 27 13:37:51 2002 +++ 17wt6/kernel/fork.c Sun Jan 27 13:43:05 2002 @@ -583,6 +583,10 @@ *p = *current; retval = -EAGAIN; + if (p->s_info != NULL && (p->s_info->flags & S_CTX_INFO_NPROC)!=0){ + if (p->s_info->refcount >= p->rlim[RLIMIT_NPROC].rlim_max) + goto bad_fork_free; + } /* * Check if we are over our maximum process limit, but be sure to * exclude root. This is needed to make it possible for login and @@ -592,6 +596,8 @@ if (atomic_read(&p->user->processes) >= p->rlim[RLIMIT_NPROC].rlim_cur && !capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE)) goto bad_fork_free; + + sys_assign_s_info (p); atomic_inc(&p->user->__count); atomic_inc(&p->user->processes);