sh.types.h revision 69408
1/* $Header: /src/pub/tcsh/sh.types.h,v 3.38 2000/07/04 19:46:23 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(_MINIX_VMD)) || defined(__EMX__) || defined(COHERENT) 176typedef char * caddr_t; 177#endif /* (_MINIX && !_MINIX_VMD) || __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# ifndef _PTR_T 316# define _PTR_T 317 typedef void * ptr_t; 318# endif /* _PTR_T */ 319#endif /* ultrix || __ultrix */ 320 321 322/*** 323 *** Silicon graphics IRIS4D running IRIX3_3 324 ***/ 325#if defined(IRIS4D) && defined(IRIX3_3) 326# ifndef _PID_T 327# define _PID_T 328# endif /* _PID_T */ 329#endif /* IRIS4D && IRIX3_3 */ 330 331 332/*** 333 *** Sequent 334 ***/ 335#ifdef sequent 336# ifndef _SIZE_T 337# define _SIZE_T 338# endif /* _SIZE_T */ 339#endif /* sequent */ 340 341/*** 342 *** Apple AUX. 343 ***/ 344#ifdef OREO 345# ifndef _SIZE_T 346# define _SIZE_T 347# endif /* _SIZE_T */ 348# ifndef _PID_T 349# define _PID_T 350# endif /* _PID_T */ 351#endif /* OREO */ 352 353/*** 354 *** Intel 386, Hypercube 355 ***/ 356#ifdef INTEL 357# ifndef _SIZE_T 358# define _SIZE_T 359# endif /* _SIZE_T */ 360#endif /* INTEL */ 361 362/*** 363 *** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0. 364 **** [RTU 6.0 from mike connor] 365 *** Added, DAS DEC-90. 366 ***/ 367#ifdef masscomp 368# ifndef _SIZE_T 369# define _SIZE_T 370# endif /* _SIZE_T */ 371# ifdef RTU6 372# ifndef _PID_T 373# define _PID_T 374# endif /* _PID_T */ 375# ifndef _SPEED_T 376# define _SPEED_T 377# endif /* _SPEED_T */ 378#endif /* RTU6 */ 379#endif /* masscomp */ 380 381/*** 382 *** Encore multimax running umax 4.2 383 ***/ 384#ifdef ns32000 385# ifdef __TYPES_DOT_H__ 386# ifndef _SIZE_T 387# define _SIZE_T 388# endif /* _SIZE_T */ 389# endif /* __TYPES_DOT_H__ */ 390#endif /* ns32000 */ 391 392/*** 393 *** Silicon Graphics IRIS 3000 394 *** 395 ***/ 396#ifdef IRIS3D 397# ifndef _SIZE_T 398# define _SIZE_T 399# endif /* _SIZE_T */ 400#endif /* IRIS3D */ 401 402/* 403 * Motorola MPC running R32V2 (sysV88) 404 */ 405#ifdef sysV88 406# ifndef _SIZE_T 407# define _SIZE_T 408# endif /* _SIZE_T */ 409# ifndef _PID_T 410# define _PID_T 411# endif /* _PID_T */ 412#endif /* sysV88 */ 413 414/* 415 * Amdahl running UTS (Sys V3) 416 */ 417#ifdef uts 418# ifndef _SIZE_T 419# define _SIZE_T 420# endif /* _SIZE_T */ 421# ifndef _PID_T 422# define _PID_T 423# endif /* _PID_T */ 424#endif /* uts */ 425 426/* 427 * Tektronix 4300 running UTek 4.0 (BSD 4.2) 428 */ 429#ifdef UTek 430# ifndef _SIZE_T 431# define _SIZE_T 432# endif /* _SIZE_T */ 433# ifndef _UID_T 434# define _UID_T 435 typedef int uid_t; 436# endif /* _UID_T */ 437# ifndef _GID_T 438# define _GID_T 439 typedef int gid_t; 440# endif /* _GID_T */ 441#endif /* UTek */ 442 443/* 444 * Tektronix XD88/10 running UTekV (Sys V3) 445 */ 446#ifdef UTekV 447# ifndef _SIZE_T 448# define _SIZE_T 449# endif /* _SIZE_T */ 450# ifndef _PID_T 451# define _PID_T 452# endif /* _PID_T */ 453#endif /* UTekV*/ 454 455/* 456 * UnixPC aka u3b1 457 */ 458#ifdef UNIXPC 459# ifdef types_h 460# ifndef _SIZE_T 461# define _SIZE_T 462# endif /* _SIZE_T */ 463# endif /* types_h */ 464#endif /* UNIXPC */ 465 466/* 467 * NS32000 OPUS 468 */ 469#ifdef OPUS 470# ifndef _SIZE_T 471# define _SIZE_T 472# endif /* _SIZE_T */ 473#endif /* OPUS */ 474 475/* 476 * BBN Butterfly gp1000 477 */ 478#ifdef butterfly 479# ifndef _PID_T 480# define _PID_T 481# endif /* _PID_T */ 482#endif /* butterfly */ 483 484/* 485 * Convex 486 */ 487#ifdef convex 488# if defined(__SIZE_T) && !defined(_SIZE_T) 489# define _SIZE_T 490# endif /* __SIZE_T && !_SIZE_T */ 491#endif /* convex */ 492 493/* 494 * Alliant FX-2800/FX-80 495 */ 496#ifdef alliant 497# ifndef _PID_T 498# define _PID_T 499# endif /* _PID_T */ 500# ifdef mc68000 501 typedef int pid_t; /* FX-80 */ 502# else 503 typedef short pid_t; /* FX-2800 */ 504# endif 505#endif /* alliant */ 506 507/* 508 * DNIX 509 */ 510#ifdef DNIX 511# ifndef _PID_T 512# define _PID_T 513# endif /* _PID_T */ 514#endif /* DNIX */ 515 516/* 517 * Apollo running Domain/OS SR10.3 or greater 518 */ 519#ifdef apollo 520# ifndef _PID_T 521# define _PID_T 522 typedef int pid_t; /* Older versions might not like that */ 523# endif /* _PID_T */ 524#endif /* apollo */ 525 526/* 527 * Vax running VMS_POSIX 528 */ 529#ifdef _VMS_POSIX 530# ifndef _SIZE_T 531# define _SIZE_T 532# endif /* _SIZE_T */ 533#endif /* _VMS_POSIX */ 534 535/*** 536 *** a pdp/11, running 2BSD 537 ***/ 538#ifdef pdp11 539# ifndef _PID_T 540# define _PID_T 541# endif /* _PID_T */ 542#endif /* pdp11 */ 543 544/*** 545 *** a Harris, running CX/UX 546 ***/ 547#ifdef _CX_UX 548# ifndef _PID_T 549# define _PID_T 550# endif /* _PID_T */ 551#endif /* _CX_UX */ 552 553/*** 554 *** Catch all for non POSIX and/or non ANSI systems. 555 *** Systems up to spec *should* define these automatically 556 *** I am open to suggestions on how to do this correctly! 557 ***/ 558 559#ifndef __STDC__ 560 561# ifndef _SIZE_T 562# define _SIZE_T 563 typedef int size_t; /* As sun comments ??? : meaning I take it */ 564# endif /* _SIZE_T */ /* Until we make the world ANSI... */ 565 566#endif /* ! __STDC__ */ 567 568#ifndef POSIX 569 570# ifndef _PID_T 571# define _PID_T 572 typedef int pid_t; 573# endif /* _PID_T */ 574 575# ifndef _SPEED_T 576# define _SPEED_T 577 typedef unsigned int speed_t; 578# endif /* _SPEED_T */ 579 580# ifndef _PTR_T 581# define _PTR_T 582 typedef char * ptr_t; 583#endif /* _PTR_T */ 584 585# ifndef _IOCTL_T 586# define _IOCTL_T 587 typedef char * ioctl_t; /* Third arg of ioctl */ 588# endif /* _IOCTL_T */ 589 590#endif /* ! POSIX */ 591 592 593 594/*** 595 *** This is our own junk types. 596 ***/ 597#ifndef _PTR_T 598# define _PTR_T 599 typedef void * ptr_t; 600#endif /* _PTR_T */ 601 602#ifndef _SIGMASK_T 603# define _SIGMASK_T 604 typedef int sigmask_t; 605#endif /* _SIGMASK_T */ 606 607#ifndef _IOCTL_T 608# define _IOCTL_T 609 typedef void * ioctl_t; /* Third arg of ioctl */ 610#endif /* _IOCTL_T */ 611 612#endif /* _h_sh_types */ 613