📄 book.t
字号:
.fp 5 CW LucidaT .\" To use a font other than Lucida, change 'LucidaT'.po .9i.lg 0.nf.ec `.ps 7.vs 9.lt 5.25i`f5.nr Tb `w'0'.nr Fp 0.ta 9u*`n(Tbu 17u*`n(Tbu 25u*`n(Tbu 33u*`n(Tbu 41u*`n(Tbu 49u*`n(Tbu 57u*`n(Tbu 65u*`n(Tbu 73u*`n(Tbu 81u*`n(Tbu.de Op .if ``n(Fp>0 .bp.nr Fp 1.sp 0.75i.tl '``fR``s10MINIX SOURCE CODE``s0'``s11File: ``$2``s0``fP'``fB``s12``n%``s0``fP'.sp 0.25i...de Ep .if ``n(Fp>0 .bp.sp 0.75i.tl '``fB``s12``n%``s0``fP``fR'``s11File: ``$2'``s0``s10MINIX SOURCE CODE``s0``fP'.nr Fp 1.sp 0.25i...Op 1 include/ansi.h++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/ansi.h ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++00000 /* The <ansi.h> header attempts to decide whether the compiler has enough00001 * conformance to Standard C for Minix to take advantage of. If so, the00002 * symbol _ANSI is defined (as 31415). Otherwise _ANSI is not defined00003 * here, but it may be defined by applications that want to bend the rules.00004 * The magic number in the definition is to inhibit unnecessary bending00005 * of the rules. (For consistency with the new '#ifdef _ANSI" tests in00006 * the headers, _ANSI should really be defined as nothing, but that would00007 * break many library routines that use "#if _ANSI".)00008 00009 * If _ANSI ends up being defined, a macro00010 *00011 * _PROTOTYPE(function, params)00012 *00013 * is defined. This macro expands in different ways, generating either00014 * ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)00015 * prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc00016 * in such a way that they are portable over both ANSI and K&R compilers.00017 * The appropriate macros are defined here.00018 */00019 00020 #ifndef _ANSI_H00021 #define _ANSI_H00022 00023 #if __STDC__ == 100024 #define _ANSI 31459 /* compiler claims full ANSI conformance */00025 #endif00026 00027 #ifdef __GNUC__00028 #define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */00029 #endif00030 00031 #ifdef _ANSI00032 00033 /* Keep everything for ANSI prototypes. */00034 #define _PROTOTYPE(function, params) function params00035 #define _ARGS(params) params00036 00037 #define _VOIDSTAR void *00038 #define _VOID void00039 #define _CONST const00040 #define _VOLATILE volatile00041 #define _SIZET size_t00042 00043 #else00044 00045 /* Throw away the parameters for K&R prototypes. */00046 #define _PROTOTYPE(function, params) function()00047 #define _ARGS(params) ()00048 00049 #define _VOIDSTAR void *00050 #define _VOID void00051 #define _CONST00052 #define _VOLATILE00053 #define _SIZET int00054 .Ep 2 include/ansi.h00055 #endif /* _ANSI */00056 00057 #endif /* ANSI_H */++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/limits.h ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++00100 /* The <limits.h> header defines some basic sizes, both of the language types 00101 * (e.g., the number of bits in an integer), and of the operating system (e.g.00102 * the number of characters in a file name.00103 */00104 00105 #ifndef _LIMITS_H00106 #define _LIMITS_H00107 00108 /* Definitions about chars (8 bits in MINIX, and signed). */00109 #define CHAR_BIT 8 /* # bits in a char */00110 #define CHAR_MIN -128 /* minimum value of a char */00111 #define CHAR_MAX 127 /* maximum value of a char */00112 #define SCHAR_MIN -128 /* minimum value of a signed char */00113 #define SCHAR_MAX 127 /* maximum value of a signed char */00114 #define UCHAR_MAX 255 /* maximum value of an unsigned char */00115 #define MB_LEN_MAX 1 /* maximum length of a multibyte char */00116 00117 /* Definitions about shorts (16 bits in MINIX). */00118 #define SHRT_MIN (-32767-1) /* minimum value of a short */00119 #define SHRT_MAX 32767 /* maximum value of a short */00120 #define USHRT_MAX 0xFFFF /* maximum value of unsigned short */00121 00122 /* _EM_WSIZE is a compiler-generated symbol giving the word size in bytes. */00123 #if _EM_WSIZE == 200124 #define INT_MIN (-32767-1) /* minimum value of a 16-bit int */00125 #define INT_MAX 32767 /* maximum value of a 16-bit int */00126 #define UINT_MAX 0xFFFF /* maximum value of an unsigned 16-bit int */00127 #endif00128 00129 #if _EM_WSIZE == 400130 #define INT_MIN (-2147483647-1) /* minimum value of a 32-bit int */00131 #define INT_MAX 2147483647 /* maximum value of a 32-bit int */00132 #define UINT_MAX 0xFFFFFFFF /* maximum value of an unsigned 32-bit int */00133 #endif00134 00135 /*Definitions about longs (32 bits in MINIX). */00136 #define LONG_MIN (-2147483647L-1)/* minimum value of a long */00137 #define LONG_MAX 2147483647L /* maximum value of a long */00138 #define ULONG_MAX 0xFFFFFFFFL /* maximum value of an unsigned long */00139 00140 /* Minimum sizes required by the POSIX P1003.1 standard (Table 2-3). */00141 #ifdef _POSIX_SOURCE /* these are only visible for POSIX */00142 #define _POSIX_ARG_MAX 4096 /* exec() may have 4K worth of args */00143 #define _POSIX_CHILD_MAX 6 /* a process may have 6 children */00144 #define _POSIX_LINK_MAX 8 /* a file may have 8 links */00145 #define _POSIX_MAX_CANON 255 /* size of the canonical input queue */00146 #define _POSIX_MAX_INPUT 255 /* you can type 255 chars ahead */00147 #define _POSIX_NAME_MAX 14 /* a file name may have 14 chars */00148 #define _POSIX_NGROUPS_MAX 0 /* supplementary group IDs are optional */00149 #define _POSIX_OPEN_MAX 16 /* a process may have 16 files open */.Op 3 include/limits.h00150 #define _POSIX_PATH_MAX 255 /* a pathname may contain 255 chars */00151 #define _POSIX_PIPE_BUF 512 /* pipes writes of 512 bytes must be atomic */00152 #define _POSIX_STREAM_MAX 8 /* at least 8 FILEs can be open at once */00153 #define _POSIX_TZNAME_MAX 3 /* time zone names can be at least 3 chars */00154 #define _POSIX_SSIZE_MAX 32767 /* read() must support 32767 byte reads */00155 00156 /* Values actually implemented by MINIX (Tables 2-4, 2-5, 2-6, and 2-7). */00157 /* Some of these old names had better be defined when not POSIX. */00158 #define _NO_LIMIT 100 /* arbitrary number; limit not enforced */00159 00160 #define NGROUPS_MAX 0 /* supplemental group IDs not available */00161 #if _EM_WSIZE > 200162 #define ARG_MAX 16384 /* # bytes of args + environ for exec() */00163 #else00164 #define ARG_MAX 4096 /* args + environ on small machines */00165 #endif00166 #define CHILD_MAX _NO_LIMIT /* MINIX does not limit children */00167 #define OPEN_MAX 20 /* # open files a process may have */00168 #define LINK_MAX 127 /* # links a file may have */00169 #define MAX_CANON 255 /* size of the canonical input queue */00170 #define MAX_INPUT 255 /* size of the type-ahead buffer */00171 #define NAME_MAX 14 /* # chars in a file name */00172 #define PATH_MAX 255 /* # chars in a path name */00173 #define PIPE_BUF 7168 /* # bytes in atomic write to a pipe */00174 #define STREAM_MAX 20 /* must be the same as FOPEN_MAX in stdio.h */00175 #define TZNAME_MAX 3 /* maximum bytes in a time zone name is 3 */00176 #define SSIZE_MAX 32767 /* max defined byte count for read() */00177 00178 #endif /* _POSIX_SOURCE */00179 00180 #endif /* _LIMITS_H */++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/errno.h ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++00200 /* The <errno.h> header defines the numbers of the various errors that can00201 * occur during program execution. They are visible to user programs and 00202 * should be small positive integers. However, they are also used within 00203 * MINIX, where they must be negative. For example, the READ system call is 00204 * executed internally by calling do_read(). This function returns either a 00205 * (negative) error number or a (positive) number of bytes actually read.00206 *00207 * To solve the problem of having the error numbers be negative inside the00208 * the system and positive outside, the following mechanism is used. All the00209 * definitions are are the form:00210 *00211 * #define EPERM (_SIGN 1)00212 *00213 * If the macro _SYSTEM is defined, then _SIGN is set to "-", otherwise it is00214 * set to "". Thus when compiling the operating system, the macro _SYSTEM00215 * will be defined, setting EPERM to (- 1), whereas when when this00216 * file is included in an ordinary user program, EPERM has the value ( 1).00217 */00218 00219 #ifndef _ERRNO_H /* check if <errno.h> is already included */.Ep 4 include/errno.h00220 #define _ERRNO_H /* it is not included; note that fact */00221 00222 /* Now define _SIGN as "" or "-" depending on _SYSTEM. */00223 #ifdef _SYSTEM00224 # define _SIGN -00225 # define OK 000226 #else00227 # define _SIGN 00228 #endif00229 00230 extern int errno; /* place where the error numbers go */00231 00232 /* Here are the numerical values of the error numbers. */00233 #define _NERROR 70 /* number of errors */ 00234 00235 #define EGENERIC (_SIGN 99) /* generic error */00236 #define EPERM (_SIGN 1) /* operation not permitted */00237 #define ENOENT (_SIGN 2) /* no such file or directory */00238 #define ESRCH (_SIGN 3) /* no such process */00239 #define EINTR (_SIGN 4) /* interrupted function call */00240 #define EIO (_SIGN 5) /* input/output error */00241 #define ENXIO (_SIGN 6) /* no such device or address */00242 #define E2BIG (_SIGN 7) /* arg list too long */00243 #define ENOEXEC (_SIGN 8) /* exec format error */00244 #define EBADF (_SIGN 9) /* bad file descriptor */00245 #define ECHILD (_SIGN 10) /* no child process */00246 #define EAGAIN (_SIGN 11) /* resource temporarily unavailable */00247 #define ENOMEM (_SIGN 12) /* not enough space */00248 #define EACCES (_SIGN 13) /* permission denied */00249 #define EFAULT (_SIGN 14) /* bad address */00250 #define ENOTBLK (_SIGN 15) /* Extension: not a block special file */00251 #define EBUSY (_SIGN 16) /* resource busy */00252 #define EEXIST (_SIGN 17) /* file exists */00253 #define EXDEV (_SIGN 18) /* improper link */00254 #define ENODEV (_SIGN 19) /* no such device */00255 #define ENOTDIR (_SIGN 20) /* not a directory */00256 #define EISDIR (_SIGN 21) /* is a directory */00257 #define EINVAL (_SIGN 22) /* invalid argument */00258 #define ENFILE (_SIGN 23) /* too many open files in system */00259 #define EMFILE (_SIGN 24) /* too many open files */00260 #define ENOTTY (_SIGN 25) /* inappropriate I/O control operation */00261 #define ETXTBSY (_SIGN 26) /* no longer used */00262 #define EFBIG (_SIGN 27) /* file too large */00263 #define ENOSPC (_SIGN 28) /* no space left on device */00264 #define ESPIPE (_SIGN 29) /* invalid seek */00265 #define EROFS (_SIGN 30) /* read-only file system */00266 #define EMLINK (_SIGN 31) /* too many links */00267 #define EPIPE (_SIGN 32) /* broken pipe */00268 #define EDOM (_SIGN 33) /* domain error (from ANSI C std) */00269 #define ERANGE (_SIGN 34) /* result too large (from ANSI C std) */00270 #define EDEADLK (_SIGN 35) /* resource deadlock avoided */00271 #define ENAMETOOLONG (_SIGN 36) /* file name too long */00272 #define ENOLCK (_SIGN 37) /* no locks available */00273 #define ENOSYS (_SIGN 38) /* function not implemented */00274 #define ENOTEMPTY (_SIGN 39) /* directory not empty */00275 00276 /* The following errors relate to networking. */00277 #define EPACKSIZE (_SIGN 50) /* invalid packet size for some protocol */00278 #define EOUTOFBUFS (_SIGN 51) /* not enough buffers left */00279 #define EBADIOCTL (_SIGN 52) /* illegal ioctl for device */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -