⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysproc.c

📁 类unix x86平台的简单操作系统
💻 C
字号:
#include "types.h"#include "stat.h"#include "param.h"#include "mmu.h"#include "proc.h"#include "defs.h"#include "x86.h"#include "traps.h"#include "syscall.h"#include "spinlock.h"#include "buf.h"#include "fs.h"#include "fsvar.h"#include "elf.h"#include "file.h"#include "fcntl.h"intsys_fork(void){  struct proc *np;  if((np = copyproc(curproc[cpu()])) == 0)    return -1;  np->state = RUNNABLE;  return np->pid;}intsys_exit(void){  proc_exit();  return 0;  // not reached}intsys_wait(void){  return proc_wait();}intsys_kill(void){  int pid;  if(argint(0, &pid) < 0)    return -1;  return proc_kill(pid);}intsys_getpid(void){  return curproc[cpu()]->pid;}intsys_sbrk(void){  int addr;  int n;  struct proc *cp = curproc[cpu()];  if(argint(0, &n) < 0)    return -1;  if((addr = growproc(n)) < 0)    return -1;  setupsegs(cp);  return addr;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -