process-title.c revision 8afe3f0e832b8b3483b692205bbd59c0110a20fd
/* Copyright (c) 2002-2003 Timo Sirainen */
/*
LINUX_PROCTITLE_HACK code from:
*/
#include "lib.h"
#include "process-title.h"
#include <stdlib.h> /* NetBSD, OpenBSD */
#include <unistd.h> /* FreeBSD */
/* NOTE: This really is a horrible hack, I don't recommend using it for
anything else than debugging. */
/*#define LINUX_PROCTITLE_HACK*/
static char *process_name = NULL;
#ifdef LINUX_PROCTITLE_HACK
static char *process_title;
static size_t process_title_len;
{
extern char **environ;
char **p;
int i;
/* copy environment elsewhere */
;
environ = p;
}
/* memory is allocated so that argv[] comes first, environment next.
Calculate the max. size for process name with by checking the
address for last environment and it's length. */
process_title = argv[0];
}
static void linux_proctitle_set(const char *title)
{
}
#endif
char *envp[] __attr_unused__)
{
#ifdef LINUX_PROCTITLE_HACK
#endif
process_name = argv[0];
}
{
#ifdef HAVE_SETPROCTITLE
else
#elif defined(LINUX_PROCTITLE_HACK)
#endif
}