process-title.c revision abc014a64d1f63e01ea134700c67af4e098bf54f
/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "process-title.h"
#include <stdlib.h> /* NetBSD, OpenBSD */
#include <unistd.h> /* FreeBSD */
static char *process_name = NULL;
#ifdef HAVE_SETPROCTITLE
#endif
#ifdef PROCTITLE_HACK
#define PROCTITLE_CLEAR_CHAR 0xab
static char *process_title;
static void *argv_memblock, *environ_memblock;
{
char *last;
unsigned int i;
bool clear_env;
/* find the last argv or environment string. it should always be the
last string in environ, but don't rely on it. this is what openssh
does, so hopefully it's safe enough. */
}
}
process_title = argv[0];
/* if there are problems with this approach, try to make sure we
notice it */
if (clear_env) {
} else {
}
}
{
/* @UNSAFE */
void *memblock, *memblock_end;
char **new_argv;
unsigned int i, count;
*memblock_r = memblock;
for (i = 0; i < count; i++) {
}
return new_argv;
}
static void proctitle_hack_set(const char *title)
{
if (len >= process_title_len)
if (len < process_title_clean_pos) {
} else if (process_title_clean_pos != 0) {
}
}
#endif
void process_title_init(char **argv[])
{
#ifdef PROCTITLE_HACK
extern char **environ;
char **orig_environ = environ;
#endif
process_name = (*argv)[0];
}
{
#ifdef HAVE_SETPROCTITLE
else
#elif defined(PROCTITLE_HACK)
#endif
}
void process_title_deinit(void)
{
#ifdef PROCTITLE_HACK
#endif
}