Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

address of _environ symbol

19 views
Skip to first unread message

rockd...@gmail.com

unread,
Feb 19, 2013, 8:22:39 PM2/19/13
to
Hi everybody,
I'll chime in with the oft-repeated question about obtaining environment variables from an already-running process on HP-UX.

I have read a previous post regarding running a gdb script to obtain the variables and would like to find a way to do this programmatically from a library without requiring a gdb installation.

I have tried following the _environ symbol from gdb and can see that it's location in memory can change, sometimes wildly between different processes.

Does anyone have an idea how it gets calculated by HP's gdb implementation?
I tried running nm on an executable but _environ is not displayed.

If I had that, I could try to use ttrace to read the memory contents and obtain the env variables (provided the inquiring process has the necessary rights).

Any ideas/hints?

Thank all!

--
Claudio Bantaloukas

Frank DG1SBG

unread,
Aug 20, 2015, 3:27:20 PM8/20/15
to
Hi rockdreamer,

assuming you haven't solved this problem yet ;-) ... What's wrong with
getenv() ?

Cheers
Frank

0 new messages