JX Application Framework
|
#include "jProcessUtil.h"
#include "JThisProcess.h"
#include "JProcessError.h"
#include "JStdError.h"
#include "JString.h"
#include "jErrno.h"
#include "jStreamUtil.h"
#include "jFileUtil.h"
#include <sys/resource.h>
#include "jAssert.h"
Functions | |
JError | JRunProgram (const JString &cmd, JString *errOutput) |
JError | JSetProcessPriority (const pid_t pid, const int priority) |
JError | JSendSignalToGroup (const pid_t pgid, const int signal) |
JError | JGetPGID (const pid_t pid, pid_t *pgid) |
JError JGetPGID | ( | const pid_t | pid, |
pid_t * | pgid | ||
) |
On FreeBSD, getpgid() isn't implemented because POSIX decided that it wasn't necessary since shells don't need it! Morons!
So we use the proc file system's 'status' file, which has the format
name pid ppid pgid ...
FreeBSD implementation written by Ivan Pascal pasca.nosp@m.l@in.nosp@m.fo.ts.nosp@m.u.ru
This convenience function runs the specified command and blocks until it finishes. If the program prints anything to stderr, *errOutput contains the text.
If you don't want to block, use JSimpleProcess.
JError JSendSignalToGroup | ( | const pid_t | pgid, |
const int | signal | ||
) |
JError JSetProcessPriority | ( | const pid_t | pid, |
const int | priority | ||
) |