#include #include #include #include #include #include #include "setproctitle.h" # ifndef DEBUG # define DEBUG 0 # endif extern char *__progname, *__progname_full; extern char **environ; static char *title_buffer=0; static size_t title_buffer_size=0; static char *saved_argv=0; int setproctitle_max( void ) { return title_buffer_size; } int setproctitle( const char *buf, int len ) { if( !title_buffer || !title_buffer_size ) { errno = ENOMEM; return -1; } if( buf ) { len=len=0; i--) free( new_environ[i] ); free (new_environ); return 0; }