/usr/src/openafs-1.6.1/include/afs/procmgmt.h is in openafs-modules-dkms 1.6.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | /*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
*/
#ifndef OPENAFS_PROCMGMT_H
#define OPENAFS_PROCMGMT_H
#ifdef AFS_NT40_ENV
/* Process management definitions for Windows NT */
#include <process.h>
/* ----------------- Processes ---------------- */
typedef int pid_t; /* process id type */
/* Wait status macros -- status returned in standard Unix format */
#define WIFEXITED(wstat) ((int)((wstat) & 0xFF) == 0)
#define WIFSIGNALED(wstat) ((int)((wstat) & 0xFF) != 0)
#define WEXITSTATUS(wstat) ((int)(((wstat) >> 8) & 0xFF))
#define WTERMSIG(wstat) ((int)((wstat) & 0xFF))
#define WCOREDUMP(wstat) ((int)0)
#define WEXITED_ENCODE(status) ((int)(((status) & 0xFF) << 8))
#define WSIGNALED_ENCODE(signo) ((int)((signo) & 0xFF))
/* Wait option macros */
#define WNOHANG 0x01
/* Process related data declarations */
#ifndef PMGTEXPORT
#define PMGTEXPORT __declspec(dllimport)
#endif
#define spawnDatap pmgt_spawnData
PMGTEXPORT extern void *pmgt_spawnData;
#define spawnDataLen pmgt_spawnDataLen
PMGTEXPORT extern size_t pmgt_spawnDataLen;
/* Process related function declarations */
#define PMGT_SPAWN_DETACHED_ENV_NAME "TransarcAfsPmgtSpawnDetached"
#define spawnprocveb(spath, sargv, senvp, sdatap, sdatalen) \
pmgt_ProcessSpawnVEB(spath, sargv, senvp, sdatap, sdatalen)
#define spawnprocve(spath, sargv, senvp, estatus) \
pmgt_ProcessSpawnVEB(spath, sargv, senvp, NULL, 0)
#define spawnprocv(spath, sargv, estatus) \
pmgt_ProcessSpawnVEB(spath, sargv, NULL, NULL, 0)
extern pid_t pmgt_ProcessSpawnVEB(const char *spath, char **sargv,
char **senvp, void *sdatap,
size_t sdatalen);
#define waitpid(pid, statusP, options) \
pmgt_ProcessWaitPid(pid, statusP, options)
#define wait(statusP) \
pmgt_ProcessWaitPid((pid_t)-1, statusP, 0)
extern pid_t pmgt_ProcessWaitPid(pid_t pid, int *statusP, int options);
/* ----------------- Signals ---------------- */
/* Attempt to override Microsoft (MSVC) signal definitions */
#ifndef _INC_SIGNAL
#define _INC_SIGNAL
#else
#error "Windows requires custom signal definitions; do not include signal.h."
#endif
/* Supported signals
* Support is provided for a subset of the standard Unix signals.
* Note that Windows NT (via the MSVC runtime) will NOT generate signals
* in response to most HW faults or terminal activity; in particular,
* Windows NT will NOT generate SIGILL, SIGSEGV, SIGINT, or SIGTERM.
*/
#define SIGHUP 1 /* hangup */
#define SIGINT 2 /* interrupt */
#define SIGQUIT 3 /* quit */
#define SIGILL 4 /* illegal instruction */
#define SIGABRT 6 /* abnormal termination triggered by abort() */
#define SIGFPE 8 /* floating point exception */
#define SIGKILL 9 /* kill */
#define SIGSEGV 11 /* segmentation violation */
#define SIGTERM 15 /* software termination signal from kill */
#define SIGUSR1 16 /* user defined signal 1 */
#define SIGUSR2 17 /* user defined signal 2 */
#define SIGCLD 18 /* child status change - alias for compatability */
#define SIGCHLD 18 /* child status change */
#define SIGTSTP 24 /* user stop requested from tty */
#define NSIG 25 /* max signal number + 1 (sig set macros presume <= 33) */
/* Signal actions */
#define SIG_ERR ((void (__cdecl *)(int))-1) /* signal() error value */
#define SIG_DFL ((void (__cdecl *)(int))0) /* default signal action */
#define SIG_IGN ((void (__cdecl *)(int))1) /* ignore signal */
/* Signal set type and set manipulation macros */
typedef unsigned int sigset_t;
#define sigsetbit(signo) ((unsigned int)1 << (((signo) - 1) & (32 - 1)))
#define sigemptyset(setP) ((*(setP) = 0) ? 0 : 0)
#define sigfillset(setP) ((*(setP) = ~(unsigned int)0) ? 0 : 0)
#define sigaddset(setP, signo) ((*(setP) |= sigsetbit(signo)) ? 0 : 0)
#define sigdelset(setP, signo) ((*(setP) &= ~sigsetbit(signo)) ? 0 : 0)
#define sigismember(setP, signo) ((*(setP) & sigsetbit(signo)) ? 1 : 0)
/* Sigaction type and related macros */
struct sigaction {
void (__cdecl * sa_handler) (int);
sigset_t sa_mask;
int sa_flags;
};
#define SA_RESETHAND 0x00000001
/* Signal related function declarations */
#define sigaction(signo, actP, oactP) pmgt_SigactionSet(signo, actP, oactP)
extern int pmgt_SigactionSet(int signo, const struct sigaction *actionP,
struct sigaction *old_actionP);
#define signal(signo, dispP) pmgt_SignalSet(signo, dispP)
extern void (__cdecl *
pmgt_SignalSet(int signo, void (__cdecl * dispP) (int))) (int);
#define raise(signo) pmgt_SignalRaiseLocal(signo)
extern int pmgt_SignalRaiseLocal(int signo);
#define kill(pid, signo) pmgt_SignalRaiseRemote(pid, signo)
extern int pmgt_SignalRaiseRemote(pid_t pid, int signo);
#else
/* Process management definitions for Unix */
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <unistd.h>
/* ----------------- Processes ---------------- */
#define spawnprocve(spath, sargv, senvp, estatus) \
pmgt_ProcessSpawnVE(spath, sargv, senvp, estatus)
#define spawnprocv(spath, sargv, estatus) \
pmgt_ProcessSpawnVE(spath, sargv, NULL, estatus)
extern pid_t pmgt_ProcessSpawnVE(const char *spath, char **sargv,
char **senvp, int estatus);
#endif /* AFS_NT40_ENV */
#endif /* OPENAFS_PROCMGMT_H */
|