can someone tell me how can I change the name of a process after a for();
normally it's done by changing argv[0], but how should it be done in a new process ?
Printable View
can someone tell me how can I change the name of a process after a for();
normally it's done by changing argv[0], but how should it be done in a new process ?
I'd suppose that it should work the same way in the new process as it does in the old process. The forked process gets its own copy of argv[].
Maybe you could do something like this
Code:#include <stdio.h>
int main(int argc, char *argv[])
{
argv[0] = "vvvv";
printf("%s\n", argv[0]);
return 0;
}