Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: csh & getprogname small issue



On Sun, Nov 15, 2015 at 06:55:04PM +0000, Christos Zoulas wrote:
> In article <20151115175750.GA10949%issan.sis.pasteur.fr@localhost>,
> Nicolas Joly  <njoly%pasteur.fr@localhost> 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

Thanks. I did not know ... i must confess i almost never use C shells.

-- 
Nicolas Joly

Cluster & Computing Group
Biology IT Center
Institut Pasteur, Paris.


Home | Main Index | Thread Index | Old Index