// Authors:
// Jonathan Pryor (jonpryor@vt.edu)
//
-// (C) 2004 Jonathan Pryor
+// (C) 2004-2005 Jonathan Pryor
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
public bool HasExited {
get {
int status = GetProcessStatus ();
- return Syscall.WIFEXITED (status);
+ return Native.Syscall.WIFEXITED (status);
}
}
private int GetProcessStatus ()
{
int status;
- int r = Syscall.waitpid (pid, out status,
- WaitOptions.WNOHANG | WaitOptions.WUNTRACED);
+ int r = Native.Syscall.waitpid (pid, out status,
+ Native.WaitOptions.WNOHANG | Native.WaitOptions.WUNTRACED);
UnixMarshal.ThrowExceptionForLastErrorIf (r);
return r;
}
throw new InvalidOperationException (
Locale.GetText ("Process hasn't exited"));
int status = GetProcessStatus ();
- return Syscall.WEXITSTATUS (status);
+ return Native.Syscall.WEXITSTATUS (status);
}
}
public bool HasSignaled {
get {
int status = GetProcessStatus ();
- return Syscall.WIFSIGNALED (status);
+ return Native.Syscall.WIFSIGNALED (status);
}
}
- public Signum TerminationSignal {
+ public Native.Signum TerminationSignal {
get {
if (!HasSignaled)
throw new InvalidOperationException (
Locale.GetText ("Process wasn't terminated by a signal"));
int status = GetProcessStatus ();
- return Syscall.WTERMSIG (status);
+ return Native.Syscall.WTERMSIG (status);
}
}
public bool HasStopped {
get {
int status = GetProcessStatus ();
- return Syscall.WIFSTOPPED (status);
+ return Native.Syscall.WIFSTOPPED (status);
}
}
- public Signum StopSignal {
+ public Native.Signum StopSignal {
get {
if (!HasStopped)
throw new InvalidOperationException (
Locale.GetText ("Process isn't stopped"));
int status = GetProcessStatus ();
- return Syscall.WSTOPSIG (status);
+ return Native.Syscall.WSTOPSIG (status);
}
}
public int ProcessGroupId {
- get {return Syscall.getpgid (pid);}
+ get {return Native.Syscall.getpgid (pid);}
set {
- int r = Syscall.setpgid (pid, value);
+ int r = Native.Syscall.setpgid (pid, value);
UnixMarshal.ThrowExceptionForLastErrorIf (r);
}
}
public int SessionId {
get {
- int r = Syscall.getsid (pid);
+ int r = Native.Syscall.getsid (pid);
UnixMarshal.ThrowExceptionForLastErrorIf (r);
return r;
}
public static int GetCurrentProcessId ()
{
- return Syscall.getpid ();
+ return Native.Syscall.getpid ();
}
public void Kill ()
{
- Signal (Signum.SIGKILL);
+ Signal (Native.Signum.SIGKILL);
}
- public void Signal (Signum signal)
+ [CLSCompliant (false)]
+ public void Signal (Native.Signum signal)
{
- int r = Syscall.kill (pid, signal);
+ int r = Native.Syscall.kill (pid, signal);
UnixMarshal.ThrowExceptionForLastErrorIf (r);
}
int status;
int r;
do {
- r = Syscall.waitpid (pid, out status, (WaitOptions) 0);
+ r = Native.Syscall.waitpid (pid, out status, (Native.WaitOptions) 0);
} while (UnixMarshal.ShouldRetrySyscall (r));
UnixMarshal.ThrowExceptionForLastErrorIf (r);
}