|
| Process ()=default |
| Create a null sub-process.
|
|
| Process (const String &command) |
| Start a new sub-process executing command (executable path + arguments)
|
|
| Process (const Command &command) |
| Start a new sub-process executing command.
|
|
int | id () const |
| Process ID of the sub-process
|
|
int | wait () |
| Wait for sub-process termination and return exit status.
|
|
IoStream | input () const |
| Standard input of sub-process.
|
|
IoStream | output () const |
| Standard output of sub-process.
|
|
IoStream | error () const |
| Standard error of sub-process.
|
|
| Object ()=default |
| Create a null object.
|
|
| operator bool () const |
| Check if this is a non-null object.
|
|
bool | isNull () const |
| Check if this is a null object.
|
|
template<class T > |
bool | is () const |
| Check if this object is of type T.
|
|
template<class T > |
T | as () const |
| Cast this object to type T.
|
|
bool | isWeak () const |
| Check if the underlying object reference is weak.
|
|
bool | operator== (const Object &other) const |
| Equality operator.
|
|
std::strong_ordering | operator<=> (const Object &other) const |
| Ordering operator.
|
|
long | useCount () const |
| Reference count.
|
|
|
static int | exec (const String &command) |
| Start process and wait for its completion (convenience method)
|
|
static int | exec (const List< String > &args) |
| Start process and wait for its completion (convenience method)
|
|
static bool | isSignaled (int status) |
| Check if exit status indicates termination by an unhandled signal.
|
|
static Signal | signalNumber (int status) |
| Translate status to signal number.
|
|
static void | kill (int pid, Signal signal=Signal::Terminate) |
| Send signal to process with ID pid.
|
|
static void | killGroup (int gid, Signal signal=Signal::Terminate) |
| Send signal to process group with ID gid.
|
|
static void | raise (Signal signal) |
| Send a signal to the calling process.
|
|
static void | exit (int status) |
| Terminate this process with exit code status [0, 255].
|
|
static int | currentId () |
| Get current process ID.
|
|
static int | parentId () |
| Get parent process ID.
|
|
static String | execPath () |
| Get the file path of the currently running executable.
|
|
static String | env (const String &name) |
| Get environment variable by name.
|
|
static String | env (const String &name, const String &fallback) |
| Get environment variable by name and if undefined return fallback.
|
|
static void | setEnv (const String &name, const String &value) |
| Set environment variable name to value
|
|
static void | unsetEnv (const String &name) |
| Unset environment variable name to an undefined value.
|
|
static Map< String > | envMap () |
| Get the current environment map.
|
|
static String | cwd () |
| Get the current working directory.
|
|
static void | cd (const String &path) |
| Set the current working directory to path
|
|
static void | setUserMask (FileMode newMask, Out< FileMode > oldMask=None{}) |
| Set the file mode creation mask to newMask and optionally return the old mask in oldMask
|
|
static int | realUserId () |
| Get the real user ID.
|
|
static int | realGroupId () |
| Get the real group ID.
|
|
static int | effectiveUserId () |
| Get the effective user ID.
|
|
static int | effectiveGroupId () |
| Get the effective group ID.
|
|
static bool | isSuperUser () |
| Check for super-user.
|
|
static void | setUserId (int uid) |
| Set user ID to uid
|
|
static void | setGroupId (int gid) |
| Set the group ID to gid
|
|
static void | setEffectiveUserId (int uid) |
| Set the effective user ID to uid
|
|
static void | setEffectiveGroupId (int gid) |
| Set the effective group ID to gid
|
|
static void | daemonize () |
| Daemonize this process.
|
|
static bool | isDaemonized () |
| Check if daemonized.
|
|
static void | startSession () |
| Start a new login session.
|
|
|
template<class T > |
T | weak () const |
|
template<class T > |
void | initOnce () |
| Create the object state when called the first time.
|
|
template<class T > |
void | initOncePerThread () |
| Create a distinct object state for each thread when called the first time in that thread.
|
|
| Object (State *newState) |
| Initialize object with newState.
|
|
| Object (State *state, Alias) |
|
| Object (State *state, Weak) |
|
Object & | operator= (std::nullptr_t) |
|
template<class T > |
static T | alias (const State *state) |
| Create an alias object for the given state.
|
|
template<class T > |
static T | weak (const State *state) |
|
Handle< State > | me |
| Internal object state
|
|
Process creation and current process state
- Exceptions
-