public Method

Kernel.exit!(...)

Process.exit!(fixnum=-1)

Exits the process immediately. No exit handlers are run. fixnum is returned to the underlying system as the exit status.

Process.exit!(0)

Source Code

/*
*  call-seq:
*     Process.exit!(fixnum=-1)
*
*  Exits the process immediately. No exit handlers are
*  run. <em>fixnum</em> is returned to the underlying system as the
*  exit status.
*
*     Process.exit!(0)
*/

static VALUE
rb_f_exit_bang(argc, argv, obj)
   int argc;
   VALUE *argv;
   VALUE obj;
{
   VALUE status;
   int istatus;

   rb_secure(4);
   if (rb_scan_args(argc, argv, "01", &status) == 1) {
       switch (status) {
         case Qtrue:
           istatus = EXIT_SUCCESS;
           break;
         case Qfalse:
           istatus = EXIT_FAILURE;
           break;
         default:
           istatus = NUM2INT(status);
           break;
       }
   }
   else {
       istatus = EXIT_FAILURE;
   }
   _exit(istatus);

   return Qnil;                /* not reached */
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.