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_ 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);
300 bool lock(
const char *name);
This class is used to create a "named" lock entity that can be used to control access to a resource b...
Common C++ thread class and sychronization objects.
A class for containing portable process related functions that help create portable code.
~Lockfile()
Destroy the current lock and release it.
static bool isRealtime(void)
Return true if realtime scheduling.