mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: program_invocation_name
Date: Sun, 24 Mar 2013 04:24:59 +0100	[thread overview]
Message-ID: <20130324032458.GQ19010@port70.net> (raw)
In-Reply-To: <20130324030118.GD20323@brightrain.aerifal.cx>

* Rich Felker <dalias@aerifal.cx> [2013-03-23 23:01:18 -0400]:
> > > for (s=t=argv[0]; *t; t++) if (*t=='/') s=t+1;
> > 
> > yes that makes sense assuming argv[0]!=0
> 
> I don't think argv[0]==0 is permitted, but if it is possible, we could
> add a check.

execl("./foo", (char*)0, (char*)0);

works here (argc==0 and argv[0]==0 in the executed process)

> > > P.S. If we do add these, we could certainly add the BSD names too as
> > > aliases.
> > 
> > bsd only has the short version (__progname)
> 
> Doesn't it also have __progname_full or something?

no, that's a gnu invention, added at the same time
as the program_invocation_name things

but yes we should probably support both if we support any


  reply	other threads:[~2013-03-24  3:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-24  0:16 program_invocation_name Rich Felker
2013-03-24  2:49 ` program_invocation_name Szabolcs Nagy
2013-03-24  3:01   ` program_invocation_name Rich Felker
2013-03-24  3:24     ` Szabolcs Nagy [this message]
2013-03-24  9:29       ` program_invocation_name Daniel Cegiełka

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=20130324032458.GQ19010@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).