diff -ur src/modules/system.orig/configure.in src/modules/system/configure.in --- src/modules/system.orig/configure.in Tue Mar 7 15:37:49 2006 +++ src/modules/system/configure.in Tue Mar 7 15:37:12 2006 @@ -95,7 +95,7 @@ getgrnam_r getgrent_r getgrgid_r \ getpwnam_r getpwent_r getpwuid_r \ getspnam_r innetgr utime sleep usleep nanosleep \ - getrlimit setrlimit \ + getrlimit setrlimit setproctitle \ setitimer getitimer mmap munmap \ gettimeofday settimeofday prctl inet_ntoa inet_ntop getaddrinfo) diff -ur src/modules/system.orig/system.c src/modules/system/system.c --- src/modules/system.orig/system.c Tue Mar 7 15:37:49 2006 +++ src/modules/system/system.c Tue Mar 7 15:32:38 2006 @@ -2557,6 +2557,26 @@ } #endif +#ifdef HAVE_SETPROCTITLE +/*! @decl void setproctitle(string title, mixed ... extras) + *! Sets the processes title. + */ +void f_setproctitle(INT32 args) +{ + if (args < 1) + wrong_number_of_args_error("setproctitle", args, 1); + if (Pike_sp[0-args].type != PIKE_T_STRING) + SIMPLE_BAD_ARG_ERROR("setproctitle", 1, "string"); + + if (args > 1) { + f_sprintf(args); + args = 1; + } + setproctitle("%s", Pike_sp[0 - args].u.string->str); + pop_n_elems(args); +} +#endif + /*! @decl constant ITIMER_REAL *! Identifier for a timer that decrements in real time. *! @seealso @@ -3169,6 +3189,10 @@ ADD_FUNCTION2("setrlimit", f_setrlimit, tFunc(tString tInt tInt, tInt01), 0, OPT_SIDE_EFFECT); #endif + + ADD_FUNCTION2("setproctitle", f_setproctitle, tFuncV(tString, tMix, tVoid), + 0, OPT_SIDE_EFFECT); + #ifdef HAVE_CHROOT diff -ur src/modules/system.orig/system_machine.h.in src/modules/system/system_machine.h.in --- src/modules/system.orig/system_machine.h.in Tue Mar 7 15:37:49 2006 +++ src/modules/system/system_machine.h.in Tue Mar 7 15:36:07 2006 @@ -242,6 +242,9 @@ /* Define if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT +/* Define if you have the `setproctitle' function. */ +#undef HAVE_SETPROCTITLE + /* Define if you have the `setsid' function. */ #undef HAVE_SETSID