systemprocess Class Reference

Run external commands. More...

#include <process.h>

Inheritance diagram for systemprocess:
Inheritance graph
[legend]
Collaboration diagram for systemprocess:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 systemprocess (const string &mcommand, bool withStdErr=false, const string &asUser="")
 systemprocess (const value &args, bool withStdErr=false, const string &asUser="")
 systemprocess (const value &args, const value &env, bool withStdErr=false)
virtual ~systemprocess (void)
void settargetuid (uid_t ruid)
void settargetgid (gid_t rgid)
void initargs (void)
virtual int main (void)

Protected Member Functions

bool settargetuser (const string &uname)

Protected Attributes

value _argv
value _env
uid_t tuid
uid_t teuid
gid_t tgid
gid_t tegid
argptr * envp
argptr * argp
string cpath

Detailed Description

Run external commands.

Accepts a unix path/command with command line arguments and executes the command as a child process.


Constructor & Destructor Documentation

systemprocess::systemprocess ( const string mcommand,
bool  withStdErr = false,
const string asUser = "" 
) [inline]

Constructor.

Parameters:
mcommand The command string
withStdErr True if the stderr channel should be caught.
asUser The user to switch to in the child process.

References _argv, process::init(), strutil::splitquoted(), tegid, teuid, tgid, and tuid.

Here is the call graph for this function:

systemprocess::systemprocess ( const value args,
bool  withStdErr = false,
const string asUser = "" 
) [inline]

Constructor.

Parameters:
args The command + arguments array.
withStdErr True if the stderr channel should be caught.
asUser The user to switch to in the child process.

References _argv, process::init(), tegid, teuid, tgid, and tuid.

Here is the call graph for this function:

systemprocess::systemprocess ( const value args,
const value env,
bool  withStdErr = false 
) [inline]

Constructor.

Parameters:
args The command + arguments array.
env The environment variables.
withStdErr True if the stderr channel should be caught.

References _argv, _env, process::init(), tegid, teuid, tgid, and tuid.

Here is the call graph for this function:


Member Function Documentation

virtual int systemprocess::main ( void   )  [inline, virtual]

Child process.

Creates an argument list, resolves the path to the file and uses plain old execv() to do the dirty work.

Returns:
Process return-value.

Reimplemented from process.

References argp, cpath, envp, process::fout, file::printf(), string::str(), tegid, teuid, tgid, and tuid.

Here is the call graph for this function:


The documentation for this class was generated from the following file:

Generated on Sun Feb 28 10:36:48 2010 for GRACE by  doxygen 1.6.1