21 static void runCmd(std::string & cmd);
23 static char*
const*
dequeToArgv(std::deque<std::string> & argDeq);
25 static std::string
getOutputOf(
char *
const * argv);
26 static std::string
getOutputOf(std::deque<std::string> & argDeq);
27 static pid_t
StartPiped(
char *
const * argv,
int * fdin,
int * fdout,
int * fderr);
28 static pid_t
StartPiped(std::deque<std::string> & argDeq,
int * fdin,
int * fdout,
int * fderr);
29 static void Stop(pid_t name);
30 static void Murder(pid_t name);
static bool isActive(pid_t name)
Returns true if a process with this PID is currently active.
Definition: procs.cpp:395
static void childsig_handler(int signum)
Used internally to capture child signals and update plist.
Definition: procs.cpp:149
static void Murder(pid_t name)
Stops the process with this pid, if running.
Definition: procs.cpp:376
static void exit_handler()
Called at exit of any program that used a Start* function.
Definition: procs.cpp:49
static void setHandler()
Sets up exit and childsig handlers.
Definition: procs.cpp:135
static char *const * dequeToArgv(std::deque< std::string > &argDeq)
This function prepares a deque for getOutputOf and automatically inserts a NULL at the end of the cha...
Definition: procs.cpp:206
static bool handler_set
If true, the sigchld handler has been setup.
Definition: procs.h:18
Contains utility code, not directly related to streaming media.
Definition: bitfields.h:3
static void runCmd(std::string &cmd)
static void Stop(pid_t name)
Stops the process with this pid, if running.
Definition: procs.cpp:370
static pid_t StartPiped(char *const *argv, int *fdin, int *fdout, int *fderr)
Starts a new process with given fds if the name is not already active.
Definition: procs.cpp:235
static std::string getOutputOf(char *const *argv)
Runs the given command and returns the stdout output as a string.
Definition: procs.cpp:186
static void StopAll()
(Attempts to) stop all running child processes.
Definition: procs.cpp:381
static std::set< pid_t > plist
Holds active processes.
Definition: procs.h:17
static bool isRunning(pid_t pid)
sends sig 0 to process (pid). returns true if process is running
Definition: procs.cpp:41
Deals with spawning, monitoring and stopping child processes.
Definition: procs.h:15
static int Count()
Returns the number of active child processes.
Definition: procs.cpp:390