Go to the documentation of this file.
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 restartProcess(const ProcessID pid) const
Restart the given process by its ID.
Result
Enumeration of generic kernel API result codes.
Recovery::Result restartProcess(const ProcessID pid) const
Restart a process.
SysControl(int argc, char **argv)
Constructor.
u32 ProcessID
Process Identification Number.
POSIX-compatible application.
Result resumeProcess(const ProcessID pid) const
Resume the given process by its ID.
const ArgumentContainer & arguments() const
Get program arguments.
void setDescription(const String &desc)
Set program description.
RecoveryClient provides a simple interface to the local core's RecoveryServer.
API::Result ProcessCtl(const ProcessID proc, const ProcessOperation op, const Address addr=0, const Address output=0)
Prototype for user applications.
#define DEBUG(msg)
Output a debug message to standard output.
virtual ~SysControl()
Destructor.
virtual Size count() const
Returns the number of items inside the Vector.
unsigned int Size
Any sane size indicator cannot go negative.
Result registerFlag(char arg, const char *name, const char *description)
Register a flag Argument.
Result registerPositional(const char *name, const char *description, Size count=1)
Register a positional argument.
ArgumentParser & parser()
Get program arguments parser.
#define ERROR(msg)
Output an error message.
Result stopProcess(const ProcessID pid) const
Stop the given process by its ID.
virtual Result exec()
Execute the application.
const Vector< Argument * > & getPositionals() const
Get positional arguments.