source: trunk/src/emx/include/sys/param.h@ 183

Last change on this file since 183 was 183, checked in by bird, 23 years ago

#434: Initial tcpip header merges.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.4 KB
RevLine 
[183]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 */
[18]7
8#ifndef _SYS_PARAM_H
9#define _SYS_PARAM_H
[183]10#define _SYS_PARAM_H_ /* toolkit */
[18]11
12#if defined (__cplusplus)
13extern "C" {
14#endif
15
[183]16
17#if !defined (NULL)
18#if defined (__cplusplus)
19#define NULL 0
20#else
21#define NULL ((void*)0)
[18]22#endif
[183]23#endif
[18]24
[183]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
[18]38#endif
[183]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/** @} */
[18]46
[183]47
48#ifndef LOCORE
49#include <types.h>
[18]50#endif
[183]51#include <sys/syslimits.h>
52#include <sys/signal.h>
53#include <machine/param.h>
54#include <machine/limits.h>
[18]55
[183]56
57/** @group System Parameters (BSD flavored)
58 *
59 * @{ */
60#ifndef MAXCOMLEN
61/** Max command name remembered. */
62#define MAXCOMLEN 19
[18]63#endif
64
[183]65#ifndef MAXINTERP
66/** Max interpreter file name length (ELF?).
67 * OS2: Have no meaning. */
68#define MAXINTERP 12
69#endif
[18]70
[183]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. */
140#define HZ 100
141#endif
142/** @} */
143
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
167#endif
168
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. */
[18]172#if !defined (htonl)
173#define htonl(X) _swapl(X)
174#define ntohl(X) _swapl(X)
175#define htons(X) _swaps(X)
176#define ntohs(X) _swaps(X)
177#endif
178unsigned short _swaps (unsigned short _x);
179unsigned long _swapl (unsigned long _x);
[183]180#endif
[18]181
[183]182
[18]183#if defined (__cplusplus)
184}
185#endif
186
187#endif /* not _SYS_PARAM_H */
Note: See TracBrowser for help on using the repository browser.