File: setproctitle.h

package info (click to toggle)
prayer 1.3.5-dfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,576 kB
  • sloc: ansic: 43,161; makefile: 817; sh: 445; perl: 166
file content (47 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* $Cambridge: hermes/src/prayer/lib/setproctitle.h,v 1.3 2008/09/16 09:59:57 dpc22 Exp $ */
/************************************************
 *    Prayer - a Webmail Interface              *
 ************************************************/

/* Copyright (c) University of Cambridge 2000 - 2008 */
/* See the file NOTICE for conditions of use and distribution. */

#include <sys/param.h>

#if defined(__GNU__)
# define SPT_TYPE       SPT_CHANGEARGV
#elif defined(__linux__)
# define SPT_TYPE	SPT_REUSEARGV
# define SPT_PADCHAR	'\0'    /* pad process title with nulls */
#elif (defined(BSD) && BSD >= 199306)
# define SPT_TYPE	SPT_BUILTIN
#else
#define SPT_TYPE        SPT_NONE
#endif

/* Following code has been stolen from sendmail 8.9.3: src/conf.[ch] */

#define MAXLINE	2048            /* max line length */
#define SPACELEFT(buf, ptr)  (sizeof buf - ((ptr) - buf))

# ifdef __STDC__

# include <stdarg.h>

# define VA_LOCAL_DECL	va_list ap;
# define VA_START(f)	va_start(ap, f)
# define VA_END		va_end(ap)

# else

# include <varargs.h>

# define VA_LOCAL_DECL	va_list ap;
# define VA_START(f)	va_start(ap)
# define VA_END		va_end(ap)

# endif

void initsetproctitle(const char *name, int argc, char **argv,
                      char **envp);
void setproctitle(const char *fmt, ...);