3 * Copyright (c) 1990,1991 Regents of the University of Michigan.
6 * Redistribution and use in source and binary forms are permitted
7 * provided that this notice is preserved and that due credit is given
8 * to the University of Michigan at Ann Arbor. The name of the University
9 * may not be used to endorse or promote products derived from this
10 * software without specific prior written permission. This software
11 * is provided ``as is'' without express or implied warranty.
14 char **Argv; /* pointer to original (main's) argv */
15 int Argc; /* original argc */
18 * takes a printf-style format string (fmt) and up to three parameters (a,b,c)
19 * this clobbers the original argv...
23 setproctitle( fmt, a, b, c )
26 static char *endargv = (char *)0;
31 if ( endargv == (char *)0 ) {
32 /* set pointer to end of original argv */
33 endargv = Argv[ Argc-1 ] + strlen( Argv[ Argc-1 ] );
35 sprintf( buf, fmt, a, b, c );
36 /* make ps print "([prog name])" */
40 if ( i > endargv - s - 2 ) {
46 while ( s < endargv ) *s++ = ' ';
48 #endif /* NOSETPROCTITLE */