netprocess.java
来自「nachos操作系统框架」· Java 代码 · 共 47 行
JAVA
47 行
package nachos.network;import nachos.machine.*;import nachos.threads.*;import nachos.userprog.*;import nachos.vm.*;/** * A <tt>VMProcess</tt> that supports networking syscalls. */public class NetProcess extends VMProcess { /** * Allocate a new process. */ public NetProcess() { super(); } private static final int syscallConnect = 11, syscallAccept = 12; /** * Handle a syscall exception. Called by <tt>handleException()</tt>. The * <i>syscall</i> argument identifies which syscall the user executed: * * <table> * <tr><td>syscall#</td><td>syscall prototype</td></tr> * <tr><td>11</td><td><tt>int connect(int host, int port);</tt></td></tr> * <tr><td>12</td><td><tt>int accept(int port);</tt></td></tr> * </table> * * @param syscall the syscall number. * @param a0 the first syscall argument. * @param a1 the second syscall argument. * @param a2 the third syscall argument. * @param a3 the fourth syscall argument. * @return the value to be returned to the user. */ public int handleSyscall(int syscall, int a0, int a1, int a2, int a3) { switch (syscall) { default: return super.handleSyscall(syscall, a0, a1, a2, a3); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?