18#include <FreeNOS/User.h>
30 parser().
registerFlag(
'r',
"restart",
"Restart the given process(es) via recovery server");
42 for (
Size i = 0; i < positionals.
count(); i++)
44 const ProcessID pid = positionals[i]->getValue().toLong();
72 ERROR(
"no operation specified for PID: " << pid);
82 DEBUG(
"pid = " << pid);
87 ERROR(
"failed to stop PID " << pid <<
": result = " << (
int) result);
96 DEBUG(
"pid = " << pid);
101 ERROR(
"failed to resume PID " << pid <<
": result = " << (
int) result);
110 DEBUG(
"pid = " << pid);
116 ERROR(
"failed to restart PID " << pid <<
": result = " << (
int) result);
Result
Enumeration of generic kernel API result codes.
const ArgumentContainer & arguments() const
Get program arguments.
ArgumentParser & parser()
Get program arguments parser.
const Vector< Argument * > & getPositionals() const
Get positional arguments.
void setDescription(const String &desc)
Set program description.
Result registerPositional(const char *name, const char *description, Size count=1)
Register a positional argument.
Result registerFlag(char arg, const char *name, const char *description)
Register a flag Argument.
POSIX-compatible application.
RecoveryClient provides a simple interface to the local core's RecoveryServer.
Recovery::Result restartProcess(const ProcessID pid) const
Restart a process.
virtual Result exec()
Execute the application.
virtual ~SysControl()
Destructor.
Result restartProcess(const ProcessID pid) const
Restart the given process by its ID.
SysControl(int argc, char **argv)
Constructor.
Result resumeProcess(const ProcessID pid) const
Resume the given process by its ID.
Result stopProcess(const ProcessID pid) const
Stop the given process by its ID.
Vectors are dynamically resizeable Arrays.
virtual Size count() const
Returns the number of items inside the Vector.
API::Result ProcessCtl(const ProcessID proc, const ProcessOperation op, const Address addr=0, const Address output=0)
Prototype for user applications.
u32 ProcessID
Process Identification Number.
#define ERROR(msg)
Output an error message.
unsigned int Size
Any sane size indicator cannot go negative.
#define DEBUG(msg)
Output a debug message to standard output.