Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

ost::Process Class Reference

A class for containing portable process related functions that help create portable code. Peocess wrapper class. More...

#include <process.h>

List of all members.

Public Types

typedef RETSIGTYPE(* Trap )(int)

Static Public Methods

void detach (void)
 Detach current process into a daemon, posix only.

Trap setPosixSignal (int signo, Trap handler)
 Set a posix compliant signal handler.

Trap setInterruptSignal (int signo, Trap handler)
 Set system call interuptable signal handler.

int spawn (const char *exec, const char **argv)
 Spawn a process and wait for it's exit code.

const char * getEnv (const char *name)
 Get system environment.

void setEnv (const char *name, const char *value, bool overwrite)
 Set system environment in a standard manner.


Detailed Description

A class for containing portable process related functions that help create portable code. Peocess wrapper class.

These are typically referenced thru Process::xxx static member functions. Many of these members are used both for win32 and posix systems although some may be platform specific.

Author:
David Sugar <dyfet@ostel.com>


Member Typedef Documentation

typedef RETSIGTYPE(* ost::Process::Trap)(int)
 


Member Function Documentation

void ost::Process::detach void    [static]
 

Detach current process into a daemon, posix only.

Perhaps a similar method can be used for creating win32 "services"?

const char* ost::Process::getEnv const char *    name [static]
 

Get system environment.

Returns:
system environ symbol.
Parameters:
name  of symbol.

void ost::Process::setEnv const char *    name,
const char *    value,
bool    overwrite
[static]
 

Set system environment in a standard manner.

Parameters:
name  of environment symbol to set.
value  of environment symbol.
overwrite  true if replace existing symbol.

Trap ost::Process::setInterruptSignal int    signo,
Trap    handler
[static]
 

Set system call interuptable signal handler.

return previous handler.

Parameters:
signo  signal no.
handler  trap handler.

Trap ost::Process::setPosixSignal int    signo,
Trap    handler
[static]
 

Set a posix compliant signal handler.

Returns:
previous handler.
Parameters:
signo  signal no.
handler  trap handler.

int ost::Process::spawn const char *    exec,
const char **    argv
[static]
 

Spawn a process and wait for it's exit code.

In win32 this is done with the spawn system call. In posix, this is done with a fork, an execvp, and a waitpid.

Returns:
error code from process.
Parameters:
exec  name of executable.
argv  list of command arguments.


The documentation for this class was generated from the following file:
Generated on Thu Nov 21 12:28:32 2002 for GNU CommonC++ by doxygen1.2.18