[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: kmapnotify, LD_PRELOAD, (t)csh and aaarrgh! I'll die today! :-)
From:       Bernd Gehrmann <bernd () physik ! hu-berlin ! de>
Date:       2000-05-29 8:40:56
[Download RAW message or body]

On Mon, 29 May 2000, Rik Hemsley wrote:

> #if Cristian Tibirna
> > I tried to find some more info about prepending libraries in portable
> > ways, I also tried to understand why Rik needs to use this kind of
> > mechanism instead of some in-KShellProcess wrapper or whatever but I'm
> > obviously not lucid enough these days.
> > 
> > What's the scoop? Will I be forced to switch to bash after 7 years of Unix
> > usage? :-)
> 
> No-one would suggest you should suffer that fate :)
> 
> Anyone know a portable way to set LD_PRELOAD, or a better solution ?
> 
> I am currently trying to use putenv(), but I think I'm going to hit a
> race condition where it doesn't get picked up by the child of the shell,
> because I have to unset it immediately after the KShellProcess is started.

Maybe I've missed something, but why are you starting the application
via a shell at all? What about

  fork()
  In the child process:
     putenv()
     exec()

As it avoids one creation of a process, it should even be some
10^{-9} seconds faster :-)

Bernd.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic