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