summaryrefslogtreecommitdiff
path: root/Source/Library/Userland/Binding/Process.class.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Userland/Binding/Process.class.h')
-rw-r--r--Source/Library/Userland/Binding/Process.class.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h
index 9687ea9..a3fc569 100644
--- a/Source/Library/Userland/Binding/Process.class.h
+++ b/Source/Library/Userland/Binding/Process.class.h
@@ -2,6 +2,7 @@
#define DEF_PROCESS_CLASS_H
#include <Syscall/RessourceCaller.class.h>
+#include <Binding/VirtualTerminal.class.h>
#include <Process.iface.h>
#include <String.class.h>
@@ -12,6 +13,9 @@ class Process : public RessourceCaller {
u32int id = RessourceCaller::sCall(PRIF_OBJTYPE, PRIF_SGETCPR);
return Process(id);
}
+ static Process run(const String& app) {
+ return Process(sCall(PRIF_OBJTYPE, PRIF_SRUN, (u32int)&app));
+ }
Process(u32int id) : RessourceCaller(id, PRIF_OBJTYPE) {}
void exit() {
@@ -35,6 +39,24 @@ class Process : public RessourceCaller {
String argv(u32int idx) {
return String::unserialize(doCall(PRIF_ARGV, idx));
}
+ void start() {
+ doCall(PRIF_START);
+ }
+ s32int wait() {
+ return sCall(PRIF_OBJTYPE, PRIF_SWAIT, resId());
+ }
+ void autoDelete(bool ad = true) {
+ doCall(PRIF_AUTODELETE, (ad ? 1 : 0));
+ }
+ void pushArg(const String& arg) {
+ doCall(PRIF_PUSHARG, (u32int)&arg);
+ }
+ void setInVT(VirtualTerminal vt) {
+ doCall(PRIF_SETINVT, vt.resId());
+ }
+ void setOutVT(VirtualTerminal vt) {
+ doCall(PRIF_SETOUTVT, vt.resId());
+ }
};
#endif