blob: 988753e96dc127ffd128494c8b5beb4ae5d1ff41 (
plain)
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
38
39
40
41
42
43
44
45
|
lib LibC
WNOHANG = 0x00000001
@[ReturnsTwice]
fun fork : PidT
fun getpgid(pid : PidT) : PidT
fun kill(pid : PidT, signal : Int) : Int
fun getpid : PidT
fun getppid : PidT
fun exit(status : Int) : NoReturn
ifdef x86_64
alias ClockT = UInt64
else
alias ClockT = UInt32
end
SC_CLK_TCK = 3
struct Tms
utime : ClockT
stime : ClockT
cutime : ClockT
cstime : ClockT
end
fun times(buffer : Tms*) : ClockT
fun sysconf(name : Int) : Long
end
class Process
def self.exit(status = 0)
LibC.exit(status)
end
def self.pid
LibC.getpid
end
def self.getpgid(pid : Int32)
ret = LibC.getpgid(pid)
raise Errno.new(ret) if ret < 0
ret
end
end
|