001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.jikesrvm.runtime;
014    
015    /** Exit status codes for the Jikes RVM virtual machine.
016     * <p>
017     * These process exit status codes are used by the virtual machine whenever it
018     * must exit with some failure condition.  By default, if all goes well, the
019     * virtual machine will exit with status zero.
020     */
021    public interface ExitStatus {
022      /* Exit statuses, pending a better location.
023    
024         <p>Please keep this list in numerical order.
025    
026         <p>You might somewhere find uses of the explicit constant -1 as an exit
027         status (it gets mapped to 255).  I think they're all dead, but it is
028         possible that some have crept in. Please do not use -1 any more.  That's
029         because on Cygwin, exiting with status -1 will not map to 255 -- instead
030         (according to Brian Carlstrom) it gets mapped to status 0, and we
031         certainly don't want to give a false impression of success!  Please
032         replace it with {@link #EXIT_STATUS_MISC_TROUBLE}.
033      */ int EXIT_STATUS_RECURSIVELY_SHUTTING_DOWN = 128;
034      /* Note that XARGS uses status codes 123 through 127 specially.  You are
035       * warned.  We keep out of the namespace from 129 upwards to 180 or so,
036       * because Bash and other SH-compatible shells treat a command that dies
037       * from an uncaught signal as if it had died with an exit status of 128 plus
038       * the signal number.  For example, dying with SIGABRT (signal #6) gives an
039       * exit status of 134.  */
040      /** Traditionally the shell and xargs use status 127 to mean that
041       * they were unable to find something to execute.
042       * To quote the bash manpage, "If a command is found
043       *  but is not executable, the return status is 126."
044       * We shall adopt those customs here. --Steve Augart*/
045      int EXIT_STATUS_EXECUTABLE_NOT_FOUND = 127;
046      int EXIT_STATUS_COULD_NOT_EXECUTE = 126;
047      int EXIT_STATUS_IMPOSSIBLE_LIBRARY_FUNCTION_ERROR = 125;
048      int EXIT_STATUS_DUMP_STACK_AND_DIE = 124;
049      int EXIT_STATUS_MAIN_THREAD_COULD_NOT_LAUNCH = 123;
050      int EXIT_STATUS_MISC_TROUBLE = 122;
051      int EXIT_STATUS_SYSFAIL = EXIT_STATUS_DUMP_STACK_AND_DIE;
052      int EXIT_STATUS_SYSCALL_TROUBLE = 121;
053      int EXIT_STATUS_TIMER_TROUBLE = EXIT_STATUS_SYSCALL_TROUBLE;
054      int EXIT_STATUS_UNEXPECTED_CALL_TO_SYS = 120;
055      int EXIT_STATUS_UNSUPPORTED_INTERNAL_OP = EXIT_STATUS_UNEXPECTED_CALL_TO_SYS;
056      int EXIT_STATUS_DYING_WITH_UNCAUGHT_EXCEPTION = 113;
057      int EXIT_STATUS_OPT_COMPILER_FAILED = 101;
058      /** same as OPT compiler */
059      int EXIT_STATUS_JNI_COMPILER_FAILED = 101;
060      int EXIT_STATUS_BOGUS_COMMAND_LINE_ARG = 100;
061      int EXIT_STATUS_TOO_MANY_THROWABLE_ERRORS = 99;
062      int EXIT_STATUS_TOO_MANY_OUT_OF_MEMORY_ERRORS = EXIT_STATUS_TOO_MANY_THROWABLE_ERRORS;
063      int EXIT_STATUS_JNI_TROUBLE = 98;
064      /** Used in 0005fProcess.C */
065      int EXIT_STATUS_BAD_WORKING_DIR = EXIT_STATUS_JNI_TROUBLE;
066      /** What exit status should we use after we have printed out a help message?
067       *  Some common utilities exit with 1, some with 0.  Jikes RVM seems
068       *  to be using 1, so let's keep doing so. */
069      int EXIT_STATUS_PRINTED_HELP_MESSAGE = 1;
070    }