import java.io.*;
import java.util.*;
+// FEATURE: vfork
+
public abstract class UnixRuntime extends Runtime implements Cloneable {
/** The pid of this "process" */
private int pid;
case SYS_exec: return sys_exec(a,b,c);
case SYS_getdents: return sys_getdents(a,b,c,d);
case SYS_unlink: return sys_unlink(a);
+ case SYS_getppid: return sys_getppid();
default: return super._syscall(syscall,a,b,c,d);
}
FD _open(String path, int flags, int mode) throws ErrnoException {
return gs.open(this,normalizePath(path),flags,mode);
}
+
+ private int sys_getppid() {
+ return parent == null ? 1 : parent.pid;
+ }
/** The kill syscall.
SIGSTOP, SIGTSTO, SIGTTIN, and SIGTTOUT pause the process.