HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Spawn.h File Reference
#include "UT_API.h"
#include <SYS/SYS_Types.h>
#include "UT_SysClone.h"
+ Include dependency graph for UT_Spawn.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UT_SystemWaitLoop
 

Macros

#define INVALID_PID   (pid_t)-1
 

Typedefs

typedef void(* UTsysWaitLoop )(int state)
 

Functions

bool UTisValidPid (pid_t pid)
 
UT_API int UTchangeProcessGroup (pid_t pid, pid_t gpid)
 
UT_API pid_t UTspawnvp (const char *const *args, int detachConsole=0, bool ignore_output=false, bool change_process_group=false)
 
UT_API pid_t UTspawn (const char *string, int detachConsole=0, bool ignore_output=false, bool change_process_group=false)
 
UT_API int UTwait (pid_t pid)
 
UT_API bool UTwait (pid_t pid, int &exit_code)
 
UT_API int UTisRunning (pid_t pid, int *exit_code)
 
UT_API int UTisAnyProcessRunning (pid_t pid)
 
UT_API bool UTcheckProcessId (pid_t pid)
 
UT_API pid_t UTbackground (const char *name, int full_daemon=0)
 
UT_API void UTforeground (const char *name="Console")
 
UT_API void UTkill (pid_t pid, bool kill_tree=false)
 
UT_API void UTkill (pid_t pid, bool kill_tree, bool dump_stack)
 
UT_API void UTterminate (pid_t pid, bool terminate_tree=false)
 

Macro Definition Documentation

#define INVALID_PID   (pid_t)-1

Definition at line 21 of file UT_Spawn.h.

Typedef Documentation

typedef void(* UTsysWaitLoop)(int state)

Definition at line 23 of file UT_Spawn.h.

Function Documentation

UT_API pid_t UTbackground ( const char *  name,
int  full_daemon = 0 
)
UT_API int UTchangeProcessGroup ( pid_t  pid,
pid_t  gpid 
)

Set process group ID for a given pid. With pid==0 and gpid==0 this will set a new process group for the current process.

Returns
0 if successful or -1 on error.
UT_API bool UTcheckProcessId ( pid_t  pid)
UT_API void UTforeground ( const char *  name = "Console")
UT_API int UTisAnyProcessRunning ( pid_t  pid)
UT_API int UTisRunning ( pid_t  pid,
int exit_code 
)
bool UTisValidPid ( pid_t  pid)
inline

Definition at line 39 of file UT_Spawn.h.

UT_API void UTkill ( pid_t  pid,
bool  kill_tree = false 
)

Kill a process (using SIGKILL on Irix/Linux, TerminateProcess on NT). The NT version also closes the process handle.

UT_API void UTkill ( pid_t  pid,
bool  kill_tree,
bool  dump_stack 
)

Kill a process (using SIGKILL on Irix/Linux, TerminateProcess on NT), attempting to do a stack trace on the (parent) process to stderr. The NT version also closes the process handle

UT_API pid_t UTspawn ( const char *  string,
int  detachConsole = 0,
bool  ignore_output = false,
bool  change_process_group = false 
)
UT_API pid_t UTspawnvp ( const char *const *  args,
int  detachConsole = 0,
bool  ignore_output = false,
bool  change_process_group = false 
)
UT_API void UTterminate ( pid_t  pid,
bool  terminate_tree = false 
)

Kills a process (using SIGTERM on Irix/Linux, TerminateProcess on NT) The NT version also closes the process handle.

UT_API int UTwait ( pid_t  pid)
UT_API bool UTwait ( pid_t  pid,
int exit_code 
)

Wait for a spawned process to exit. If the wait system call is interrupted, the exit status will not be written and the function will return false.