Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 1996 00:31:54 GMT
From:      James Raynard <fbugs@jraynard.demon.co.uk>
To:        elrond2imladris.frmug.fr.net@memo.frmug.fr.net
Cc:        freebsd-bugs@freebsd.org, roberto@keltia.freenix.fr
Subject:   Re: Bug found in getrlimit for 2.1R
Message-ID:  <199605180031.AAA00521@jraynard.demon.co.uk>
In-Reply-To: <199605152226.AAA18328@memo.frmug.fr.net> (message from Bertrand Petit on Thu, 16 May 1996 00:26:05 %2B0200)

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> Bertrand Petit <elrond@memo.frmug.fr.net> writes:
> 
> 	I've found a bug in the getrlinit function(). Here is a small
> program to demonstrate this:
[snip]

>		printf("soft=%d\nhard=%d\n",(long)Lim.rlim_cur,Lim.rlim_max);

BTW this should be 

		printf("soft=%qd\nhard=%qd\n",Lim.rlim_cur,Lim.rlim_max);

> 		fflush(stdout);
>
> 	This program outputs:
> 
> -----
> soft=64
> hard=-1

According to the getrlimit manpage, 

An ``infinite'' value for a limit is defined as RLIM_INFINITY.

and looking in /usr/include/sys/resource.h, we find:-

RLIM_INFINITY   (((u_quad_t)1 << 63) - 1)

> 	And under gdb:
> 
> -----
> Breakpoint 1, main () at toto.c:12
> (gdb) print Lim
> $1 = {rlim_cur = 0x0000000000000040, rlim_max = 0x7fffffffffffffff}

See above. I believe this is working as documented.

> 	I've searched the getrlinit source code:
>
> 	But was unable to find it on my installation nor the second CD
> of 2.1R!

It's in /usr/src/sys/kern/kern_resource.c

-- 
James Raynard, Edinburgh, Scotland
jraynard@dial.pipex.com
james@jraynard.demon.co.uk



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605180031.AAA00521>