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

📄 limits.h

📁 一个简单的操作系统minix的核心代码
💻 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_H
00106	#define _LIMITS_H
00107	
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 == 2
00124	#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	#endif
00128	
00129	#if _EM_WSIZE == 4
00130	#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	#endif
00134	
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 */
00150	#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 > 2
00162	#define ARG_MAX        16384    /* # bytes of args + environ for exec() */
00163	#else
00164	#define ARG_MAX         4096    /* args + environ on small machines */
00165	#endif
00166	#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 */

⌨️ 快捷键说明

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