Ejemplo n.º 1
0
        protected override bool ReleaseHandle()
        {
            var rv = LibC.close(handle.ToInt32());

            if (rv == -1)
            {
                PlatformException.Throw();
            }
            return(true);
        }
Ejemplo n.º 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();
            }
        }