* Process data limit
@ 1990-01-03 13:39 beihl
1990-01-04 2:50 ` George Robbins
0 siblings, 1 reply; 2+ messages in thread
From: beihl @ 1990-01-03 13:39 UTC (permalink / raw)
Can anyone explain the following? Sbrk() seems to be returning a value
far larger than getrlimit or `limit` (from the shell). Who's right?
I've looked at the man pages for getrlimit, csh and sbrk and am still
clueless...
% cat > test.c
#include <sys/time.h>
#include <sys/resource.h>
extern int etext;
main() {
struct rlimit rlimit_ptr;
printf("sbrk(0): 0x%x\n",sbrk(0));
getrlimit(RLIMIT_DATA,&rlimit_ptr);
printf("rlimit: 0x%x\n",(unsigned int)&etext + rlimit_ptr.rlim_max);
}
^D
% cc test.c
% a.out
sbrk(0): 0x10001460
rlimit: 0x57fbe10
% limit
cputime unlimited
filesize unlimited
datasize 85988 kbytes
stacksize 512 kbytes
coredumpsize unlimited
memoryuse 12748 kbytes
%
Gary Beihl (beihl@mcc.com)
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Process data limit
1990-01-03 13:39 Process data limit beihl
@ 1990-01-04 2:50 ` George Robbins
0 siblings, 0 replies; 2+ messages in thread
From: George Robbins @ 1990-01-04 2:50 UTC (permalink / raw)
In article <5040@cadillac.CAD.MCC.COM> beihl@sunburn () writes:
>
> Can anyone explain the following? Sbrk() seems to be returning a value
> far larger than getrlimit or `limit` (from the shell). Who's right?
> I've looked at the man pages for getrlimit, csh and sbrk and am still
> clueless...
The data segment is not contiguous with the text segmnent, presumably
it starts at 0x10000000. So sbrk is returning and address, limit is
defining an amount...
This is documented somewhere, though I forgets exactly where...
--
George Robbins - now working for, uucp: {uunet|pyramid|rutgers}!cbmvax!grr
but no way officially representing arpa: cbmvax!grr@uunet.uu.net
Commodore, Engineering Department fone: 215-431-9255 (only by moonlite)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1990-01-04 2:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1990-01-03 13:39 Process data limit beihl
1990-01-04 2:50 ` George Robbins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox