📄 lib.h
字号:
// Main public header file for our user-land support library,// whose code lives in the lib directory.// This library is roughly our OS's version of a standard C library,// and is intended to be linked into all user-mode applications// (NOT the kernel or boot loader).#ifndef JOS_INC_LIB_H#define JOS_INC_LIB_H 1#include <inc/types.h>#include <inc/stdio.h>#include <inc/stdarg.h>#include <inc/string.h>#include <inc/error.h>#include <inc/assert.h>#include <inc/env.h>#include <inc/memlayout.h>#include <inc/syscall.h>#define USED(x) (void)(x)// libos.c or entry.Sextern char *binaryname;extern volatile struct Env *env;extern volatile struct Env envs[NENV];extern volatile struct Page pages[];void exit(void);// readline.cchar* readline(const char *buf);// syscall.cvoid sys_cputs(const char *string, size_t len);int sys_cgetc(void);envid_t sys_getenvid(void);int sys_env_destroy(envid_t);/* File open modes */#define O_RDONLY 0x0000 /* open for reading only */#define O_WRONLY 0x0001 /* open for writing only */#define O_RDWR 0x0002 /* open for reading and writing */#define O_ACCMODE 0x0003 /* mask for above modes */#define O_CREAT 0x0100 /* create if nonexistent */#define O_TRUNC 0x0200 /* truncate to zero length */#define O_EXCL 0x0400 /* error if already exists */#define O_MKDIR 0x0800 /* create directory, not regular file */#endif // !JOS_INC_LIB_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -