xref: /freebsd/contrib/tcsh/sh.types.h (revision fed1ca4b719c56c930f2259d80663cd34be812bb)
1 /* $Header: /p/tcsh/cvsroot/tcsh/sh.types.h,v 3.43 2006/01/12 19:55:38 christos Exp $ */
2 /* sh.types.h: Do the necessary typedefs for each system.
3  *             Up till now I avoided making this into a separate file
4  *	       But I just wanted to eliminate the whole mess from sh.h
5  *	       In reality this should not be here! It is OS and MACHINE
6  *	       dependent, even between different revisions of OS's...
7  *	       Ideally there should be a way in c, to find out if something
8  *	       was typedef'ed, but unfortunately we rely in cpp kludges.
9  *	       Someday, this file will be removed...
10  *
11  *						christos
12  */
13 /*-
14  * Copyright (c) 1980, 1991 The Regents of the University of California.
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions
19  * are met:
20  * 1. Redistributions of source code must retain the above copyright
21  *    notice, this list of conditions and the following disclaimer.
22  * 2. Redistributions in binary form must reproduce the above copyright
23  *    notice, this list of conditions and the following disclaimer in the
24  *    documentation and/or other materials provided with the distribution.
25  * 3. Neither the name of the University nor the names of its contributors
26  *    may be used to endorse or promote products derived from this software
27  *    without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39  * SUCH DAMAGE.
40  */
41 #ifndef _h_sh_types
42 #define _h_sh_types
43 
44 
45 /***
46  *** LynxOS 2.1
47  ***/
48 #ifdef Lynx
49 # ifndef _PID_T
50 #  define _PID_T
51 # endif /* _PID_T */
52 #endif
53 
54 /***
55  *** MachTen
56  ***/
57 #ifdef __MACHTEN__
58 # ifndef _PID_T
59 #  define _PID_T
60 # endif
61 #endif
62 
63 
64 /***
65  *** Suns running sunos3.x - sunos4.1.x
66  ***/
67 #if (defined(sun) || defined(__sun__)) && SYSVREL == 0
68 # ifndef _PTR_T
69 #  define _PTR_T
70 #   ifdef __GNUC__
71     typedef void * ptr_t;
72 #   else
73     typedef char * ptr_t;
74 #   endif /* __GNUC__ */
75 # endif /* _PTR_T */
76 # ifndef __sys_stdtypes_h
77 #  define __sys_stdtypes_h
78 #   ifndef __lucid
79      typedef int pid_t;
80      typedef unsigned int speed_t;
81 #   endif
82 # endif /* __sys_stdtypes.h */
83 # ifndef _PID_T
84 #  define _PID_T
85 # endif /* _PID_T */
86 # ifndef _SPEED_T
87 #  define _SPEED_T
88 # endif /* _SPEED_T */
89 #endif /* (sun || __sun__) && SYSVREL == 0 */
90 
91 
92 /***
93  *** Hp's running hpux 7.0 or 8.0
94  ***/
95 #ifdef __hpux
96 
97 # ifndef _PTR_T
98 #  define _PTR_T
99     typedef void * ptr_t;
100 # endif /* _PTR_T */
101 
102 # ifndef _PID_T
103 #  define _PID_T
104     typedef long pid_t;
105 # endif /* _PID_T */
106 
107 # ifndef _SPEED_T
108    /* I thought POSIX was supposed to protect all typedefs! */
109 #  define _SPEED_T
110 # endif /* _SPEED_T */
111 
112 # if HPUXVERSION < 1100	/* XXX: Not true for 11.0 */
113 extern uid_t getuid(), geteuid();
114 extern gid_t getgid(), getegid();
115 extern pid_t getpid();
116 extern pid_t fork();
117 extern void perror();
118 extern void _exit();
119 extern void abort();
120 extern void qsort();
121 extern void free();
122 extern unsigned int alarm();
123 extern unsigned int sleep();
124 # endif /* HPUXVERSION < 1100 */
125 # if HPUXVERSION < 800	/* XXX: Not true for 8.0 */
126 extern char *sbrk();
127 # endif /* HPUXVERSION < 800 */
128 #endif /* __hpux */
129 
130 #if (defined(_MINIX) && !defined(_MINIX_VMD)) || defined(__EMX__)
131 typedef char * caddr_t;
132 #endif /* (_MINIX && !_MINIX_VMD) || __EMX__ */
133 
134 /***
135  *** hp9000s500 running hpux-5.2
136  ***/
137 #ifdef hp9000s500
138 # ifndef _PTR_T
139 #  define _PTR_T
140     typedef char * ptr_t;
141 # endif /* _PTR_T */
142 #endif /* hp9000s500 */
143 
144 /***
145  *** Data General AViiON 88000 or Pentium, running dgux 5.4R3 or R4.11
146  ***/
147 #ifdef DGUX
148 # ifndef _PID_T
149 #  define _PID_T
150 # endif /* _PID_T */
151 #endif /* DGUX */
152 
153 
154 /***
155  *** BSD RENO advertises itself as POSIX, but
156  *** it is missing speed_t
157  ***/
158 #ifdef RENO
159 # ifndef _SPEED_T
160 #  define _SPEED_T
161    typedef unsigned int speed_t;
162 # endif /* _SPEED_T */
163 #endif /* RENO */
164 
165 
166 /***
167  *** NeXT OS 3.x
168  ***/
169 #ifdef NeXT
170 # ifndef _SPEED_T
171 #  define _SPEED_T
172    typedef unsigned int speed_t;
173 # endif /* _SPEED_T */
174 #endif /* NeXT */
175 
176 /***
177  *** Utah's HPBSD
178  *** some posix & 4.4 BSD changes (pid_t is a short)
179  ***/
180 #ifdef HPBSD
181 # ifndef _PID_T
182 #  define _PID_T
183 # endif /* _PID_T */
184 #endif /* HPBSD */
185 
186 
187 /***
188  *** Pyramid, BSD universe
189  *** In addition to the size_t
190  ***/
191 #ifdef pyr
192 # ifndef _PID_T
193 #  define _PID_T
194    typedef short pid_t;
195 # endif /* _PID_T */
196 #endif /* pyr */
197 
198 
199 /***
200  *** rs6000, ibm370, ps2, rt: running flavors of aix.
201  ***/
202 #ifdef IBMAIX
203 # ifndef aiws
204 #  ifndef _PID_T
205 #   define _PID_T
206 #  endif /* _PID_T */
207 # endif /* !aiws */
208 # ifdef _IBMR2
209 #  ifndef _SPEED_T
210 #   define _SPEED_T
211 #  endif /* _SPEED_T */
212 # endif /* _IBMR2 */
213 #endif /* IBMAIX */
214 
215 
216 /***
217  *** Ultrix...
218  ***/
219 #if defined(ultrix) || defined(__ultrix)
220 # ifndef _PID_T
221 #  define _PID_T
222 # endif /* _PID_T */
223 # ifndef _PTR_T
224 #  define _PTR_T
225     typedef void * ptr_t;
226 # endif /* _PTR_T */
227 #endif /* ultrix || __ultrix */
228 
229 
230 /***
231  *** Silicon graphics IRIS4D running IRIX3_3
232  ***/
233 #if defined(IRIS4D) && defined(IRIX3_3)
234 # ifndef _PID_T
235 #  define _PID_T
236 # endif /* _PID_T */
237 #endif /* IRIS4D && IRIX3_3 */
238 
239 
240 /***
241  *** Apple AUX.
242  ***/
243 #ifdef OREO
244 # ifndef _PID_T
245 #  define _PID_T
246 # endif /* _PID_T */
247 #endif /* OREO */
248 
249 /***
250  *** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0.
251  **** [RTU 6.0 from mike connor]
252  *** Added, DAS DEC-90.
253  ***/
254 #ifdef	masscomp
255 # ifdef RTU6
256 #  ifndef _PID_T
257 #   define _PID_T
258 #  endif /* _PID_T */
259 #  ifndef _SPEED_T
260 #   define _SPEED_T
261 #  endif /* _SPEED_T */
262 #endif /* RTU6 */
263 #endif	/* masscomp */
264 
265 /*
266  * Motorola MPC running R32V2 (sysV88)
267  */
268 #ifdef sysV88
269 # ifndef _PID_T
270 #  define _PID_T
271 # endif /* _PID_T */
272 #endif /* sysV88 */
273 
274 /*
275  * Amdahl running UTS (Sys V3)
276  */
277 #ifdef uts
278 # ifndef _PID_T
279 #  define _PID_T
280 # endif /* _PID_T */
281 #endif /* uts */
282 
283 /*
284  * Tektronix XD88/10 running UTekV (Sys V3)
285  */
286 #ifdef UTekV
287 # ifndef _PID_T
288 #  define _PID_T
289 # endif /* _PID_T */
290 #endif /* UTekV*/
291 
292 /*
293  * BBN Butterfly gp1000
294  */
295 #ifdef butterfly
296 # ifndef _PID_T
297 #  define _PID_T
298 # endif /* _PID_T */
299 #endif /* butterfly */
300 
301 /*
302  * Alliant FX-2800/FX-80
303  */
304 #ifdef alliant
305 # ifndef _PID_T
306 #  define _PID_T
307 # endif /* _PID_T */
308 # ifdef mc68000
309    typedef int   pid_t; /* FX-80 */
310 # else
311    typedef short pid_t;	/* FX-2800 */
312 # endif
313 #endif /* alliant */
314 
315 /*
316  * DNIX
317  */
318 #ifdef DNIX
319 # ifndef _PID_T
320 #  define _PID_T
321 # endif /* _PID_T */
322 #endif /* DNIX */
323 
324 /*
325  *  Apollo running Domain/OS SR10.3 or greater
326  */
327 #ifdef apollo
328 # ifndef _PID_T
329 #  define _PID_T
330    typedef int pid_t;	/* Older versions might not like that */
331 # endif /* _PID_T */
332 #endif /* apollo */
333 
334 /***
335  *** a pdp/11, running 2BSD
336  ***/
337 #ifdef pdp11
338 # ifndef _PID_T
339 #  define _PID_T
340 # endif /* _PID_T */
341 #endif /* pdp11 */
342 
343 /***
344  *** a Harris, running CX/UX
345  ***/
346 #ifdef _CX_UX
347 # ifndef _PID_T
348 #  define _PID_T
349 # endif /* _PID_T */
350 #endif /* _CX_UX */
351 
352 /***
353  *** Catch all for non POSIX and/or non ANSI systems.
354  *** Systems up to spec *should* define these automatically
355  *** I am open to suggestions on how to do this correctly!
356  ***/
357 
358 #ifndef POSIX
359 
360 # ifndef _PID_T
361 #  define _PID_T
362     typedef int pid_t;
363 # endif /* _PID_T */
364 
365 # ifndef _SPEED_T
366 #  define _SPEED_T
367     typedef unsigned int speed_t;
368 # endif /* _SPEED_T */
369 
370 # ifndef _PTR_T
371 #  define _PTR_T
372     typedef char * ptr_t;
373 #endif /* _PTR_T */
374 
375 # ifndef _IOCTL_T
376 #  define _IOCTL_T
377     typedef char * ioctl_t;	/* Third arg of ioctl */
378 # endif /* _IOCTL_T */
379 
380 #endif /* ! POSIX */
381 
382 
383 
384 /***
385  *** This is our own junk types.
386  ***/
387 #ifndef _PTR_T
388 # define _PTR_T
389     typedef void * ptr_t;
390 #endif /* _PTR_T */
391 
392 #ifndef _IOCTL_T
393 # define _IOCTL_T
394     typedef void * ioctl_t;	/* Third arg of ioctl */
395 #endif /* _IOCTL_T */
396 
397 #endif /* _h_sh_types */
398