Commit ce5bcbe3 authored by David Symonds's avatar David Symonds

Add os.Getpid and os.Getppid.

R=rsc
APPROVED=rsc
DELTA=11  (11 added, 0 deleted, 0 changed)
OCL=29352
CL=29357
parent 5a12b182
......@@ -88,3 +88,14 @@ func Wait(pid int, options uint64) (w *Waitmsg, err Error) {
return w, nil;
}
// Getpid returns the process id of the caller.
func Getpid() int {
p, r2, e := syscall.Syscall(syscall.SYS_GETPID, 0, 0, 0);
return int(p)
}
// Getppid returns the process id of the caller's parent.
func Getppid() int {
p, r2, e := syscall.Syscall(syscall.SYS_GETPPID, 0, 0, 0);
return int(p)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment