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

📄 book.txt

📁 操作系统设计与实现源码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
00300	#ifdef _SYSTEM
00301	#define E_BAD_DEST     -1001    /* destination address illegal */
00302	#define E_BAD_SRC      -1002    /* source address illegal */
00303	#define E_TRY_AGAIN    -1003    /* can't send-- tables full */
00304	#define E_OVERRUN      -1004    /* interrupt for task that is not waiting */
00305	#define E_BAD_BUF      -1005    /* message buf outside caller's addr space */
00306	#define E_TASK         -1006    /* can't send to task */
00307	#define E_NO_MESSAGE   -1007    /* RECEIVE failed: no message present */
00308	#define E_NO_PERM      -1008    /* ordinary users can't send to tasks */
00309	#define E_BAD_FCN      -1009    /* only valid fcns are SEND, RECEIVE, BOTH */
00310	#define E_BAD_ADDR     -1010    /* bad address given to utility routine */
00311	#define E_BAD_PROC     -1011    /* bad proc number given to utility */
00312	#endif /* _SYSTEM */
00313	
00314	#endif /* _ERRNO_H */

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
				include/unistd.h	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

00400	/* The <unistd.h> header contains a few miscellaneous manifest constants. */
00401	
00402	#ifndef _UNISTD_H
00403	#define _UNISTD_H
00404	
00405	/* POSIX requires size_t and ssize_t in <unistd.h> and elsewhere. */
00406	#ifndef _SIZE_T
00407	#define _SIZE_T
00408	typedef unsigned int size_t;
00409	#endif
00410	
00411	#ifndef _SSIZE_T
00412	#define _SSIZE_T
00413	typedef int ssize_t;
00414	#endif
00415	
00416	/* Values used by access().  POSIX Table 2-8. */
00417	#define F_OK               0    /* test if file exists */
00418	#define X_OK               1    /* test if file is executable */
00419	#define W_OK               2    /* test if file is writable */
00420	#define R_OK               4    /* test if file is readable */
00421	
00422	/* Values used for whence in lseek(fd, offset, whence).  POSIX Table 2-9. */
00423	#define SEEK_SET           0    /* offset is absolute  */
00424	#define SEEK_CUR           1    /* offset is relative to current position */
00425	#define SEEK_END           2    /* offset is relative to end of file */
00426	
00427	/* This value is required by POSIX Table 2-10. */
00428	#define _POSIX_VERSION 199009L  /* which standard is being conformed to */
00429	
00430	/* These three definitions are required by POSIX Sec. 8.2.1.2. */
00431	#define STDIN_FILENO       0    /* file descriptor for stdin */
00432	#define STDOUT_FILENO      1    /* file descriptor for stdout */
00433	#define STDERR_FILENO      2    /* file descriptor for stderr */
00434	
00435	#ifdef _MINIX
00436	/* How to exit the system. */
00437	#define RBT_HALT           0
00438	#define RBT_REBOOT         1
00439	#define RBT_PANIC          2    /* for servers */
00440	#define RBT_MONITOR        3    /* let the monitor do this */
00441	#define RBT_RESET          4    /* hard reset the system */
00442	#endif
00443	
00444	/* NULL must be defined in <unistd.h> according to POSIX Sec. 2.7.1. */
00445	#define NULL    ((void *)0)
00446	
00447	/* The following relate to configurable system variables. POSIX Table 4-2. */
00448	#define _SC_ARG_MAX             1
00449	#define _SC_CHILD_MAX           2
00450	#define _SC_CLOCKS_PER_SEC      3
00451	#define _SC_CLK_TCK             3
00452	#define _SC_NGROUPS_MAX         4
00453	#define _SC_OPEN_MAX            5
00454	#define _SC_JOB_CONTROL         6
00455	#define _SC_SAVED_IDS           7
00456	#define _SC_VERSION             8
00457	#define _SC_STREAM_MAX          9
00458	#define _SC_TZNAME_MAX         10
00459	
00460	/* The following relate to configurable pathname variables. POSIX Table 5-2. */
00461	#define _PC_LINK_MAX            1       /* link count */
00462	#define _PC_MAX_CANON           2       /* size of the canonical input queue */
00463	#define _PC_MAX_INPUT           3       /* type-ahead buffer size */
00464	#define _PC_NAME_MAX            4       /* file name size */
00465	#define _PC_PATH_MAX            5       /* pathname size */
00466	#define _PC_PIPE_BUF            6       /* pipe size */
00467	#define _PC_NO_TRUNC            7       /* treatment of long name components */
00468	#define _PC_VDISABLE            8       /* tty disable */
00469	#define _PC_CHOWN_RESTRICTED    9       /* chown restricted or not */
00470	
00471	/* POSIX defines several options that may be implemented or not, at the
00472	 * implementer's whim.  This implementer has made the following choices:
00473	 *
00474	 * _POSIX_JOB_CONTROL       not defined:        no job control
00475	 * _POSIX_SAVED_IDS         not defined:        no saved uid/gid
00476	 * _POSIX_NO_TRUNC          defined as -1:      long path names are truncated
00477	 * _POSIX_CHOWN_RESTRICTED  defined:            you can't give away files
00478	 * _POSIX_VDISABLE          defined:            tty functions can be disabled
00479	 */
00480	#define _POSIX_NO_TRUNC       (-1)
00481	#define _POSIX_CHOWN_RESTRICTED  1
00482	
00483	/* Function Prototypes. */
00484	#ifndef _ANSI_H
00485	#include <ansi.h>
00486	#endif
00487	
00488	_PROTOTYPE( void _exit, (int _status)                                   );
00489	_PROTOTYPE( int access, (const char *_path, int _amode)                 );
00490	_PROTOTYPE( unsigned int alarm, (unsigned int _seconds)                 );
00491	_PROTOTYPE( int chdir, (const char *_path)                              );
00492	_PROTOTYPE( int chown, (const char *_path, Uid_t _owner, Gid_t _group)  );
00493	_PROTOTYPE( int close, (int _fd)                                        );
00494	_PROTOTYPE( char *ctermid, (char *_s)                                   );
00495	_PROTOTYPE( char *cuserid, (char *_s)                                   );
00496	_PROTOTYPE( int dup, (int _fd)                                          );
00497	_PROTOTYPE( int dup2, (int _fd, int _fd2)                               );
00498	_PROTOTYPE( int execl, (const char *_path, const char *_arg, ...)       );
00499	_PROTOTYPE( int execle, (const char *_path, const char *_arg, ...)      );
00500	_PROTOTYPE( int execlp, (const char *_file, const char *arg, ...)       );
00501	_PROTOTYPE( int execv, (const char *_path, char *const _argv[])         );
00502	_PROTOTYPE( int execve, (const char *_path, char *const _argv[], 
00503	                                                char *const _envp[])    );
00504	_PROTOTYPE( int execvp, (const char *_file, char *const _argv[])        );
00505	_PROTOTYPE( pid_t fork, (void)                                          );
00506	_PROTOTYPE( long fpathconf, (int _fd, int _name)                        );
00507	_PROTOTYPE( char *getcwd, (char *_buf, size_t _size)                    );
00508	_PROTOTYPE( gid_t getegid, (void)                                       );
00509	_PROTOTYPE( uid_t geteuid, (void)                                       );
00510	_PROTOTYPE( gid_t getgid, (void)                                        );
00511	_PROTOTYPE( int getgroups, (int _gidsetsize, gid_t _grouplist[])        );
00512	_PROTOTYPE( char *getlogin, (void)                                      );
00513	_PROTOTYPE( pid_t getpgrp, (void)                                       );
00514	_PROTOTYPE( pid_t getpid, (void)                                        );
00515	_PROTOTYPE( pid_t getppid, (void)                                       );
00516	_PROTOTYPE( uid_t getuid, (void)                                        );
00517	_PROTOTYPE( int isatty, (int _fd)                                       );
00518	_PROTOTYPE( int link, (const char *_existing, const char *_new)         );
00519	_PROTOTYPE( off_t lseek, (int _fd, off_t _offset, int _whence)          );
00520	_PROTOTYPE( long pathconf, (const char *_path, int _name)               );
00521	_PROTOTYPE( int pause, (void)                                           );
00522	_PROTOTYPE( int pipe, (int _fildes[2])                                  );
00523	_PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n)              );
00524	_PROTOTYPE( int rmdir, (const char *_path)                              );
00525	_PROTOTYPE( int setgid, (Gid_t _gid)                                    );
00526	_PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid)                      );
00527	_PROTOTYPE( pid_t setsid, (void)                                        );
00528	_PROTOTYPE( int setuid, (Uid_t _uid)                                    );
00529	_PROTOTYPE( unsigned int sleep, (unsigned int _seconds)                 );
00530	_PROTOTYPE( long sysconf, (int _name)                                   );
00531	_PROTOTYPE( pid_t tcgetpgrp, (int _fd)                                  );
00532	_PROTOTYPE( int tcsetpgrp, (int _fd, pid_t _pgrp_id)                    );
00533	_PROTOTYPE( char *ttyname, (int _fd)                                    );
00534	_PROTOTYPE( int unlink, (const char *_path)                             );
00535	_PROTOTYPE( ssize_t write, (int _fd, const void *_buf, size_t _n)       );
00536	
00537	#ifdef _MINIX
00538	_PROTOTYPE( int brk, (char *_addr)                                      );
00539	_PROTOTYPE( int chroot, (const char *_name)                             );
00540	_PROTOTYPE( int mknod, (const char *_name, Mode_t _mode, Dev_t _addr)   );
00541	_PROTOTYPE( int mknod4, (const char *_name, Mode_t _mode, Dev_t _addr,
00542	            long _size)                                                 );
00543	_PROTOTYPE( char *mktemp, (char *_template)                             );
00544	_PROTOTYPE( int mount, (char *_spec, char *_name, int _flag)            );
00545	_PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) );
00546	_PROTOTYPE( char *sbrk, (int _incr)                                     );
00547	_PROTOTYPE( int sync, (void)                                            );
00548	_PROTOTYPE( int umount, (const char *_name)                             );
00549	_PROTOTYPE( int reboot, (int _how, ...)                                 );
00550	_PROTOTYPE( int gethostname, (char *_hostname, size_t _len)             );
00551	_PROTOTYPE( int getdomainname, (char *_domain, size_t _len)             );
00552	_PROTOTYPE( int ttyslot, (void)                                         );
00553	_PROTOTYPE( int fttyslot, (int _fd)                                     );
00554	_PROTOTYPE( char *crypt, (const char *_key, const char *_salt)          );
00555	#endif
00556	
00557	#endif /* _UNISTD_H */

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
				include/string.h	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

00600	/* The <string.h> header contains prototypes for the string handling 
00601	 * functions.
00602	 */
00603	
00604	#ifndef _STRING_H
00605	#define _STRING_H
00606	
00607	#define NULL    ((void *)0)
00608	
00609	#ifndef _SIZE_T
00610	#define _SIZE_T
00611	typedef unsigned int size_t;    /* type returned by sizeof */
00612	#endif /*_SIZE_T */
00613	
00614	/* Function Prototypes. */
00615	#ifndef _ANSI_H
00616	#include <ansi.h>
00617	#endif
00618	
00619	_PROTOTYPE( void *memchr, (const void *_s, int _c, size_t _n)           );
00620	_PROTOTYPE( int memcmp, (const void *_s1, const void *_s2, size_t _n)   );
00621	_PROTOTYPE( void *memcpy, (void *_s1, const void *_s2, size_t _n)       );
00622	_PROTOTYPE( void *memmove, (void *_s1, const void *_s2, size_t _n)      );
00623	_PROTOTYPE( void *memset, (void *_s, int _c, size_t _n)                 );
00624	_PROTOTYPE( char *strcat, (char *_s1, const char *_s2)                  );
00625	_PROTOTYPE( char *strchr, (const char *_s, int _c)                      );
00626	_PROTOTYPE( int strncmp, (const char *_s1, const char *_s2, size_t _n)  );
00627	_PROTOTYPE( int strcmp, (const char *_s1, const char *_s2)              );
00628	_PROTOTYPE( int strcoll, (const char *_s1, const char *_s2)             );
00629	_PROTOTYPE( char *strcpy, (char *_s1, const char *_s2)                  );
00630	_PROTOTYPE( size_t strcspn, (const char *_s1, const char *_s2)          );
00631	_PROTOTYPE( char *strerror, (int _errnum)                               );
00632	_PROTOTYPE( size_t strlen, (const char *_s)                             );
00633	_PROTOTYPE( char *strncat, (char *_s1, const char *_s2, size_t _n)      );
00634	_PROTOTYPE( char *strncpy, (char *_s1, const char *_s2, size_t _n)      );
00635	_PROTOTYPE( char *strpbrk, (const char *_s1, const char *_s2)           );
00636	_PROTOTYPE( char *strrchr, (const char *_s, int _c)                     );
00637	_PROTOTYPE( size_t strspn, (const char *_s1, const char *_s2)           );
00638	_PROTOTYPE( char *strstr, (const char *_s1, const char *_s2)            );
00639	_PROTOTYPE( char *strtok, (char *_s1, const char *_s2)                  );
00640	_PROTOTYPE( size_t strxfrm, (char *_s1, const char *_s2, size_t _n)     );
00641	
00642	#ifdef _MINIX
00643	/* For backward compatibility. */
00644	_PROTOTYPE( char *index, (const char *_s, int _charwanted)              );
00645	_PROTOTYPE( char *rindex, (const char *_s, int _charwanted)             );
00646	_PROTOTYPE( void bcopy, (const void *_src, void *_dst, size_t _length)  );
00647	_PROTOTYPE( int bcmp, (const void *_s1, const void *_s2, size_t _length));
00648	_PROTOTYPE( void bzero, (void *_dst, size_t _length)                    );
00649	_PROTOTYPE( void *memccpy, (char *_dst, const char *_src, int _ucharstop,
00650	                                                    size_t _size)       );
00651	/* BSD functions */
00652	_PROTOTYPE( int strcasecmp, (const char *_s1, const char *_s2)          );
00653	#endif
00654	
00655	#endif /* _STRING_H */

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
				include/signal.h	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

00700	/* The <signal.h> header defines all the ANSI and POSIX signals.
00701	 * MINIX supports all the signals required by POSIX. They are defined below.
00702	 * Some additional signals are also supported.
00703	 */
00704	
00705	#ifndef _SIGNAL_H
00706	#define _SIGNAL_H
00707	
00708	#ifndef _ANSI_H
00709	#include <ansi.h>

⌨️ 快捷键说明

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