3 #ifndef HAVE_SETPROCTITLE
8 #include <ac/setproctitle.h>
10 #include <ac/stdarg.h>
13 * Copyright (c) 1990,1991 Regents of the University of Michigan.
14 * All rights reserved.
16 * Redistribution and use in source and binary forms are permitted
17 * provided that this notice is preserved and that due credit is given
18 * to the University of Michigan at Ann Arbor. The name of the University
19 * may not be used to endorse or promote products derived from this
20 * software without specific prior written permission. This software
21 * is provided ``as is'' without express or implied warranty.
24 char **Argv; /* pointer to original (main's) argv */
25 int Argc; /* original argc */
28 * takes a printf-style format string (fmt) and up to three parameters (a,b,c)
29 * this clobbers the original argv...
34 #if defined( HAVE_STDARG )
35 ( const char *fmt, ... )
42 static char *endargv = (char *)0;
48 #if defined( HAVE_STDARG )
55 buf[sizeof(buf) - 1] = '\0';
56 vsnprintf( buf, sizeof(buf)-1, fmt, ap );
58 vsprintf( buf, fmt, ap ); /* hope it's not too long */
61 chokeme = "choke me! I don't have a doprnt() manual handy";
66 if ( endargv == (char *)0 ) {
67 /* set pointer to end of original argv */
68 endargv = Argv[ Argc-1 ] + strlen( Argv[ Argc-1 ] );
70 /* make ps print "([prog name])" */
74 if ( i > endargv - s - 2 ) {
80 while ( s < endargv ) *s++ = ' ';
82 #endif /* NOSETPROCTITLE */