Beispiel #1
0
        protected override bool ReleaseHandle()
        {
            var rv = LibC.close(handle.ToInt32());

            if (rv == -1)
            {
                PlatformException.Throw();
            }
            return(true);
        }
Beispiel #2
0
        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();
            }
        }