From: Henry Margies <henry.margies@gmx.de>
To: linux-c-programming@vger.kernel.org
Subject: Re: setenv and dlopen
Date: Wed, 26 Oct 2005 10:21:44 +0200 [thread overview]
Message-ID: <1130314904.6680.3.camel@localhost.localdomain> (raw)
In-Reply-To: <20051025182007.GC6673@opaque.pepe>
Hi Christoph,
thank you for you answer.
> I think this is because putenv does not really modify your process'es
> environment (which is not possible afaik), but rather remembers the
> given variable until you call some exec* function. libc will then pass
> the new environment to execve so that the new program will have the
> modified environment.
Well, depends on the point of view. For the user-space processes side
the environment values are all stored in char **environ and I can
remove, add and change values. But you are right, the kernel also holds
the original values I cannot change (which are shown
in /proc/PID/environ).
So it seems like execlp uses the local values from char **environ
(because it reads my PATH value) as dlopen uses the kernel version of
the environment variables (and do not know about my changes to
LD_LIBARAY_PATH).
Maybe dlopen runs far beyond my local processes scope and has no access
to my local environment or it just don't care about :-)
Any solutions to tell dlopen within my c program to search also in my
paths?
Greetings,
Henry
--
Hi! I'm a .signature virus! Copy me into your
~/.signature to help me spread!
--
Hi! I'm a .signature virus! Copy me into your
~/.signature to help me spread!
next prev parent reply other threads:[~2005-10-26 8:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-25 17:52 setenv and dlopen Henry Margies
2005-10-25 18:20 ` Christoph Bussenius
2005-10-26 8:21 ` Henry Margies [this message]
2005-10-26 14:46 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1130314904.6680.3.camel@localhost.localdomain \
--to=henry.margies@gmx.de \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.