public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* How to determine the start of DATA segment
@ 2006-03-30 16:37 Ram Gupta
  2006-03-30 16:52 ` Jon DeVree
  2006-03-30 17:31 ` Phillip Susi
  0 siblings, 2 replies; 4+ messages in thread
From: Ram Gupta @ 2006-03-30 16:37 UTC (permalink / raw)
  To: linux mailing-list

Is there a system call or library function which a process can use to
determine the start of its data segment . I need to know the start of
the data segment so that process does not cross its DATA limit. Using
this information & sbrk it knows how much data space is already used &
how much it can grow further without crossing the limit.

Thanks
Ram Gupta

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to determine the start of DATA segment
  2006-03-30 16:37 How to determine the start of DATA segment Ram Gupta
@ 2006-03-30 16:52 ` Jon DeVree
  2006-03-30 17:12   ` Ram Gupta
  2006-03-30 17:31 ` Phillip Susi
  1 sibling, 1 reply; 4+ messages in thread
From: Jon DeVree @ 2006-03-30 16:52 UTC (permalink / raw)
  To: linux mailing-list

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

On Thu, Mar 30, 2006 at 10:37:25AM -0600, Ram Gupta wrote:
> Is there a system call or library function which a process can use to
> determine the start of its data segment . I need to know the start of
> the data segment so that process does not cross its DATA limit. Using
> this information & sbrk it knows how much data space is already used &
> how much it can grow further without crossing the limit.

I think getrlimit() might be what you are looking for.
-- 
Jon
"RISC architecture is gonna change everything." -Kate Libby

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to determine the start of DATA segment
  2006-03-30 16:52 ` Jon DeVree
@ 2006-03-30 17:12   ` Ram Gupta
  0 siblings, 0 replies; 4+ messages in thread
From: Ram Gupta @ 2006-03-30 17:12 UTC (permalink / raw)
  To: Jon DeVree; +Cc: linux mailing-list

On 3/30/06, Jon DeVree <jadevree@mtu.edu> wrote:
.
>
> I think getrlimit() might be what you are looking for.
> --
> Jon

getrlimit is useful to know the limit set of a resource by setrlimit.
But I am interested in getting the start of DATA segment

Regards
Ram Gupta

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to determine the start of DATA segment
  2006-03-30 16:37 How to determine the start of DATA segment Ram Gupta
  2006-03-30 16:52 ` Jon DeVree
@ 2006-03-30 17:31 ` Phillip Susi
  1 sibling, 0 replies; 4+ messages in thread
From: Phillip Susi @ 2006-03-30 17:31 UTC (permalink / raw)
  To: Ram Gupta; +Cc: linux mailing-list

The program's DATA segment is of fixed size as link time.  It contains 
all of the initialized variables your program has.  It does not grow at 
runtime.  You can find out how large it is by looking at the output of 
objdump.  Maybe you meant to ask what is the upper limit on the size of 
your heap?

Ram Gupta wrote:
> Is there a system call or library function which a process can use to
> determine the start of its data segment . I need to know the start of
> the data segment so that process does not cross its DATA limit. Using
> this information & sbrk it knows how much data space is already used &
> how much it can grow further without crossing the limit.
> 
> Thanks
> Ram Gupta

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-30 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-30 16:37 How to determine the start of DATA segment Ram Gupta
2006-03-30 16:52 ` Jon DeVree
2006-03-30 17:12   ` Ram Gupta
2006-03-30 17:31 ` Phillip Susi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox