setproctitle.h
00001 /* 00002 * Copyright (c) 1998 Sendmail, Inc. All rights reserved. 00003 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 00004 * Copyright (c) 1988, 1993 00005 * The Regents of the University of California. All rights reserved. 00006 * 00007 * By using this file, you agree to the terms and conditions set 00008 * forth in the LICENSE file which can be found at the top level of 00009 * the sendmail distribution. 00010 * 00011 * A copy of the above mentioned LICENSE file can be found in 00012 * LICENSE.setproctitle. 00013 * 00014 * Ported for use with KDE by Waldo Bastian <bastian@kde.org> 00015 */ 00016 00017 #ifndef _SETPROCTITLE_H_ 00018 #define _SETPROCTITLE_H_ 00019 00020 #ifdef __hpux 00021 # define SPT_TYPE SPT_PSTAT 00022 #endif 00023 00024 #ifdef _AIX3 00025 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00026 #endif 00027 00028 #ifdef _AIX4 00029 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00030 #endif 00031 00032 #ifdef AIX /* AIX/RT compiler pre-defines this */ 00033 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00034 #endif 00035 00036 #ifdef DGUX_5_4_2 00037 # define DGUX 1 00038 #endif 00039 00040 #ifdef DGUX 00041 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 00042 #endif 00043 00044 /* 00045 ** Apple Rhapsody 00046 ** Contributed by Wilfredo Sanchez <wsanchez@apple.com> 00047 */ 00048 00049 #ifdef __APPLE__ 00050 # define SPT_TYPE SPT_PSSTRINGS 00051 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00052 #endif 00053 00054 #if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) 00055 # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ 00056 #endif 00057 00058 #ifdef __bsdi__ 00059 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 00060 /* version 1.1 or later */ 00061 # undef SPT_TYPE 00062 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 00063 # else 00064 /* version 1.0 or earlier */ 00065 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00066 # endif 00067 #endif 00068 00069 #if defined(__QNX__) 00070 # define SPT_TYPE SPT_REUSEARGV 00071 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00072 #endif 00073 00074 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) 00075 # if defined(__NetBSD__) || defined(__DragonFly__) 00076 # undef SPT_TYPE 00077 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 00078 # endif 00079 # if defined(__FreeBSD__) 00080 # undef SPT_TYPE 00081 # if __FreeBSD__ >= 2 00082 # include <osreldate.h> 00083 # if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */ 00084 # include <sys/types.h> 00085 # include <libutil.h> 00086 # define SPT_TYPE SPT_BUILTIN 00087 # endif 00088 # endif 00089 # ifndef SPT_TYPE 00090 # define SPT_TYPE SPT_REUSEARGV 00091 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00092 # endif 00093 # endif 00094 # if defined(__OpenBSD__) 00095 # undef SPT_TYPE 00096 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 00097 # endif 00098 #endif 00099 00100 #ifdef __GNU_HURD__ 00101 # define SPT_TYPE SPT_CHANGEARGV 00102 #endif 00103 00104 /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */ 00105 #ifdef _SCO_unix_4_2 00106 # define _SCO_unix_ 00107 #endif 00108 00109 /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */ 00110 #ifdef _SCO_unix_ 00111 # define SPT_TYPE SPT_SCO /* write kernel u. area */ 00112 #endif 00113 00114 00115 #ifdef __linux__ 00116 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00117 #endif 00118 00119 #ifdef _SEQUENT_ 00120 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 00121 #endif 00122 00123 #ifdef apollo 00124 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 00125 #endif 00126 00127 #ifdef __svr5__ 00128 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 00129 #endif 00130 00131 #ifdef NCR_MP_RAS2 00132 # define SPT_TYPE SPT_NONE 00133 #endif 00134 00135 #ifdef NCR_MP_RAS3 00136 # define SPT_TYPE SPT_NONE 00137 #endif 00138 00139 #ifdef sony_news 00140 # ifndef __svr4 00141 # ifndef SPT_TYPE 00142 # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ 00143 # endif 00144 # endif 00145 #endif 00146 00147 00148 extern void tdeinit_initsetproctitle(int, char **, char **); 00149 extern void tdeinit_setproctitle(const char *, ...) 00150 #ifdef __GNUC__ 00151 __attribute__ (( format ( printf, 1, 2 ) ) ) 00152 #endif 00153 ; 00154 00155 #endif 00156