[lkml]   [2003]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Changing argv[0] under Linux.
On Thursday 16 January 2003 00:03, DervishD wrote:
> Yes, I suppose that exec'ing whatever is in argv0 is not a good
> idea :((( Didn't think about it.
> Any suggestion on how to get the binary name from the core image?
Does it have to be an exec?
Perhaps something like this:
int main(int argc, char **argv)
if (fork ()) {
strcpy (argv[0], "Fake name 00001");
setpgrp (); /* very important when dealing with stuff like this */
pause(); /* code for personality "Fake name 00001" */
return 0;
strcpy (argv[0], "Fake name 00002");
setpgrp ();
pause(); /* code for personality "Fake name 00002" */

this thing works - at least on my box...
But, of course, I could be mistaken, and I miss to see some other
important details. Good luck.
Dorin "sp00ky" Lazar, programmer
Registered Linux user #162515

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.070 / U:2.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site