44 #ifndef COMMONCPP_PROCESS_H_
45 #define COMMONCPP_PROCESS_H_
47 #ifndef COMMONCPP_CONFIG_H_
48 #include <commoncpp/config.h>
51 #ifndef COMMONCPP_THREAD_H_
67 class __EXPORT Process
72 __DELETE_DEFAULTS(Process);
76 typedef void (*Trap)(int);
83 static void detach(
void);
92 static void attach(
const char *devname);
101 static Trap setPosixSignal(
int signo, Trap handler);
110 static Trap setInterruptSignal(
int signo, Trap handler);
120 bool lock(
bool future =
true);
144 static int spawn(
const char *exec,
const char **argv,
bool wait =
true);
153 static int join(
int pid);
162 static bool cancel(
int pid,
int sig = 0);
170 static const char *getEnv(
const char *name);
179 static void setEnv(
const char *name,
const char *value,
bool overwrite);
186 static const char *getConfigDir(
void);
193 static const char *getHomeDir(
void);
200 static const char *getUser(
void);
207 static bool setUser(
const char *
id,
bool grp =
true);
214 static bool setGroup(
const char *
id);
221 static size_t getPageSize(
void);
226 static void setPriority(
int pri);
231 static void setScheduler(
const char *policy);
236 static void setRealtime(
int pri = 0);
241 static bool isScheduler(
void);
246 static inline bool isRealtime(
void) {
260 class __EXPORT Lockfile
270 __DELETE_COPY(Lockfile);
278 Lockfile(
const char *name);
300 bool lock(
const char *name);
Common C++ thread class and sychronization objects.