43 #ifndef COMMONCPP_PROCESS_H_
44 #define COMMONCPP_PROCESS_H_
46 #ifndef COMMONCPP_CONFIG_H_
47 #include <commoncpp/config.h>
50 #ifndef COMMONCPP_THREAD_H_
73 typedef void (*Trap)(int);
80 static void detach(
void);
89 static void attach(
const char *devname);
98 static Trap setPosixSignal(
int signo, Trap handler);
107 static Trap setInterruptSignal(
int signo, Trap handler);
117 bool lock(
bool future =
true);
141 static int spawn(
const char *exec,
const char **argv,
bool wait =
true);
150 static int join(
int pid);
159 static bool cancel(
int pid,
int sig = 0);
167 static const char *getEnv(
const char *name);
176 static void setEnv(
const char *name,
const char *value,
bool overwrite);
183 static const char *getConfigDir(
void);
190 static const char *getHomeDir(
void);
197 static const char *getUser(
void);
204 static bool setUser(
const char *
id,
bool grp =
true);
211 static bool setGroup(
const char *
id);
218 static size_t getPageSize(
void);
223 static void setPriority(
int pri);
228 static void setScheduler(
const char *policy);
233 static void setRealtime(
int pri = 0);
238 static bool isScheduler(
void);
293 bool lock(
const char *name);
void wait(barrier_t &barrier)
Convenience function to wait on a barrier.
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...
static bool isRealtime(void)
Return true if realtime scheduling.
void lock(ExclusiveAccess &object)
Convenience function to exclusively lock an object through it's protocol.
Common C++ thread class and sychronization objects.
void unlock(ExclusiveAccess &object)
Convenience function to unlock an exclusive object through it's protocol.
~Lockfile()
Destroy the current lock and release it.