In article <[email protected]>,
Nicolas Joly  <[email protected]> wrote:
>-=-=-=-=-=-
>
>
>Hi,
>
>I do have a use case for a preloaded library that track various events
>during process execution life. As part of the recorded information i
>use PID, program name, timestamp, ...
>
>It mostly works fine, but noticed that csh show a special case where
>program name gets altered somehow unlike other shells :
>
>njoly@raya [tmp/progname]> LD_PRELOAD=./libprog.so sh -c ''
>init:sh
>_exit:sh
>njoly@raya [tmp/progname]> LD_PRELOAD=./libprog.so ksh -c ''
>init:ksh
>fini:ksh
>_exit:ksh
>
>njoly@raya [tmp/progname]> LD_PRELOAD=./libprog.so csh -c ''
>init:csh
>_exit:-sh
>
>In the last case, when _exit(2) is called, getprogname report strange
>'-sh' instead of expected 'csh'.
>
>Is it to be expected ? This behaviour looks strange to me ...

explanation: http://nxr.netbsd.org/xref/src/bin/csh/csh.c#295
setting: http://nxr.netbsd.org/xref/src/bin/csh/csh.c#443

christos

Reply via email to