Mono Class Library: Mono.Posix.Syscall Overview | Members

Mono.Posix.Syscall.exit Method

Terminates the process that calls the function with the status 'status'. [Edit]

public static int exit (int status)

See Also

Mono.Unix.Native.Syscall.exit

Parameters

status
a int [Edit]

Returns

a int [Edit]

Remarks

This member is obsolete. Please use Mono.Unix.Native.Syscall.exit instead.

C# Example
using System;
using Mono.Posix;
using System.Runtime.InteropServices;

class Test
{
	public void SignalCatcher(int v)
	{
		// sleep signal caught.
		Console.WriteLine("Signal received: " + v);
		// this line will not be printed because process exits...
		Console.WriteLine("Exiting with: " + Syscall.exit(9));
	}		
	
	public static void Main(string[] args)
	{
		Test t = new Test();
		Console.Write("waiting for event...");
		string x = Console.ReadLine();
	}
	
	public Test()
	{
		// create a signal handler delegate for sleep signals
		Console.WriteLine("signal result: " + Syscall.signal(14, 
					   new Syscall.sighandler_t(SignalCatcher)));
		// send a sleep signal
		Syscall.alarm(3);
	}
}
  
[Edit]

Requirements

Namespace: Mono.Posix
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0