summaryrefslogtreecommitdiffstats
path: root/kinit/setproctitle.h
blob: 7a134e73ee5c898fe906f7948d50e932769531d7 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
 * Copyright (c) 1998 Sendmail, Inc.  All rights reserved.
 * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
 * Copyright (c) 1988, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * By using this file, you agree to the terms and conditions set
 * forth in the LICENSE file which can be found at the top level of
 * the sendmail distribution.
 * 
 * A copy of the above mentioned LICENSE file can be found in 
 * LICENSE.setproctitle.
 * 
 * Ported for use with KDE by Waldo Bastian <bastian@kde.org>
 */

#ifndef _SETPROCTITLE_H_
#define _SETPROCTITLE_H_

#ifdef __hpux
# define SPT_TYPE       SPT_PSTAT
#endif

#ifdef _AIX3
# define SPT_PADCHAR    '\0'    /* pad process title with nulls */
#endif

#ifdef _AIX4
# define SPT_PADCHAR    '\0'    /* pad process title with nulls */
#endif

#ifdef AIX                      /* AIX/RT compiler pre-defines this */
# define SPT_PADCHAR    '\0'    /* pad process title with nulls */
#endif

#ifdef DGUX_5_4_2
# define DGUX           1
#endif

#ifdef  DGUX
# define SPT_TYPE       SPT_NONE        /* don't use setproctitle */
#endif

/*
**  Apple Rhapsody
**      Contributed by Wilfredo Sanchez <wsanchez@apple.com>
*/

#ifdef __APPLE__
# define SPT_TYPE       SPT_PSSTRINGS
# define SPT_PADCHAR    '\0'    /* pad process title with nulls */
#endif

#if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__)
# define SPT_TYPE       SPT_PSSTRINGS   /* use PS_STRINGS pointer */
#endif

#ifdef __bsdi__
# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
/* version 1.1 or later */
#  undef SPT_TYPE
#  define SPT_TYPE      SPT_BUILTIN     /* setproctitle is in libc */
# else
/* version 1.0 or earlier */
#  define SPT_PADCHAR   '\0'    /* pad process title with nulls */
# endif
#endif

#if defined(__QNX__)
# define SPT_TYPE       SPT_REUSEARGV
# define SPT_PADCHAR    '\0'    /* pad process title with nulls */
#endif

#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
# if defined(__NetBSD__) || defined(__DragonFly__)
#  undef SPT_TYPE
#  define SPT_TYPE      SPT_BUILTIN     /* setproctitle is in libc */
# endif
# if defined(__FreeBSD__)
#  undef SPT_TYPE
#  if __FreeBSD__ >= 2
#   include <osreldate.h>
#   if __FreeBSD_version >= 199512      /* 2.2-current when it appeared */
#    include <sys/types.h>
#    include <libutil.h>
#    define SPT_TYPE    SPT_BUILTIN
#   endif
#  endif
#  ifndef SPT_TYPE
#   define SPT_TYPE     SPT_REUSEARGV
#   define SPT_PADCHAR  '\0'            /* pad process title with nulls */
#  endif
# endif
# if defined(__OpenBSD__)
#  undef SPT_TYPE
#  define SPT_TYPE      SPT_BUILTIN     /* setproctitle is in libc */
# endif
#endif

#ifdef __GNU_HURD__
# define SPT_TYPE       SPT_CHANGEARGV
#endif

/* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
#ifdef _SCO_unix_4_2
# define _SCO_unix_
#endif

/* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */
#ifdef _SCO_unix_
# define SPT_TYPE       SPT_SCO         /* write kernel u. area */
#endif


#ifdef __linux__
# define SPT_PADCHAR    '\0'            /* pad process title with nulls */
#endif

#ifdef _SEQUENT_
# define SPT_TYPE       SPT_NONE        /* don't use setproctitle */
#endif

#ifdef apollo
# define SPT_TYPE       SPT_NONE        /* don't use setproctitle */
#endif

#ifdef __svr5__
# define SPT_PADCHAR            '\0'    /* pad process title with nulls */
#endif
 
#ifdef NCR_MP_RAS2
# define SPT_TYPE  SPT_NONE
#endif

#ifdef NCR_MP_RAS3
# define SPT_TYPE       SPT_NONE
#endif
 
#ifdef sony_news
# ifndef __svr4
#  ifndef SPT_TYPE
#   define SPT_TYPE     SPT_SYSMIPS     /* use sysmips() (OS 6.0.2 or later) */
#  endif
# endif
#endif


extern void tdeinit_initsetproctitle(int, char **, char **);
extern void tdeinit_setproctitle(const char *, ...)
#ifdef __GNUC__
    __attribute__ (( format ( printf, 1, 2 ) ) )
#endif
;

#endif