Class Library
java.lang.Object
|
+----Library
- public class Library
- extends Object
Convenience calls for using the Kernel.
Each function in this class makes a system call. Sometimes, the arguments
are manipulated to make their user representation more convenient.
- Author:
- Douglas Thain (thain@cs.wisc.edu)
- See Also:
- Kernel
-
Library()
-
-
exec(String, String[])
- Perform SYSCALL_EXEC.
-
execAndWait(String, String[])
- Perform SYSCALL_EXEC_AND_WAIT.
-
input()
- Perform SYSCALL_INPUT.
-
output(String)
- Perform SYSCALL_OUTPUT.
Library
public Library()
output
public static int output(String s)
- Perform SYSCALL_OUTPUT.
Display text on the console.
- Parameters:
- s - A String to display
- Returns:
- Zero
input
public static String input()
- Perform SYSCALL_INPUT.
Wait for the user to type some text and hit [return].
- Returns:
- A string containing input data, or null in case
of end-of-file or error.
exec
public static int exec(String command,
String args[])
- Perform SYSCALL_EXEC.
Launch the named program, and let it run in parallel
to the current program.
- Parameters:
- command - The name of a Java class to execute.
- args - The arguments to give the new program
- Returns:
- Zero, or ERROR_BAD_COMMAND.
execAndWait
public static int execAndWait(String command,
String args[])
- Perform SYSCALL_EXEC_AND_WAIT.
Launch the named program, and wait for it to complete.
- Parameters:
- command - The name of a Java class to execute.
- args - The arguments to give the new program
- Returns:
- Zero, ERROR_BAD_COMMAND, or ERROR_IN_CHILD.