Changeset 183 for trunk/src/emx/include/sys/param.h
- Timestamp:
- May 19, 2003, 4:41:00 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/sys/param.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r182 r183 1 /* sys/param.h (emx+gcc) */ 1 /** @file sys/param.h 2 * BSD like sys\param.h file. 3 * 4 * TCPV40HDRS does include this file, but as we don't need to be 5 * 100% compatible we don't care. 6 */ 2 7 3 8 #ifndef _SYS_PARAM_H 4 9 #define _SYS_PARAM_H 10 #define _SYS_PARAM_H_ /* toolkit */ 5 11 6 12 #if defined (__cplusplus) … … 8 14 #endif 9 15 10 #if !defined (PAGE_SIZE) 11 #define PAGE_SIZE 0x1000 16 17 #if !defined (NULL) 18 #if defined (__cplusplus) 19 #define NULL 0 20 #else 21 #define NULL ((void*)0) 22 #endif 12 23 #endif 13 24 14 #if !defined (HZ) 25 26 /** @group BSD version defines. 27 * OS2: The toolkit headers define these. Resent FreeBSD release does too. 28 * Warning! Be aware that config scripts and programs may check for these and 29 * assume they're running on BSD. We might have to take out these 30 * defines. 31 * @{ 32 */ 33 /** System version - year and month */ 34 #ifdef TCPV40HDRS 35 #define BSD 43 36 #else 37 #define BSD 199506 38 #endif 39 #ifndef TCPV40HDRS 40 /** Indicate BSD4.3 features present. */ 41 #define BSD4_3 1 42 /** Indicate BSD4.4 features present. */ 43 #define BSD4_4 1 44 #endif 45 /** @} */ 46 47 48 #ifndef LOCORE 49 #include <types.h> 50 #endif 51 #include <sys/syslimits.h> 52 #include <sys/signal.h> 53 #include <machine/param.h> 54 #include <machine/limits.h> 55 56 57 /** @group System Parameters (BSD flavored) 58 * 59 * @{ */ 60 #ifndef MAXCOMLEN 61 /** Max command name remembered. */ 62 #define MAXCOMLEN 19 63 #endif 64 65 #ifndef MAXINTERP 66 /** Max interpreter file name length (ELF?). 67 * OS2: Have no meaning. */ 68 #define MAXINTERP 12 69 #endif 70 71 #ifndef MAXLOGNAME 72 /** Max login name length including terminating NULL. */ 73 #define MAXLOGNAME LOGIN_NAME_MAX 74 #endif 75 76 #ifndef MAXUPRC 77 /** Maximum simultaneous processes. */ 78 #define MAXUPRC CHILD_MAX 79 #endif 80 81 #ifndef NCARGS 82 /** Max argument size for an exec function. 83 * OS2: Assuming at least 4KB of environment gives us 0xf000 at the very best. 84 * However we set it to 32KB which should be a safe max. */ 85 #define NCARGS ARG_MAX 86 #endif 87 #ifndef NGROUPS 88 /** Max supplemental group id's. 89 * OS2: doesn't make much sens just set it high. */ 90 #define NGROUPS NGROUPS_MAX 91 #endif 92 93 #ifndef NOFILE 94 /** Max number of open files per process. 95 * OS2: Using DosSetMaxFH the theoretical maximum should be 0xfff0 I believe. 96 */ 97 #define NOFILE OPEN_MAX 98 #endif 99 100 #ifndef NOGROUP 101 /** Marker for empty group set member. 102 * OS2: no meaning currently. */ 103 #define NOGROUP 0xffff 104 #endif 105 106 #ifndef MAXHOSTNAMELEN 107 /** Max number of bytes in a hostname. */ 108 #define MAXHOSTNAMELEN 256 109 #endif 110 111 #ifndef SPECNAMELEN 112 /** Max number of bytes in a devicename. 113 * OS2: no real meaning. */ 114 #define SPECNAMELEN 16 115 #endif 116 117 #ifndef MAXNAMLEN 118 /** Max number of chars in a file name. 119 * BSD name for posix NAME_MAX. */ 120 #define MAXNAMLEN NAME_MAX 121 #endif 122 123 #ifndef MAXPATHLEN 124 /** Max number of chars in a path name. 125 * BSD name for posix PATH_MAX. 126 * @remark Very strict BSD kernel/user code may expect it to be a number which 127 * is the power of two an. The OS/2 number is not a power of 2. */ 128 #define MAXPATHLEN PATH_MAX 129 #endif 130 /** @} */ 131 132 133 /** @group EMX defines 134 * @{ 135 */ 136 #ifndef HZ 137 /** Frequencey of something but have no clue of what... 138 * Freebsd isn't defining this, linux is but only for the kernel sources. 139 * Considered EMX specific. */ 15 140 #define HZ 100 16 141 #endif 142 /** @} */ 17 143 18 #if !defined (MAXNAMLEN) 19 #define MAXNAMLEN 260 144 145 /** @group Bitmap Access 146 * The bitmaps in question is arrays if integer. 147 * @{ */ 148 /** number of bytes in an int */ 149 #define NBPW sizeof(int) 150 /** Set a bit in the bitmap */ 151 #define setbit(Bitmap,iBit) ( (Bitmap)[(i)/NBBY] |= 1 << ((i) % NBBY) ) 152 /** Clear a bit in the bitmap */ 153 #define clrbit(Bitmap,iBit) ( (Bitmap)[(i)/NBBY] &= ~(1 << ((i) % NBBY)) ) 154 /** Test if a bit in a bitmap is set. */ 155 #define isset(Bitmap,iBit) ( (Bitmap)[(i)/NBBY] & (1 << ((i) % NBBY)) ) 156 /** Test if a bit in a bitmap is clear. */ 157 #define isclr(Bitmap,iBit) (((Bitmap)[(i)/NBBY] & 1 << ((i) % NBBY)) == 0 ) 158 /** @} */ 159 160 161 /* Handle flags of some kind... Toolkit defines it here. 162 * Freebsd headers indicates that these are KERNEL flags, but 163 * there is a chance one or two tcpip ioctls are using them. */ 164 #ifndef _POSIX_SOURCE 165 #define FREAD 1 166 #define FWRITE 2 20 167 #endif 21 168 22 #if !defined (MAXPATHLEN) 23 #define MAXPATHLEN 260 24 #endif 25 26 /* Don't try to do this inline for now */ 27 169 #if 0 /* we don't need it, endian takes care of this */ 170 /* Basic byte order conversion (non-inline). 171 * Note that freebsd only does this when KERNEL is defined. */ 28 172 #if !defined (htonl) 29 173 #define htonl(X) _swapl(X) … … 32 176 #define ntohs(X) _swaps(X) 33 177 #endif 34 35 178 unsigned short _swaps (unsigned short _x); 36 179 unsigned long _swapl (unsigned long _x); 180 #endif 181 37 182 38 183 #if defined (__cplusplus) -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.