sh.types.h revision 59243
1/* $Header: /src/pub/tcsh/sh.types.h,v 3.36 1998/04/21 16:08:51 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. All advertising materials mentioning features or use of this software 26 * must display the following acknowledgement: 27 * This product includes software developed by the University of 28 * California, Berkeley and its contributors. 29 * 4. Neither the name of the University nor the names of its contributors 30 * may be used to endorse or promote products derived from this software 31 * without specific prior written permission. 32 * 33 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 34 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 36 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 37 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 43 * SUCH DAMAGE. 44 */ 45#ifndef _h_sh_types 46#define _h_sh_types 47 48 49/*** 50 *** LynxOS 2.1 51 ***/ 52#ifdef Lynx 53# ifndef _SIGMASK_T 54# define _SIGMASK_T 55 typedef long sigmask_t; 56# endif /* _SIGMASK_T */ 57# ifndef _PID_T 58# define _PID_T 59# endif /* _PID_T */ 60#endif 61 62/*** 63 *** MachTen 64 ***/ 65#ifdef __MACHTEN__ 66# ifndef _PID_T 67# define _PID_T 68# endif 69#endif 70 71 72/*** 73 *** Suns running sunos3.x - sunos4.1.x 74 ***/ 75#if (defined(sun) || defined(__sun__)) && SYSVREL == 0 76/* This used to be long, but lint dissagrees... */ 77# ifndef _SIGMASK_T 78# define _SIGMASK_T 79 typedef int sigmask_t; 80# endif /* _SIGMASK_T */ 81# ifndef _PTR_T 82# define _PTR_T 83# ifdef __GNUC__ 84 typedef void * ptr_t; 85# else 86 typedef char * ptr_t; 87# endif /* __GNUC__ */ 88# endif /* _PTR_T */ 89# ifndef _SIZE_T 90# define _SIZE_T 91# endif /* _SIZE_T */ 92# ifndef __sys_stdtypes_h 93# define __sys_stdtypes_h 94# ifndef __lucid 95 typedef int pid_t; 96 typedef unsigned int speed_t; 97# endif 98# endif /* __sys_stdtypes.h */ 99# ifndef _PID_T 100# define _PID_T 101# endif /* _PID_T */ 102# ifndef _SPEED_T 103# define _SPEED_T 104# endif /* _SPEED_T */ 105# ifndef SUNOS4 106# ifndef MACH 107# ifndef _UID_T 108# define _UID_T 109 typedef int uid_t; 110# endif /* _UID_T */ 111# ifndef _GID_T 112# define _GID_T 113 typedef int gid_t; 114# endif /* _GID_T */ 115# endif /* !MACH */ 116# endif /* !SUNOS4 */ 117#endif /* (sun || __sun__) && SYSVREL == 0 */ 118 119 120/*** 121 *** Hp's running hpux 7.0 or 8.0 122 ***/ 123#ifdef __hpux 124# ifndef _SIZE_T 125# define _SIZE_T 126 typedef unsigned int size_t; 127# endif /* _SIZE_T */ 128 129# ifndef _PTR_T 130# define _PTR_T 131 typedef void * ptr_t; 132# endif /* _PTR_T */ 133 134# ifndef _PID_T 135# define _PID_T 136 typedef long pid_t; 137# endif /* _PID_T */ 138 139# ifndef _SIGMASK_T 140# define _SIGMASK_T 141 typedef long sigmask_t; 142# endif /* _SIGMASK_T */ 143 144# ifndef _SPEED_T 145 /* I thought POSIX was supposed to protect all typedefs! */ 146# define _SPEED_T 147# endif /* _SPEED_T */ 148 149extern uid_t getuid(), geteuid(); 150extern gid_t getgid(), getegid(); 151extern sigmask_t sigblock(); 152extern sigmask_t sigsetmask(); 153extern pid_t getpid(); 154extern pid_t fork(); 155extern void perror(); 156extern void _exit(); 157extern void abort(); 158extern void qsort(); 159extern void free(); 160extern unsigned int alarm(); 161extern unsigned int sleep(); 162# if HPUXVERSION < 800 /* XXX: Not true for 8.0 */ 163extern void sigpause(); 164extern sigmask_t sigspace(); 165extern int lstat(); 166extern int readlink(); 167extern int sigvector(); 168extern int gethostname(); 169extern int ioctl(); 170extern int nice(); 171extern char *sbrk(); 172# endif /* HPUXVERSION < 800 */ 173#endif /* __hpux */ 174 175#if defined(_MINIX) || defined(__EMX__) || defined(COHERENT) 176typedef char * caddr_t; 177#endif /* _MINIX || __EMX__ || COHERENT */ 178 179/*** 180 *** hp9000s500 running hpux-5.2 181 ***/ 182#ifdef hp9000s500 183# ifndef _PTR_T 184# define _PTR_T 185 typedef char * ptr_t; 186# endif /* _PTR_T */ 187#endif /* hp9000s500 */ 188 189/*** 190 *** Data General AViiON 88000 or Pentium, running dgux 5.4R3 or R4.11 191 ***/ 192#ifdef DGUX 193# ifndef _SIZE_T 194# define _SIZE_T size_t 195 typedef unsigned int size_t; 196# endif /* _SIZE_T */ 197# ifndef _PID_T 198# define _PID_T 199# endif /* _PID_T */ 200#endif /* DGUX */ 201 202 203/*** 204 *** Intel 386, ISC 386/ix v2.0.2 205 ***/ 206#ifdef ISC202 207# ifndef _SIZE_T 208# define _SIZE_T 209# endif /* _SIZE_T */ 210#endif /* ISC202 */ 211 212/*** 213 *** a PFU/Fujitsu A-xx computer SX/A Edition 60 or later 214 ***/ 215#ifdef SXA 216# ifndef _SIZE_T 217# define _SIZE_T 218# endif /* _SIZE_T */ 219#endif /* SXA */ 220 221/*** 222 *** a stellar 2600, running stellix 2.3 223 ***/ 224#ifdef stellar 225# ifndef _SIZE_T 226# define _SIZE_T 227# endif /* _SIZE_T */ 228#endif /* stellar */ 229 230/*** 231 *** BSD systems, pre and post 4.3 232 ***/ 233#ifdef BSD 234# ifndef _SIZE_T 235# define _SIZE_T 236# endif /* _SIZE_T */ 237#endif /* BSD */ 238 239 240/*** 241 *** BSD RENO advertises itself as POSIX, but 242 *** it is missing speed_t 243 ***/ 244#ifdef RENO 245# ifndef _SPEED_T 246# define _SPEED_T 247 typedef unsigned int speed_t; 248# endif /* _SPEED_T */ 249#endif /* RENO */ 250 251 252/*** 253 *** NeXT OS 3.x 254 ***/ 255#ifdef NeXT 256# ifndef _SPEED_T 257# define _SPEED_T 258 typedef unsigned int speed_t; 259# endif /* _SPEED_T */ 260#endif /* NeXT */ 261 262/*** 263 *** Utah's HPBSD 264 *** some posix & 4.4 BSD changes (pid_t is a short) 265 ***/ 266#ifdef HPBSD 267# ifndef _PID_T 268# define _PID_T 269# endif /* _PID_T */ 270#endif /* HPBSD */ 271 272 273/*** 274 *** Pyramid, BSD universe 275 *** In addition to the size_t 276 ***/ 277#ifdef pyr 278# ifndef _PID_T 279# define _PID_T 280 typedef short pid_t; 281# endif /* _PID_T */ 282#endif /* pyr */ 283 284 285/*** 286 *** rs6000, ibm370, ps2, rt: running flavors of aix. 287 ***/ 288#ifdef IBMAIX 289# ifndef _SIZE_T 290# define _SIZE_T 291# endif /* _SIZE_T */ 292# ifndef aiws 293# ifndef _PID_T 294# define _PID_T 295# endif /* _PID_T */ 296# endif /* !aiws */ 297# ifdef _IBMR2 298# ifndef _SPEED_T 299# define _SPEED_T 300# endif /* _SPEED_T */ 301# endif /* _IBMR2 */ 302#endif /* IBMAIX */ 303 304 305/*** 306 *** Ultrix... 307 ***/ 308#if defined(ultrix) || defined(__ultrix) 309# ifndef _SIZE_T 310# define _SIZE_T 311# endif /* _SIZE_T */ 312# ifndef _PID_T 313# define _PID_T 314# endif /* _PID_T */ 315#endif /* ultrix || __ultrix */ 316 317 318/*** 319 *** Silicon graphics IRIS4D running IRIX3_3 320 ***/ 321#if defined(IRIS4D) && defined(IRIX3_3) 322# ifndef _PID_T 323# define _PID_T 324# endif /* _PID_T */ 325#endif /* IRIS4D && IRIX3_3 */ 326 327 328/*** 329 *** Sequent 330 ***/ 331#ifdef sequent 332# ifndef _SIZE_T 333# define _SIZE_T 334# endif /* _SIZE_T */ 335#endif /* sequent */ 336 337/*** 338 *** Apple AUX. 339 ***/ 340#ifdef OREO 341# ifndef _SIZE_T 342# define _SIZE_T 343# endif /* _SIZE_T */ 344# ifndef _PID_T 345# define _PID_T 346# endif /* _PID_T */ 347#endif /* OREO */ 348 349/*** 350 *** Intel 386, Hypercube 351 ***/ 352#ifdef INTEL 353# ifndef _SIZE_T 354# define _SIZE_T 355# endif /* _SIZE_T */ 356#endif /* INTEL */ 357 358/*** 359 *** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0. 360 **** [RTU 6.0 from mike connor] 361 *** Added, DAS DEC-90. 362 ***/ 363#ifdef masscomp 364# ifndef _SIZE_T 365# define _SIZE_T 366# endif /* _SIZE_T */ 367# ifdef RTU6 368# ifndef _PID_T 369# define _PID_T 370# endif /* _PID_T */ 371# ifndef _SPEED_T 372# define _SPEED_T 373# endif /* _SPEED_T */ 374#endif /* RTU6 */ 375#endif /* masscomp */ 376 377/*** 378 *** Encore multimax running umax 4.2 379 ***/ 380#ifdef ns32000 381# ifdef __TYPES_DOT_H__ 382# ifndef _SIZE_T 383# define _SIZE_T 384# endif /* _SIZE_T */ 385# endif /* __TYPES_DOT_H__ */ 386#endif /* ns32000 */ 387 388/*** 389 *** Silicon Graphics IRIS 3000 390 *** 391 ***/ 392#ifdef IRIS3D 393# ifndef _SIZE_T 394# define _SIZE_T 395# endif /* _SIZE_T */ 396#endif /* IRIS3D */ 397 398/* 399 * Motorola MPC running R32V2 (sysV88) 400 */ 401#ifdef sysV88 402# ifndef _SIZE_T 403# define _SIZE_T 404# endif /* _SIZE_T */ 405# ifndef _PID_T 406# define _PID_T 407# endif /* _PID_T */ 408#endif /* sysV88 */ 409 410/* 411 * Amdahl running UTS (Sys V3) 412 */ 413#ifdef uts 414# ifndef _SIZE_T 415# define _SIZE_T 416# endif /* _SIZE_T */ 417# ifndef _PID_T 418# define _PID_T 419# endif /* _PID_T */ 420#endif /* uts */ 421 422/* 423 * Tektronix 4300 running UTek 4.0 (BSD 4.2) 424 */ 425#ifdef UTek 426# ifndef _SIZE_T 427# define _SIZE_T 428# endif /* _SIZE_T */ 429# ifndef _UID_T 430# define _UID_T 431 typedef int uid_t; 432# endif /* _UID_T */ 433# ifndef _GID_T 434# define _GID_T 435 typedef int gid_t; 436# endif /* _GID_T */ 437#endif /* UTek */ 438 439/* 440 * Tektronix XD88/10 running UTekV (Sys V3) 441 */ 442#ifdef UTekV 443# ifndef _SIZE_T 444# define _SIZE_T 445# endif /* _SIZE_T */ 446# ifndef _PID_T 447# define _PID_T 448# endif /* _PID_T */ 449#endif /* UTekV*/ 450 451/* 452 * UnixPC aka u3b1 453 */ 454#ifdef UNIXPC 455# ifdef types_h 456# ifndef _SIZE_T 457# define _SIZE_T 458# endif /* _SIZE_T */ 459# endif /* types_h */ 460#endif /* UNIXPC */ 461 462/* 463 * NS32000 OPUS 464 */ 465#ifdef OPUS 466# ifndef _SIZE_T 467# define _SIZE_T 468# endif /* _SIZE_T */ 469#endif /* OPUS */ 470 471/* 472 * BBN Butterfly gp1000 473 */ 474#ifdef butterfly 475# ifndef _PID_T 476# define _PID_T 477# endif /* _PID_T */ 478#endif /* butterfly */ 479 480/* 481 * Convex 482 */ 483#ifdef convex 484# if defined(__SIZE_T) && !defined(_SIZE_T) 485# define _SIZE_T 486# endif /* __SIZE_T && !_SIZE_T */ 487#endif /* convex */ 488 489/* 490 * Alliant FX-2800/FX-80 491 */ 492#ifdef alliant 493# ifndef _PID_T 494# define _PID_T 495# endif /* _PID_T */ 496# ifdef mc68000 497 typedef int pid_t; /* FX-80 */ 498# else 499 typedef short pid_t; /* FX-2800 */ 500# endif 501#endif /* alliant */ 502 503/* 504 * DNIX 505 */ 506#ifdef DNIX 507# ifndef _PID_T 508# define _PID_T 509# endif /* _PID_T */ 510#endif /* DNIX */ 511 512/* 513 * Apollo running Domain/OS SR10.3 or greater 514 */ 515#ifdef apollo 516# ifndef _PID_T 517# define _PID_T 518 typedef int pid_t; /* Older versions might not like that */ 519# endif /* _PID_T */ 520#endif /* apollo */ 521 522/* 523 * Vax running VMS_POSIX 524 */ 525#ifdef _VMS_POSIX 526# ifndef _SIZE_T 527# define _SIZE_T 528# endif /* _SIZE_T */ 529#endif /* _VMS_POSIX */ 530 531/*** 532 *** a pdp/11, running 2BSD 533 ***/ 534#ifdef pdp11 535# ifndef _PID_T 536# define _PID_T 537# endif /* _PID_T */ 538#endif /* pdp11 */ 539 540/*** 541 *** a Harris, running CX/UX 542 ***/ 543#ifdef _CX_UX 544# ifndef _PID_T 545# define _PID_T 546# endif /* _PID_T */ 547#endif /* _CX_UX */ 548 549/*** 550 *** Catch all for non POSIX and/or non ANSI systems. 551 *** Systems up to spec *should* define these automatically 552 *** I am open to suggestions on how to do this correctly! 553 ***/ 554 555#ifndef __STDC__ 556 557# ifndef _SIZE_T 558# define _SIZE_T 559 typedef int size_t; /* As sun comments ??? : meaning I take it */ 560# endif /* _SIZE_T */ /* Until we make the world ANSI... */ 561 562#endif /* ! __STDC__ */ 563 564#ifndef POSIX 565 566# ifndef _PID_T 567# define _PID_T 568 typedef int pid_t; 569# endif /* _PID_T */ 570 571# ifndef _SPEED_T 572# define _SPEED_T 573 typedef unsigned int speed_t; 574# endif /* _SPEED_T */ 575 576# ifndef _PTR_T 577# define _PTR_T 578 typedef char * ptr_t; 579#endif /* _PTR_T */ 580 581# ifndef _IOCTL_T 582# define _IOCTL_T 583 typedef char * ioctl_t; /* Third arg of ioctl */ 584# endif /* _IOCTL_T */ 585 586#endif /* ! POSIX */ 587 588 589 590/*** 591 *** This is our own junk types. 592 ***/ 593#ifndef _PTR_T 594# define _PTR_T 595 typedef void * ptr_t; 596#endif /* _PTR_T */ 597 598#ifndef _SIGMASK_T 599# define _SIGMASK_T 600 typedef int sigmask_t; 601#endif /* _SIGMASK_T */ 602 603#ifndef _IOCTL_T 604# define _IOCTL_T 605 typedef void * ioctl_t; /* Third arg of ioctl */ 606#endif /* _IOCTL_T */ 607 608#endif /* _h_sh_types */ 609