3 #ifndef HAVE_SETPROCTITLE
9 #if defined( HAVE_STDARG_H ) && __STDC__
15 #include <ac/setproctitle.h>
18 * Copyright (c) 1990,1991 Regents of the University of Michigan.
19 * All rights reserved.
21 * Redistribution and use in source and binary forms are permitted
22 * provided that this notice is preserved and that due credit is given
23 * to the University of Michigan at Ann Arbor. The name of the University
24 * may not be used to endorse or promote products derived from this
25 * software without specific prior written permission. This software
26 * is provided ``as is'' without express or implied warranty.
29 char **Argv; /* pointer to original (main's) argv */
30 int Argc; /* original argc */
33 * takes a printf-style format string (fmt) and up to three parameters (a,b,c)
34 * this clobbers the original argv...
39 #if defined( HAVE_STDARG_H ) && __STDC__
40 ( const char *fmt, ... )
47 static char *endargv = (char *)0;
53 #if defined( HAVE_STDARG_H ) && __STDC__
60 buf[sizeof(buf) - 1] = '\0';
61 vsnprintf( buf, sizeof(buf)-1, fmt, ap );
63 vsprintf( buf, fmt, ap ); /* hope it's not too long */
66 chokeme = "choke me! I don't have a doprnt() manual handy";
71 if ( endargv == (char *)0 ) {
72 /* set pointer to end of original argv */
73 endargv = Argv[ Argc-1 ] + strlen( Argv[ Argc-1 ] );
75 /* make ps print "([prog name])" */
79 if ( i > endargv - s - 2 ) {
85 while ( s < endargv ) *s++ = ' ';
87 #endif /* NOSETPROCTITLE */