[lkml]   [2003]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Changing argv[0] under Linux.
On Wednesday 15 January 2003 03:26 pm, Andreas Schwab wrote:
> Jakob Oestergaard <> writes:
> |> Can anyone point out a problem in the above? I'd be happy to see it shot
> |> down, mainly because it's ugly - and I hate programs that mess with
> |> argv[0].
> argv[0] is not required to point to the actual file name of the
> executable, and in fact, most of the time it won't.

And don't count on it for portability - Some systems take a copy of arg0 for
the process tables, and changing it will NOT alter the process name. It is
only the default action for shell programs. All others can make arg0 anything
they want - as login effectively does ..

execl ("pathtoshell", "-", 0)

Jesse I Pollard, II

Any opinions expressed are solely my own.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:32    [W:0.134 / U:16.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site