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

List:       netbsd-current-users
Subject:    Re: csh & getprogname small issue
From:       Nicolas Joly <njoly () pasteur ! fr>
Date:       2015-11-15 22:51:40
Message-ID: 20151115225140.GA13253 () issan ! sis ! pasteur ! fr
[Download RAW message or body]

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

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