Subject: kern/36153: getrusage(2) not working?
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <juan@xtrarom.org>
List: netbsd-bugs
Date: 04/16/2007 10:45:01
>Number:         36153
>Category:       kern
>Synopsis:       getrusage(2) not working?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 16 10:45:01 +0000 2007
>Originator:     Juan RP
>Release:        NetBSD 4.99.17
>Organization:
>Environment:
System: NetBSD nocturno 4.99.17 NetBSD 4.99.17 (Nocturno) #18: Mon Apr 16 00:32:16 CEST 2007 juan@nocturno:/home/juan/build/src/obj/sys/arch/amd64/compile/Nocturno amd64
Architecture: x86_64
Machine: amd64
>Description:

	Can't increase data/stack size, there seems to be a limit
	of 512MB for amd64... I don't know.

$ ulimit -a                                                                                          
time(cpu-seconds)    unlimited
file(blocks)         unlimited
coredump(blocks)     unlimited
data(kbytes)         524288
stack(kbytes)        4096
lockedmem(kbytes)    669930
memory(kbytes)       1048576
nofiles(descriptors) 64
processes            64
sbsize(bytes)        unlimited
$

$ ulimit -d 524289                                                                                   
ksh: ulimit: exceeds allowable limit
$
	
	When I try to increase them it returns EPERM. Someone suggested
	to add a /etc/login.conf and add limits there, I'm using this
	one:

default:\
        :path=/usr/bin /bin /usr/sbin /sbin /usr/pkg/bin /usr/pkg/sbin:\
	:umask=022:\
	:datasize=2097152k:\
	:maxproc=512:\
	:openfiles=512:\
	:stacksize=8m:\
	:memoryuse=2097152k

	Works for root but not for the users.

>How-To-Repeat:
>Fix:
	Yes, please.