141486Smckusick /* 241486Smckusick * Copyright (c) 1988 University of Utah. 341486Smckusick * Copyright (c) 1990 The Regents of the University of California. 441486Smckusick * All rights reserved. 541486Smckusick * 641486Smckusick * This code is derived from software contributed to Berkeley by 741486Smckusick * the Systems Programming Group of the University of Utah Computer 841486Smckusick * Science Department. 941486Smckusick * 1041486Smckusick * %sccs.include.redist.c% 1141486Smckusick * 1249329Shibler * from: Utah $Hdr: hpux.h 1.18 91/02/09$ 1341486Smckusick * 14*53481Smckusick * @(#)hpux.h 7.5 (Berkeley) 05/13/92 1541486Smckusick */ 1641486Smckusick 1741486Smckusick #include "hpux_exec.h" 1841486Smckusick 1941486Smckusick /* HP-UX style UTSNAME struct used by uname syscall */ 2041486Smckusick 2141486Smckusick struct hpuxutsname { 2241486Smckusick char sysname[9]; 2341486Smckusick char nodename[9]; 2441486Smckusick char release[9]; 2541486Smckusick char version[9]; 2641486Smckusick char machine[9]; 2741486Smckusick char idnumber[15]; 2841486Smckusick }; 2941486Smckusick 3041486Smckusick /* HP-UX style "old" IOCTLs */ 3141486Smckusick 3241486Smckusick struct hpuxsgttyb { 3341486Smckusick char sg_ispeed; 3441486Smckusick char sg_ospeed; 3541486Smckusick char sg_erase; 3641486Smckusick char sg_kill; 3741486Smckusick int sg_flags; /* only a short in BSD */ 3841486Smckusick }; 3941486Smckusick 4041486Smckusick #define V7_HUPCL 00001 4141486Smckusick #define V7_XTABS 00002 4241486Smckusick #define V7_NOAL 04000 4341486Smckusick 4441486Smckusick #define HPUXTIOCGETP _IOR('t', 8, struct hpuxsgttyb) 4541486Smckusick #define HPUXTIOCSETP _IOW('t', 9, struct hpuxsgttyb) 4641486Smckusick 4741486Smckusick /* 6.5 job control related ioctls which need to be mapped */ 4841486Smckusick 4941486Smckusick #define HPUXTIOCSLTC _IOW('T', 23, struct ltchars) 5041486Smckusick #define HPUXTIOCGLTC _IOR('T', 24, struct ltchars) 5141486Smckusick #define HPUXTIOCLBIS _IOW('T', 25, int) 5241486Smckusick #define HPUXTIOCLBIC _IOW('T', 26, int) 5341486Smckusick #define HPUXTIOCLSET _IOW('T', 27, int) 5441486Smckusick #define HPUXTIOCLGET _IOR('T', 28, int) 5541486Smckusick # define HPUXLTOSTOP 0000001 5641486Smckusick #define HPUXTIOCSPGRP _IOW('T', 29, int) 5741486Smckusick #define HPUXTIOCGPGRP _IOR('T', 30, int) 5841486Smckusick #define HPUXTIOCCONS _IO('t', 104) 5941486Smckusick 6049329Shibler /* non-blocking IO--doesn't interfere with O_NDELAY */ 6149329Shibler #define HPUXFIOSNBIO _IOW('f', 126, int) 6249329Shibler 6341486Smckusick /* HP-UX stat structure */ 6441486Smckusick 6541486Smckusick #define bsdtohpuxdev(d) ((major(d) << 24) | minor(d)) 6641486Smckusick 6741486Smckusick struct hpuxstat { 6841486Smckusick long hst_dev; 6941486Smckusick u_long hst_ino; 7041486Smckusick u_short hst_mode; 7141486Smckusick short hst_nlink; 7241486Smckusick u_short hst_uid; 7341486Smckusick u_short hst_gid; 7441486Smckusick long hst_rdev; 75*53481Smckusick long hst_size; 7641486Smckusick time_t hst_atime; 7741486Smckusick int hst_spare1; 7841486Smckusick time_t hst_mtime; 7941486Smckusick int hst_spare2; 8041486Smckusick time_t hst_ctime; 8141486Smckusick int hst_spare3; 8241486Smckusick long hst_blksize; 8341486Smckusick long hst_blocks; 8441486Smckusick u_int hst_remote; 8541486Smckusick long hst_netdev; 8641486Smckusick u_long hst_netino; 8741486Smckusick long hst_spare4[9]; 8841486Smckusick }; 8941486Smckusick 9041486Smckusick /* 9141486Smckusick * Skeletal 6.X HP-UX user structure info for ptrace() mapping. 9241486Smckusick * Yes, this is as bogus as it gets... 9341486Smckusick */ 9441486Smckusick 9541486Smckusick /* 6.0/6.2 offsets */ 9645753Smckusick #define ooHU_AROFF 0x004 9745753Smckusick #define ooHU_TSOFF 0x092 9845753Smckusick #define ooHU_EDOFF 0x91E 9945753Smckusick #define ooHU_FPOFF 0xA66 10045753Smckusick 10145753Smckusick /* 6.5 offsets */ 10241486Smckusick #define oHU_AROFF 0x004 10345753Smckusick #define oHU_TSOFF 0x0B2 10445753Smckusick #define oHU_EDOFF 0x93A 10545753Smckusick #define oHU_FPOFF 0xA86 10641486Smckusick 10745753Smckusick /* 7.X offsets */ 10841486Smckusick #define HU_AROFF 0x004 10945753Smckusick #define HU_TSOFF 0x0B4 11045753Smckusick #define HU_EDOFF 0x8C8 11145753Smckusick #define HU_FPOFF 0xA28 11241486Smckusick 11341486Smckusick #define HU_PAD1 (HU_AROFF) 11441486Smckusick #define HU_PAD2 (HU_TSOFF-HU_AROFF-4) 11541486Smckusick #define HU_PAD3 (HU_EDOFF-HU_TSOFF-12) 11641486Smckusick #define HU_PAD4 (HU_FPOFF-HU_EDOFF-sizeof(struct hpux_exec)) 11741486Smckusick 11841486Smckusick struct hpuxuser { 11941486Smckusick u_char whocares1[HU_PAD1]; /* +0x000 */ 12041486Smckusick int *hpuxu_ar0; /* +0x004 */ 12141486Smckusick u_char whocares2[HU_PAD2]; /* +0x008 */ 12241486Smckusick int hpuxu_tsize; /* +0x0B2 */ 12341486Smckusick int hpuxu_dsize; /* +0x0B6 */ 12441486Smckusick int hpuxu_ssize; /* +0x0BA */ 12541486Smckusick u_char whocares3[HU_PAD3]; /* +0x0BE */ 12641486Smckusick struct hpux_exec hpuxu_exdata; /* +0x93A */ 12741486Smckusick u_char whocares4[HU_PAD4]; /* +0x95E */ 12841486Smckusick struct hpuxfp { /* +0xA66 */ 12941486Smckusick int hpfp_save[54]; 13041486Smckusick int hpfp_ctrl[3]; 13141486Smckusick int hpfp_reg[24]; 13241486Smckusick } hpuxu_fp; 13341486Smckusick short hpuxu_dragon; /* +0xBCA */ 13441486Smckusick }; 13541486Smckusick 13641486Smckusick /* HP-UX compat file flags */ 13741486Smckusick #define HPUXFCREAT 00000400 13841486Smckusick #define HPUXFTRUNC 00001000 13941486Smckusick #define HPUXFEXCL 00002000 14041486Smckusick #define HPUXFSYNCIO 00100000 14141486Smckusick #define HPUXFREMOTE 01000000 14241486Smckusick #define FUSECACHE 04000000 14341486Smckusick 14441486Smckusick /* HP-UX only sysV shmctl() commands */ 14541486Smckusick #define SHM_LOCK 3 /* Lock segment in core */ 14641486Smckusick #define SHM_UNLOCK 4 /* Unlock segment */ 14741486Smckusick 14841486Smckusick /* HP-UX rtprio values */ 14941486Smckusick #define RTPRIO_MIN 0 15041486Smckusick #define RTPRIO_MAX 127 15141486Smckusick #define RTPRIO_NOCHG 1000 15241486Smckusick #define RTPRIO_RTOFF 1001 15341486Smckusick 15441486Smckusick /* HP-UX only sigvec sv_flags values */ 15541486Smckusick #define HPUXSV_RESET 000000004 15641486Smckusick 15741486Smckusick /* 15841486Smckusick * HP-UX returns SIGILL instead of SIGFPE for the CHK and TRAPV exceptions. 15941486Smckusick * It also returns different u_code values for certain illegal instruction 16041486Smckusick * and floating point exceptions. Here are the proper HP-UX u_code values 16141486Smckusick * (numbers from hpux 6.2 manual pages). 16241486Smckusick */ 16341486Smckusick 16441486Smckusick /* SIGILL codes */ 16541486Smckusick #define HPUX_ILL_ILLINST_TRAP 0 /* T_ILLINST+USER */ 16641486Smckusick #define HPUX_ILL_CHK_TRAP 6 /* T_CHKINST+USER */ 16741486Smckusick #define HPUX_ILL_TRAPV_TRAP 7 /* T_TRAPVINST+USER */ 16841486Smckusick #define HPUX_ILL_PRIV_TRAP 8 /* T_PRIVINST+USER */ 16941486Smckusick 17041486Smckusick /* SIGFPE codes */ 17141486Smckusick #define HPUX_FPE_INTDIV_TRAP 5 /* T_ZERODIV+USER */ 17245753Smckusick 17345753Smckusick /* HP-UX POSIX signal stuff implementation */ 17445753Smckusick typedef struct __hpuxsigset_t { long sigset[8]; } hpuxsigset_t; 17545753Smckusick struct hpuxsigaction { 17645753Smckusick void (*sa_handler)(); 17745753Smckusick hpuxsigset_t sa_mask; 17845753Smckusick int sa_flags; 17945753Smckusick }; 18045753Smckusick #define HPUXSA_ONSTACK 1 18145753Smckusick #define HPUXSA_RESETHAND 4 18245753Smckusick #define HPUXSA_NOCLDSTOP 8 18345753Smckusick 18445753Smckusick #define HPUXSIG_BLOCK 0 /* block specified signal set */ 18545753Smckusick #define HPUXSIG_UNBLOCK 1 /* unblock specified signal set */ 18645753Smckusick #define HPUXSIG_SETMASK 2 /* set specified signal set */ 187