Make it so mapping files are used and then reapplied.
[SquirrelJME.git] / modules / cldc-compact / src / main / java / cc / squirreljme / jvm / SystemCallError.java
blob48a7cc5cfb63e88720363a4dc20b916e2a3de9d7
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.jvm;
12 /**
13 * This interface contains the various error codes for all of the system calls.
15 * @since 2019/05/23
17 public final class SystemCallError
19 /** No error, or success. */
20 public static final byte NO_ERROR =
23 /** The system call is not supported. */
24 public static final byte UNSUPPORTED_SYSTEM_CALL =
25 -1;
27 /** The pipe descriptor is not valid. */
28 public static final byte PIPE_DESCRIPTOR_INVALID =
29 -2;
31 /** Write error when writing to the pipe. */
32 public static final byte PIPE_DESCRIPTOR_BAD_WRITE =
33 -3;
35 /** Value out of range. */
36 public static final byte VALUE_OUT_OF_RANGE =
37 -4;
39 /** No frame buffer exists. */
40 public static final byte NO_FRAMEBUFFER =
41 -5;
43 /** Permission denied. */
44 public static final byte PERMISSION_DENIED =
45 -6;
47 /** Interrupted. */
48 public static final byte INTERRUPTED =
49 -7;
51 /** Unknown error. */
52 public static final byte UNKNOWN =
53 -8;
55 /** End of file reached. */
56 public static final byte END_OF_FILE =
57 -9;
59 /** Error with IPC Call. */
60 public static final byte IPC_ERROR =
61 -10;
63 /** Unknown class. */
64 public static final byte NO_SUCH_CLASS =
65 -11;
67 /** No such thread exists. */
68 public static final byte NO_SUCH_THREAD =
69 -12;
71 /** Thread already has a context. */
72 public static final byte THREAD_HAS_CONTEXT =
73 -13;
75 /** No such configuration key. */
76 public static final byte NO_SUCH_CONFIG_KEY =
77 -14;
79 /** Invalid memory handle kind. */
80 public static final byte INVALID_MEMHANDLE_KIND =
81 -15;
83 /** Could not flush the pipe. */
84 public static final byte PIPE_DESCRIPTOR_BAD_FLUSH =
85 -16;
87 /**
88 * Not used.
90 * @since 2019/05/23
92 private SystemCallError()
96 /**
97 * Converts the error to a string.
99 * @param __err The input error.
100 * @return The resulting string.
101 * @since 2020/01/12
103 public static String toString(int __err)
105 switch (__err)
107 case SystemCallError.NO_ERROR:
108 return "NoError";
110 case SystemCallError.UNSUPPORTED_SYSTEM_CALL:
111 return "UnsupportedSystemCall";
113 case SystemCallError.PIPE_DESCRIPTOR_INVALID:
114 return "PDInvalid";
116 case SystemCallError.PIPE_DESCRIPTOR_BAD_WRITE:
117 return "PDBadWrite";
119 case SystemCallError.VALUE_OUT_OF_RANGE:
120 return "ValueOutOfRange";
122 case SystemCallError.NO_FRAMEBUFFER:
123 return "NoFramebuffer";
125 case SystemCallError.PERMISSION_DENIED:
126 return "PermissionDenied";
128 case SystemCallError.INTERRUPTED:
129 return "Interrupted";
131 case SystemCallError.UNKNOWN:
132 return "Unknown";
134 case SystemCallError.END_OF_FILE:
135 return "EndOfFile";
137 case SystemCallError.IPC_ERROR:
138 return "IPCError";
140 case SystemCallError.NO_SUCH_CLASS:
141 return "NoSuchClass";
143 case SystemCallError.NO_SUCH_THREAD:
144 return "NoSuchThread";
146 case SystemCallError.THREAD_HAS_CONTEXT:
147 return "ThreadHasContext";
149 case SystemCallError.NO_SUCH_CONFIG_KEY:
150 return "NoSuchConfigKey";
152 // Some Other ID?
153 default:
154 return "ERROR" + __err;