• address of _environ symbol

    From Frank DG1SBG@21:1/5 to rockdreamer@gmail.com on Thu Aug 20 21:27:19 2015
    rockdreamer@gmail.com writes:

    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!

    Hi rockdreamer,

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

    Cheers
    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)