[ NoReturn ]
[ CCode ( cname = "exit" ) ]
public void exit (int status)
Causes normal program termination to occur.
Several cleanup steps are performed:
If exit_code is EXIT_SUCCESS, an implementation-defined status, indicating successful termination is returned. If exit_code is EXIT_FAILURE, an implementation-defined status, indicating unsuccessful termination is returned. In other cases implementation-defined status value is returned.
Example: Terminate the program:
public static void shutdown () {
Process.exit (0);
}
public static int main (string[] args) {
// Output: ````
shutdown ();
print ("You can't see me!\n");
return 0;
}
valac --pkg glib-2.0 GLib.Process.exit.vala
status |
exit status of the program |