protected override bool ReleaseHandle() { var rv = LibC.close(handle.ToInt32()); if (rv == -1) { PlatformException.Throw(); } return(true); }
public static void Terminate(this Process process) { if (process.HasExited) { return; } int rv = kill(process.Handle.ToInt32(), SIGTERM); if (rv == -1 && errno != ESRCH /* process does not exist, assume it exited */) { PlatformException.Throw(); } }