summaryrefslogtreecommitdiff
path: root/Source/Library/Userland/Binding/Process.class.h
blob: ddca6be1351225b8a5668320f64aad7d5fe5e8b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef DEF_PROCESS_CLASS_H
#define DEF_PROCESS_CLASS_H

#include <Syscall/RessourceCaller.class.h>

#include <Process.iface.h>
#include <String.class.h>

class Process : public RessourceCaller {
	public:
	static Process get() {
		u32int id = RessourceCaller::sCall(PRIF_OBJTYPE, PRIF_SGETCPR);
		return Process(id);
	}
	Process(u32int id) : RessourceCaller(id, PRIF_OBJTYPE) {}

	void exit() {
		doCall(PRIF_EXIT);
	}
	void allocPage(u32int pos) {
		doCall(PRIF_ALLOCPAGE, pos);
	}
	void freePage(u32int pos) {
		doCall(PRIF_FREEPAGE, pos);
	}
	u32int getPid() {
		return doCall(PRIF_GETPID);
	}
	u32int getPpid() {
		return doCall(PRIF_GETPPID);
	}
	String getCmdline() {
		return String::unserialize(doCall(PRIF_GETCMDLINE));
	}
};

#endif