diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-24 22:58:28 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-24 22:58:28 +0200 |
commit | d1ac6fb03e3110e35023f60f643f0c4d02c3d8b6 (patch) | |
tree | b7f693ab8ea9d320f5bd1b838e8eb3d3bcd690f4 /Source/Library/Userland/Binding | |
parent | b639b99b3e8f4cf77560d8d473b13d992ac8eb10 (diff) | |
download | Melon-d1ac6fb03e3110e35023f60f643f0c4d02c3d8b6.tar.gz Melon-d1ac6fb03e3110e35023f60f643f0c4d02c3d8b6.zip |
More work on syscalls : userland applications can run other apps.
Diffstat (limited to 'Source/Library/Userland/Binding')
-rw-r--r-- | Source/Library/Userland/Binding/Process.class.h | 22 |
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 |