[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: finding datadir from executable
From: |
Ralph Corderoy |
Subject: |
Re: finding datadir from executable |
Date: |
Sat, 11 Sep 2004 19:20:02 +0100 |
Hi Andreas,
> Ralph Corderoy <address@hidden> writes:
> > Does argv[0] always contain a path on all Unixes?
>
> No. It contains exactly the string passed in by execve, unmodified.
> It can be arbitrary.
I wasn't clear. I realise it isn't always an absolute path, and is
normally whatever's passed to execve(2). I was just trying to point out
that some old Unixes, Xenix? -- I can't remember, effectively strip any
path, absolute or relative, from execve's argument before it turns up in
argv[0], i.e. execve("./ls", ...) and execve("/bin/ls", ...) both
deliver an argv[0] of "ls". Horrible, I know, but I remember getting
bit by it.
Cheers,
Ralph.
- Re: finding datadir from executable, (continued)
- Re: finding datadir from executable, Akim Demaille, 2004/09/06
- Re: finding datadir from executable, Bruce Korb, 2004/09/06
- Re: finding datadir from executable, Daniel Jacobowitz, 2004/09/11
- Re: finding datadir from executable, Bob Friesenhahn, 2004/09/11
- Re: finding datadir from executable, Bruce Korb, 2004/09/11
- Re: finding datadir from executable, Bob Friesenhahn, 2004/09/11
- Re: finding datadir from executable, Alexandre Duret-Lutz, 2004/09/12
- Re: finding datadir from executable, Ralph Corderoy, 2004/09/11
- Re: finding datadir from executable, Bob Friesenhahn, 2004/09/11
- Re: finding datadir from executable, Andreas Schwab, 2004/09/11
- Re: finding datadir from executable,
Ralph Corderoy <=
- Re: finding datadir from executable, Bob Friesenhahn, 2004/09/11
- Re: finding datadir from executable, Andreas Schwab, 2004/09/12