sh.types.h revision 167465
190792Sgshapiro/* $Header: /p/tcsh/cvsroot/tcsh/sh.types.h,v 3.43 2006/01/12 19:55:38 christos Exp $ */
290792Sgshapiro/* sh.types.h: Do the necessary typedefs for each system.
3157001Sgshapiro *             Up till now I avoided making this into a separate file
490792Sgshapiro *	       But I just wanted to eliminate the whole mess from sh.h
590792Sgshapiro *	       In reality this should not be here! It is OS and MACHINE
690792Sgshapiro *	       dependent, even between different revisions of OS's...
790792Sgshapiro *	       Ideally there should be a way in c, to find out if something
890792Sgshapiro *	       was typedef'ed, but unfortunately we rely in cpp kludges.
990792Sgshapiro *	       Someday, this file will be removed...
1090792Sgshapiro *
1190792Sgshapiro *						christos
1290792Sgshapiro */
1390792Sgshapiro/*-
1490792Sgshapiro * Copyright (c) 1980, 1991 The Regents of the University of California.
1590792Sgshapiro * All rights reserved.
1690792Sgshapiro *
1790792Sgshapiro * Redistribution and use in source and binary forms, with or without
1890792Sgshapiro * modification, are permitted provided that the following conditions
1990792Sgshapiro * are met:
2090792Sgshapiro * 1. Redistributions of source code must retain the above copyright
2190792Sgshapiro *    notice, this list of conditions and the following disclaimer.
2290792Sgshapiro * 2. Redistributions in binary form must reproduce the above copyright
2390792Sgshapiro *    notice, this list of conditions and the following disclaimer in the
2490792Sgshapiro *    documentation and/or other materials provided with the distribution.
2590792Sgshapiro * 3. Neither the name of the University nor the names of its contributors
2690792Sgshapiro *    may be used to endorse or promote products derived from this software
2790792Sgshapiro *    without specific prior written permission.
2890792Sgshapiro *
2990792Sgshapiro * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
3090792Sgshapiro * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3190792Sgshapiro * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3290792Sgshapiro * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3390792Sgshapiro * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3490792Sgshapiro * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3590792Sgshapiro * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3690792Sgshapiro * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3790792Sgshapiro * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3890792Sgshapiro * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3990792Sgshapiro * SUCH DAMAGE.
4098121Sgshapiro */
4190792Sgshapiro#ifndef _h_sh_types
4290792Sgshapiro#define _h_sh_types
4390792Sgshapiro
4490792Sgshapiro
4590792Sgshapiro/***
4690792Sgshapiro *** LynxOS 2.1
4790792Sgshapiro ***/
4890792Sgshapiro#ifdef Lynx
4990792Sgshapiro# ifndef _PID_T
5090792Sgshapiro#  define _PID_T
5190792Sgshapiro# endif /* _PID_T */
5290792Sgshapiro#endif
5398121Sgshapiro
5490792Sgshapiro/***
5590792Sgshapiro *** MachTen
5690792Sgshapiro ***/
5790792Sgshapiro#ifdef __MACHTEN__
5890792Sgshapiro# ifndef _PID_T
5990792Sgshapiro#  define _PID_T
6090792Sgshapiro# endif
6190792Sgshapiro#endif
62157001Sgshapiro
6390792Sgshapiro
6490792Sgshapiro/***
6590792Sgshapiro *** Suns running sunos3.x - sunos4.1.x
6690792Sgshapiro ***/
6790792Sgshapiro#if (defined(sun) || defined(__sun__)) && SYSVREL == 0
6890792Sgshapiro# ifndef _PTR_T
6990792Sgshapiro#  define _PTR_T
7090792Sgshapiro#   ifdef __GNUC__
7190792Sgshapiro    typedef void * ptr_t;
7290792Sgshapiro#   else
7390792Sgshapiro    typedef char * ptr_t;
7498121Sgshapiro#   endif /* __GNUC__ */
7590792Sgshapiro# endif /* _PTR_T */
7690792Sgshapiro# ifndef __sys_stdtypes_h
7790792Sgshapiro#  define __sys_stdtypes_h
7890792Sgshapiro#   ifndef __lucid
7990792Sgshapiro     typedef int pid_t;
8090792Sgshapiro     typedef unsigned int speed_t;
8190792Sgshapiro#   endif
8290792Sgshapiro# endif /* __sys_stdtypes.h */
8390792Sgshapiro# ifndef _PID_T
8490792Sgshapiro#  define _PID_T
8590792Sgshapiro# endif /* _PID_T */
8690792Sgshapiro# ifndef _SPEED_T
8790792Sgshapiro#  define _SPEED_T
88157001Sgshapiro# endif /* _SPEED_T */
8990792Sgshapiro#endif /* (sun || __sun__) && SYSVREL == 0 */
9090792Sgshapiro
9190792Sgshapiro
9290792Sgshapiro/***
9390792Sgshapiro *** Hp's running hpux 7.0 or 8.0
9490792Sgshapiro ***/
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 */
113extern uid_t getuid(), geteuid();
114extern gid_t getgid(), getegid();
115extern pid_t getpid();
116extern pid_t fork();
117extern void perror();
118extern void _exit();
119extern void abort();
120extern void qsort();
121extern void free();
122extern unsigned int alarm();
123extern unsigned int sleep();
124# endif /* HPUXVERSION < 1100 */
125# if HPUXVERSION < 800	/* XXX: Not true for 8.0 */
126extern char *sbrk();
127# endif /* HPUXVERSION < 800 */
128#endif /* __hpux */
129
130#if (defined(_MINIX) && !defined(_MINIX_VMD)) || defined(__EMX__)
131typedef 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