35 static char **old_argv;
50 char *new_progname, *new_progname_full;
60 environ = g_malloc0 (
sizeof (
char *) * (i + 1));
64 for (i = 0; envp[i]; i++)
65 environ[i] = g_strdup (envp[i]);
70 argv_len = envp[i-1] + strlen (envp[i-1]) - old_argv[0];
72 argv_len = old_argv[argc-1] + strlen (old_argv[argc-1]) - old_argv[0];
87 proctitle_set_args (
const char *new_title, va_list args)
96 formatted = g_strdup_vprintf (new_title, args);
98 i = strlen (formatted);
104 bzero (old_argv[0], argv_len);
105 strcpy (old_argv[0], formatted);
121 va_start (args, new_title);
122 proctitle_set_args (new_title, args);
const char * __progname_full
void proctitle_init(int argc, char **argv)
Initializes the process setting variables.
void proctitle_set(const char *new_title,...)
Sets the process' title.