JX Application Framework
Loading...
Searching...
No Matches
Functions
jProcessUtil_UNIX.cpp File Reference
#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"
Include dependency graph for jProcessUtil_UNIX.cpp:

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)
 

Function Documentation

◆ JGetPGID()

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

◆ JRunProgram()

JError JRunProgram ( const JString cmd,
JString errOutput 
)

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.

◆ JSendSignalToGroup()

JError JSendSignalToGroup ( const pid_t  pgid,
const int  signal 
)

◆ JSetProcessPriority()

JError JSetProcessPriority ( const pid_t  pid,
const int  priority 
)