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_
74 typedef void (*Trap)(int);
81 static void detach(
void);
90 static void attach(
const char *devname);
99 static Trap setPosixSignal(
int signo, Trap handler);
108 static Trap setInterruptSignal(
int signo, Trap handler);
118 bool lock(
bool future =
true);
142 static int spawn(
const char *exec,
const char **argv,
bool wait =
true);
151 static int join(
int pid);
160 static bool cancel(
int pid,
int sig = 0);
168 static const char *getEnv(
const char *name);
177 static void setEnv(
const char *name,
const char *value,
bool overwrite);
184 static const char *getConfigDir(
void);
191 static const char *getHomeDir(
void);
198 static const char *getUser(
void);
205 static bool setUser(
const char *
id,
bool grp =
true);
212 static bool setGroup(
const char *
id);
219 static size_t getPageSize(
void);
224 static void setPriority(
int pri);
229 static void setScheduler(
const char *policy);
234 static void setRealtime(
int pri = 0);
239 static bool isScheduler(
void);
294 bool lock(
const char *name);
A class for containing portable process related functions that help create portable code...
This class is used to create a "named" lock entity that can be used to control access to a resource b...
void unlock(ExclusiveAccess &object)
Convenience function to unlock an exclusive object through it's protocol.
static bool isRealtime(void)
Return true if realtime scheduling.
Common C++ thread class and sychronization objects.
~Lockfile()
Destroy the current lock and release it.
void wait(barrier_t &barrier)
Convenience function to wait on a barrier.
void lock(ExclusiveAccess &object)
Convenience function to exclusively lock an object through it's protocol.