5include/ctype.h
/* @(#)ctype.h 1.8 89/10/06 SMI; from S5R3.1 1.9 */
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* Portions Copyright (c) 1989 Sun Microsystems, Inc. */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ifndef __ctype_h
#define __ctype_h
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
#define _N 04 /* Numeral (digit) */
#define _S 010 /* Spacing character */
#define _P 020 /* Punctuation */
#define _C 040 /* Control character */
#define _X 0100 /* heXadecimal digit */
#define _B 0200 /* Blank */
extern int isalnum(/* int c */);
extern int isalpha(/* int c */);
#ifndef _POSIX_SOURCE
extern int isascii(/* int c */);
#endif
extern int iscntrl(/* int c */);
extern int isdigit(/* int c */);
extern int isgraph(/* int c */);
extern int islower(/* int c */);
extern int isprint(/* int c */);
extern int ispunct(/* int c */);
extern int isspace(/* int c */);
extern int isupper(/* int c */);
extern int isxdigit(/* int c */);
#ifndef _POSIX_SOURCE
extern int toascii(/* int c */);
#endif
extern int tolower(/* int c */);
extern int toupper(/* int c */);
#ifndef lint
#define isalnum(c) ((_ctype_ + 1)[c] & (_U | _L | _N))
#define isalpha(c) ((_ctype_ + 1)[c] & (_U | _L))
#ifndef _POSIX_SOURCE
#define isascii(c) (!((c) & ~0177))
#endif
#define iscntrl(c) ((_ctype_ + 1)[c] & _C)
#define isdigit(c) ((_ctype_ + 1)[c] & _N)
#define isgraph(c) ((_ctype_ + 1)[c] & (_P | _U | _L | _N))
#define islower(c) ((_ctype_ + 1)[c] & _L)
#define isprint(c) ((_ctype_ + 1)[c] & (_P | _U | _L | _N | _B))
#define ispunct(c) ((_ctype_ + 1)[c] & _P)
#define isspace(c) ((_ctype_ + 1)[c] & _S)
#define isupper(c) ((_ctype_ + 1)[c] & _U)
#define isxdigit(c) ((_ctype_ + 1)[c] & _X)
#ifndef _POSIX_SOURCE
#define toascii(c) ((c) & 0177)
/*
* These upper/lower macros are not codeset independent
*/
#define _toupper(c) ((c) - 'a' + 'A')
#define _tolower(c) ((c) - 'A' + 'a')
#endif
extern char _ctype_[];
#endif /* lint */
#endif /* !__ctype_h */
include/sys/acct.h
/* @(#)acct.h 2.10 88/08/19 SMI; from UCB 7.1 6/4/86 */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#ifndef _sys_acct_h
#define _sys_acct_h
/*
* Accounting structures;
* these use a comp_t type which is a 3 bits base 8
* exponent, 13 bit fraction ``floating point'' number.
*/
typedef u_short comp_t;
struct acct
{
char ac_flag; /* Accounting flag */
char ac_stat; /* Exit status */
uid_t ac_uid; /* Accounting user ID */
gid_t ac_gid; /* Accounting group ID */
dev_t ac_tty; /* control typewriter */
time_t ac_btime; /* Beginning time */
comp_t ac_utime; /* Accounting user time */
comp_t ac_stime; /* Accounting system time */
comp_t ac_etime; /* Accounting elapsed time */
comp_t ac_mem; /* average memory usage */
comp_t ac_io; /* chars transferred */
comp_t ac_rw; /* blocks read or written */
char ac_comm[8]; /* Accounting command name */
};
#define AFORK 0001 /* has executed fork, but no exec */
#define ASU 0002 /* used super-user privileges */
#define ACOMPAT 0004 /* used compatibility mode */
#define ACORE 0010 /* dumped core */
#define AXSIG 0020 /* killed by a signal */
#define ACCTF 0300 /* record type: 00 = acct */
#ifdef KERNEL
#ifdef SYSACCT
struct acct acctbuf;
struct vnode *acctp;
#else
#define acct()
#endif
#endif
#endif /*!_sys_acct_h*/
include/sys/errno.h
/* @(#)errno.h 2.14 90/01/23 SMI; from UCB 4.1 82/12/28 */
/*
* If error codes are added or changed here, they should be updated in
* /usr/src/lib/libc/gen/common/errlst.c as well.
*/
/*
* Error codes
*/
#ifndef _sys_errno_h
#define _sys_errno_h
#define EPERM 1 /* Not owner */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Arg list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No children */
#define EAGAIN 11 /* No more processes */
#define ENOMEM 12 /* Not enough core */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#define ENOTBLK 15 /* Block device required */
#define EBUSY 16 /* Mount device busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory*/
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* File table overflow */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Not a typewriter */
#define ETXTBSY 26 /* Text file busy */
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
/* math software */
#define EDOM 33 /* Argument too large */
#define ERANGE 34 /* Result too large */
/* non-blocking and interrupt i/o */
#define EWOULDBLOCK 35 /* Operation would block */
#define EINPROGRESS 36 /* Operation now in progress */
#define EALREADY 37 /* Operation already in progress */
/* ipc/network software */
/* argument errors */
#define ENOTSOCK 38 /* Socket operation on non-socket */
#define EDESTADDRREQ 39 /* Destination address required */
#define EMSGSIZE 40 /* Message too long */
#define EPROTOTYPE 41 /* Protocol wrong type for socket */
#define ENOPROTOOPT 42 /* Protocol not available */
#define EPROTONOSUPPORT 43 /* Protocol not supported */
#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
#define EOPNOTSUPP 45 /* Operation not supported on socket */
#define EPFNOSUPPORT 46 /* Protocol family not supported */
#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
#define EADDRINUSE 48 /* Address already in use */
#define EADDRNOTAVAIL 49 /* Can't assign requested address */
/* operational errors */
#define ENETDOWN 50 /* Network is down */
#define ENETUNREACH 51 /* Network is unreachable */
#define ENETRESET 52 /* Network dropped connection on reset */
#define ECONNABORTED 53 /* Software caused connection abort */
#define ECONNRESET 54 /* Connection reset by peer */
#define ENOBUFS 55 /* No buffer space available */
#define EISCONN 56 /* Socket is already connected */
#define ENOTCONN 57 /* Socket is not connected */
#define ESHUTDOWN 58 /* Can't send after socket shutdown */
#define ETOOMANYREFS 59 /* Too many references: can't splice */
#define ETIMEDOUT 60 /* Connection timed out */
#define ECONNREFUSED 61 /* Connection refused */
/* */
#define ELOOP 62 /* Too many levels of symbolic links */
#define ENAMETOOLONG 63 /* File name too long */
/* should be rearranged */
#define EHOSTDOWN 64 /* Host is down */
#define EHOSTUNREACH 65 /* No route to host */
#define ENOTEMPTY 66 /* Directory not empty */
/* quotas & mush */
#define EPROCLIM 67 /* Too many processes */
#define EUSERS 68 /* Too many users */
#define EDQUOT 69 /* Disc quota exceeded */
/* Network File System */
#define ESTALE 70 /* Stale NFS file handle */
#define EREMOTE 71 /* Too many levels of remote in path */
/* streams */
#define ENOSTR 72 /* Device is not a stream */
#define ETIME 73 /* Timer expired */
#define ENOSR 74 /* Out of streams resources */
#define ENOMSG 75 /* No message of desired type */
#define EBADMSG 76 /* Trying to read unreadable message */
/* SystemV IPC */
#define EIDRM 77 /* Identifier removed */
/* SystemV Record Locking */
#define EDEADLK 78 /* Deadlock condition. */
#define ENOLCK 79 /* No record locks available. */
/* RFS */
#define ENONET 80 /* Machine is not on the network */
#define ERREMOTE 81 /* Object is remote */
#define ENOLINK 82 /* the link has been severed */
#define EADV 83 /* advertise error */
#define ESRMNT 84 /* srmount error */
#define ECOMM 85 /* Communication error on send */
#define EPROTO 86 /* Protocol error */
#define EMULTIHOP 87 /* multihop attempted */
#define EDOTDOT 88 /* Cross mount point (not an error) */
#define EREMCHG 89 /* Remote address changed */
/* POSIX */
#define ENOSYS 90 /* function not implemented */
#endif /*!_sys_errno_h*/
include/sys/exec.h
/* @(#)exec.h 1.7 88/08/19 SMI */
/*
* Copyright (c) 1985 by Sun Microsystems, Inc.
*/
#ifndef _sys_exec_h
#define _sys_exec_h
/*
* format of the exec header
* known by kernel and by user programs
*/
struct exec {
#ifdef sun
unsigned char a_dynamic:1; /* has a __DYNAMIC */
unsigned char a_toolversion:7;/* version of toolset used to create this file */
unsigned char a_machtype; /* machine type */
unsigned short a_magic; /* magic number */
#else
unsigned long a_magic; /* magic number */
#endif
unsigned long a_text; /* size of text segment */
unsigned long a_data; /* size of initialized data */
unsigned long a_bss; /* size of uninitialized data */
unsigned long a_syms; /* size of symbol table */
unsigned long a_entry; /* entry point */
unsigned long a_trsize; /* size of text relocation */
unsigned long a_drsize; /* size of data relocation */
};
#define OMAGIC 0407 /* old impure format */
#define NMAGIC 0410 /* read-only text */
#define ZMAGIC 0413 /* demand load format */
/* machine types */
#ifdef sun
#define M_OLDSUN2 0 /* old sun-2 executable files */
#define M_68010 1 /* runs on either 68010 or 68020 */
#define M_68020 2 /* runs only on 68020 */
#define M_SPARC 3 /* runs only on SPARC */
#define TV_SUN2_SUN3 0
#define TV_SUN4 1
#endif sun
#endif /*!_sys_exec_h*/
include/sys/filio.h
/* @(#)filio.h 1.5 91/06/18 SMI; from UCB ioctl.h 7.1 6/4/86 */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* General file ioctl definitions.
*/
#ifndef _sys_filio_h
#define _sys_filio_h
#include <sys/ioccom.h>
#define FIOCLEX _IO(f, 1) /* set exclusive use on fd */
#define FIONCLEX _IO(f, 2) /* remove exclusive use */
/* another local */
#define FIONREAD _IOR(f, 127, int) /* get # bytes to read */
#define FIONBIO _IOW(f, 126, int) /* set/clear non-blocking i/o */
#define FIOASYNC _IOW(f, 125, int) /* set/clear async i/o */
#define FIOSETOWN _IOW(f, 124, int) /* set owner */
#define FIOGETOWN _IOR(f, 123, int) /* get owner */
/* file system locking */
#define FIOLFS _IO(f, 64) /* file system lock */
#define FIOLFSS _IO(f, 65) /* file system lock status */
#define FIOFFS _IO(f, 66) /* file system flush */
/* short term backup */
#define FIOAI _IO(f, 67) /* allocation information */
#define FIODUTIMES _IO(f, 68) /* delay update access time */
#define FIODIO _IO(f, 69) /* delay write all data */
#define FIODIOS _IO(f, 70) /* status of FIODIO */
#endif /*!_sys_filio_h*/
include/sys/ioccom.h
/* @(#)ioccom.h 1.7 89/06/16 SMI; from UCB ioctl.h 7.1 6/4/86 */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#ifndef __sys_ioccom_h
#define __sys_ioccom_h
/*
* Ioctl's have the command encoded in the lower word,
* and the size of any in or out parameters in the upper
* word. The high 2 bits of the upper word are used
* to encode the in/out status of the parameter; for now
* we restrict parameters to at most 255 bytes.
*/
#define _IOCPARM_MASK 0xff /* parameters must be < 256 bytes */
#define _IOC_VOID 0x20000000 /* no parameters */
#define _IOC_OUT 0x40000000 /* copy out parameters */
#define _IOC_IN 0x80000000 /* copy in parameters */
#define _IOC_INOUT (_IOC_IN|_IOC_OUT)
/* the 0x20000000 is so we can distinguish new ioctl's from old */
#define _IO(x,y) (_IOC_VOID|('x'<<8)|y)
#define _IOR(x,y,t) (_IOC_OUT|((sizeof(t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define _IORN(x,y,t) (_IOC_OUT|(((t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define _IOW(x,y,t) (_IOC_IN|((sizeof(t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define _IOWN(x,y,t) (_IOC_IN|(((t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
/* this should be _IORW, but stdio got there first */
#define _IOWR(x,y,t) (_IOC_INOUT|((sizeof(t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
#define _IOWRN(x,y,t) (_IOC_INOUT|(((t)&_IOCPARM_MASK)<<16)|('x'<<8)|y)
/*
* Registry of ioctl characters, culled from system sources
*
* char file where defined notes
* ---- ------------------ -----
* F sun/fbio.h
* G sun/gpio.h
* H vaxif/if_hy.h
* M sundev/mcpcmd.h *overlap*
* M sys/modem.h *overlap*
* S sys/stropts.h
* T sys/termio.h -no overlap-
* T sys/termios.h -no overlap-
* V sundev/mdreg.h
* a vaxuba/adreg.h
* d sun/dkio.h -no overlap with sys/des.h-
* d sys/des.h (possible overlap)
* d vax/dkio.h (possible overlap)
* d vaxuba/rxreg.h (possible overlap)
* f sys/filio.h
* g sunwindow/win_ioctl.h -no overlap-
* g sunwindowdev/winioctl.c !no manifest constant! -no overlap-
* h sundev/hrc_common.h
* i sys/sockio.h *overlap*
* i vaxuba/ikreg.h *overlap*
* k sundev/kbio.h
* m sundev/msio.h (possible overlap)
* m sundev/msreg.h (possible overlap)
* m sys/mtio.h (possible overlap)
* n sun/ndio.h
* p net/nit_buf.h (possible overlap)
* p net/nit_if.h (possible overlap)
* p net/nit_pf.h (possible overlap)
* p sundev/fpareg.h (possible overlap)
* p sys/sockio.h (possible overlap)
* p vaxuba/psreg.h (possible overlap)
* q sun/sqz.h
* r sys/sockio.h
* s sys/sockio.h
* t sys/ttold.h (possible overlap)
* t sys/ttycom.h (possible overlap)
* v sundev/vuid_event.h *overlap*
* v sys/vcmd.h *overlap*
*
* End of Registry
*/
#endif /* !__sys_ioccom_h */
include/sys/ioctl.h
/* @(#)ioctl.h 2.18 88/08/19 SMI; from UCB 7.1 6/4/86 */
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Ioctl definitions
*/
#ifndef _sys_ioctl_h
#define _sys_ioctl_h
#include <sys/ttychars.h>
#include <sys/ttydev.h>
#include <sys/ttold.h>
#define TANDEM O_TANDEM
#define CBREAK O_CBREAK
#define LCASE O_LCASE
#define ECHO O_ECHO
#define CRMOD O_CRMOD
#define RAW O_RAW
#define ODDP O_ODDP
#define EVENP O_EVENP
#define ANYP O_ANYP
#define NLDELAY O_NLDELAY
#define NL0 O_NL0
#define NL1 O_NL1
#define NL2 O_NL2
#define NL3 O_NL3
#define TBDELAY O_TBDELAY
#define TAB0 O_TAB0
#define TAB1 O_TAB1
#define TAB2 O_TAB2
#define XTABS O_XTABS
#define CRDELAY O_CRDELAY
#define CR0 O_CR0
#define CR1 O_CR1
#define CR2 O_CR2
#define CR3 O_CR3
#define VTDELAY O_VTDELAY
#define FF0 O_FF0
#define FF1 O_FF1
#define BSDELAY O_BSDELAY
#define BS0 O_BS0
#define BS1 O_BS1
#define ALLDELAY O_ALLDELAY
#define CRTBS O_CRTBS
#define PRTERA O_PRTERA
#define CRTERA O_CRTERA
#define TILDE O_TILDE
#define MDMBUF O_MDMBUF
#define LITOUT O_LITOUT
#define TOSTOP O_TOSTOP
#define FLUSHO O_FLUSHO
#define NOHANG O_NOHANG
#define L001000 O_L001000
#define CRTKIL O_CRTKIL
#define PASS8 O_PASS8
#define CTLECH O_CTLECH
#define PENDIN O_PENDIN
#define DECCTQ O_DECCTQ
#define NOFLSH O_NOFLSH
#include <sys/filio.h>
#include <sys/sockio.h>
#endif /*!_sys_ioctl_h*/
include/sys/ipc.h
/* @(#)ipc.h 1.5 88/08/19 SMI; from S5R2 6.1 */
/* Common IPC Access Structure */
#ifndef _sys_ipc_h
#define _sys_ipc_h
struct ipc_perm {
ushort uid; /* owner's user id */
ushort gid; /* owner's group id */
ushort cuid; /* creator's user id */
ushort cgid; /* creator's group id */
ushort mode; /* access modes */
ushort seq; /* slot usage sequence number */
key_t key; /* key */
};
/* Common IPC Definitions. */
/* Mode bits. */
#define IPC_ALLOC 0100000 /* entry currently allocated */
#define IPC_CREAT 0001000 /* create entry if key doesn't exist */
#define IPC_EXCL 0002000 /* fail if key exists */
#define IPC_NOWAIT 0004000 /* error if request must wait */
/* Keys. */
#define IPC_PRIVATE (key_t)0 /* private key */
/* Control Commands. */
#define IPC_RMID 0 /* remove identifier */
#define IPC_SET 1 /* set options */
#define IPC_STAT 2 /* get options */
#endif /*!_sys_ipc_h*/
include/sys/shm.h
/* @(#)shm.h 1.13 88/08/19 SMI; from SVR3 10.10 */
/*
* IPC Shared Memory Facility.
*/
#ifndef _sys_shm_h
#define _sys_shm_h
#include <sys/param.h>
#include <machine/mmu.h>
/*
* Shared Memory Operation Flags.
*/
#define SHM_RDONLY 010000 /* attach read-only (else read-write) */
#define SHM_RND 020000 /* round attach address to SHMLBA */
/*
* Shmctl Command Definitions.
*/
#define SHM_LOCK 3 /* Lock segment in core */
#define SHM_UNLOCK 4 /* Unlock segment */
/*
* Implementation Constants.
*/
#define SHMLBA PAGESIZE /* segment low boundary address multiple */
/* (SHMLBA must be a power of 2) */
/*
* Structure Definitions.
*/
/*
* There is a shared mem id data structure for each segment in the system.
*/
struct shmid_ds {
struct ipc_perm shm_perm; /* operation permission struct */
uint shm_segsz; /* size of segment in bytes */
ushort shm_lpid; /* pid of last shmop */
ushort shm_cpid; /* pid of creator */
ushort shm_nattch; /* number of current attaches */
time_t shm_atime; /* last shmat time */
time_t shm_dtime; /* last shmdt time */
time_t shm_ctime; /* last change time */
struct anon_map *shm_amp; /* segment anon_map pointer */
};
#ifdef KERNEL
/*
* Permission Definitions.
*/
#define SHM_W 0200 /* write permission */
#define SHM_R 0400 /* read permission */
/*
* ipc_perm Mode Definitions.
*/
#define SHM_INIT 001000 /* segment not yet initialized */
#define SHM_LOCKED 004000 /* shmid locked */
#define SHM_LOCKWAIT 010000 /* shmid wanted */
#define PSHM (PZERO + 1) /* sleep priority */
/* define resource locking macros */
#define SHMLOCK(sp) { \
while ((sp)->shm_perm.mode & SHM_LOCKED) { \
(sp)->shm_perm.mode |= SHM_LOCKWAIT; \
(void) sleep((caddr_t)(sp), PSHM); \
} \
(sp)->shm_perm.mode |= SHM_LOCKED; \
}
#define SHMUNLOCK(sp) { \
(sp)->shm_perm.mode &= ~SHM_LOCKED; \
if ((sp)->shm_perm.mode & SHM_LOCKWAIT) { \
(sp)->shm_perm.mode &= ~SHM_LOCKWAIT; \
curpri = PSHM; \
wakeup((caddr_t)(sp)); \
} \
}
/*
* Shared Memory information structure
*/
struct shminfo {
int shmmax, /* max shared memory segment size */
shmmin, /* min shared memory segment size */
shmmni, /* # of shared memory identifiers */
shmseg, /* (obsolete) */
shmall; /* (obsolete) */
};
struct shminfo shminfo; /* configuration parameters */
/*
* Configuration Parameters
* These parameters are tuned by editing the system configuration file.
* The following lines establish the default values.
*/
#ifndef SHMSIZE
#define SHMSIZE 1024 /* maximum shared memory segment size (in Kbytes) */
#endif
#ifndef SHMMNI
#define SHMMNI 100 /* # of shared memory identifiers */
#endif
/* The following parameters are assumed not to require tuning */
#define SHMMIN 1 /* min shared memory segment size */
#define SHMMAX (SHMSIZE * 1024) /* max shared memory segment size */
/*
* Structures allocated in machdep.c
*/
struct shmid_ds *shmem; /* shared memory id pool */
#endif KERNEL
#endif /*!_sys_shm_h*/
include/sys/signal.h
/* @(#)signal.h 2.39 89/08/14 SMI; from UCB 6.7 85/06/08 */
/*
* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* Copyright (c) 1987 by Sun Microsystems, Inc.
*/
#ifndef __sys_signal_h
#define __sys_signal_h
#include <vm/faultcode.h>
#define NSIG 32
/*
* If any signal defines (SIG*) are added, deleted, or changed, the same
* changes must be made in /usr/include/signal.h as well.
*/
#define SIGHUP 1 /* hangup */
#define SIGINT 2 /* interrupt */
#define SIGQUIT 3 /* quit */
#define SIGILL 4 /* illegal instruction (not reset when caught) */
#ifdef vax
#define ILL_RESAD_FAULT 0x0 /* reserved addressing fault */
#define ILL_PRIVIN_FAULT 0x1 /* privileged instruction fault */
#define ILL_RESOP_FAULT 0x2 /* reserved operand fault */
/* CHME, CHMS, CHMU are not yet given back to users reasonably */
#endif vax
#ifdef mc68000
#define ILL_ILLINSTR_FAULT 0x10 /* illegal instruction fault */
#define ILL_PRIVVIO_FAULT 0x20 /* privilege violation fault */
#define ILL_COPROCERR_FAULT 0x34 /* [coprocessor protocol error fault] */
#define ILL_TRAP1_FAULT 0x84 /* trap #1 fault */
#define ILL_TRAP2_FAULT 0x88 /* trap #2 fault */
#define ILL_TRAP3_FAULT 0x8c /* trap #3 fault */
#define ILL_TRAP4_FAULT 0x90 /* trap #4 fault */
#define ILL_TRAP5_FAULT 0x94 /* trap #5 fault */
#define ILL_TRAP6_FAULT 0x98 /* trap #6 fault */
#define ILL_TRAP7_FAULT 0x9c /* trap #7 fault */
#define ILL_TRAP8_FAULT 0xa0 /* trap #8 fault */
#define ILL_TRAP9_FAULT 0xa4 /* trap #9 fault */
#define ILL_TRAP10_FAULT 0xa8 /* trap #10 fault */
#define ILL_TRAP11_FAULT 0xac /* trap #11 fault */
#define ILL_TRAP12_FAULT 0xb0 /* trap #12 fault */
#define ILL_TRAP13_FAULT 0xb4 /* trap #13 fault */
#define ILL_TRAP14_FAULT 0xb8 /* trap #14 fault */
#endif mc68000
#ifdef sparc
#define ILL_STACK 0x00 /* bad stack */
#define ILL_ILLINSTR_FAULT 0x02 /* illegal instruction fault */
#define ILL_PRIVINSTR_FAULT 0x03 /* privileged instruction fault */
/* codes from 0x80 to 0xff are software traps */
#define ILL_TRAP_FAULT(n) ((n)+0x80) /* trap n fault */
#endif sparc
#define SIGTRAP 5 /* trace trap (not reset when caught) */
#define SIGIOT 6 /* IOT instruction */
#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
#define SIGEMT 7 /* EMT instruction */
#ifdef mc68000
#define EMT_EMU1010 0x28 /* line 1010 emulator trap */
#define EMT_EMU1111 0x2c /* line 1111 emulator trap */
#endif mc68000
#ifdef sparc
#define EMT_TAG 0x0a /* tag overflow */
#endif sparc
#define SIGFPE 8 /* floating point exception */
#ifdef vax
#define FPE_INTOVF_TRAP 0x1 /* integer overflow */
#define FPE_INTDIV_TRAP 0x2 /* integer divide by zero */
#define FPE_FLTOVF_TRAP 0x3 /* floating overflow */
#define FPE_FLTDIV_TRAP 0x4 /* floating/decimal divide by zero */
#define FPE_FLTUND_TRAP 0x5 /* floating underflow */
#define FPE_DECOVF_TRAP 0x6 /* decimal overflow */
#define FPE_SUBRNG_TRAP 0x7 /* subscript out of range */
#define FPE_FLTOVF_FAULT 0x8 /* floating overflow fault */
#define FPE_FLTDIV_FAULT 0x9 /* divide by zero floating fault */
#define FPE_FLTUND_FAULT 0xa /* floating underflow fault */
#endif vax
#ifdef mc68000
#define FPE_INTDIV_TRAP 0x14 /* integer divide by zero */
#define FPE_CHKINST_TRAP 0x18 /* CHK [CHK2] instruction */
#define FPE_TRAPV_TRAP 0x1c /* TRAPV [cpTRAPcc TRAPcc] instr */
#define FPE_FLTBSUN_TRAP 0xc0 /* [branch or set on unordered cond] */
#define FPE_FLTINEX_TRAP 0xc4 /* [floating inexact result] */
#define FPE_FLTDIV_TRAP 0xc8 /* [floating divide by zero] */
#define FPE_FLTUND_TRAP 0xcc /* [floating underflow] */
#define FPE_FLTOPERR_TRAP 0xd0 /* [floating operand error] */
#define FPE_FLTOVF_TRAP 0xd4 /* [floating overflow] */
#define FPE_FLTNAN_TRAP 0xd8 /* [floating Not-A-Number] */
#ifdef sun
#define FPE_FPA_ENABLE 0x400 /* [FPA not enabled] */
#define FPE_FPA_ERROR 0x404 /* [FPA arithmetic exception] */
#endif sun
#endif mc68000
#ifdef sparc
#define FPE_INTOVF_TRAP 0x1 /* integer overflow */
#define FPE_STARTSIG_TRAP 0x2 /* process using fp */
#define FPE_INTDIV_TRAP 0x14 /* integer divide by zero */
#define FPE_FLTINEX_TRAP 0xc4 /* [floating inexact result] */
#define FPE_FLTDIV_TRAP 0xc8 /* [floating divide by zero] */
#define FPE_FLTUND_TRAP 0xcc /* [floating underflow] */
#define FPE_FLTOPERR_TRAP 0xd0 /* [floating operand error] */
#define FPE_FLTOVF_TRAP 0xd4 /* [floating overflow] */
#endif sparc
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
/*
* The codes for SIGBUS and SIGSEGV are described in <vm/faultcode.h>
*/
#define SIGBUS 10 /* bus error */
#define BUS_HWERR FC_HWERR /* misc hardware error (e.g. timeout) */
#define BUS_ALIGN FC_ALIGN /* hardware alignment error */
#define BUS_OBJERR FC_OBJERR /* object returned errno value */
/*
* The BUS_CODE(code) will be one of the above. In the BUS_OBJERR case,
* doing a BUS_ERRNO(code) gives an errno value reported by the underlying
* file object mapped at the fault address. Note that this appears to be
* duplicated with the segmentation fault case below -- unfortunate, since
* the specification has always claimed that such errors produce SIGBUS.
* The segmentation cases are left defined as a transition aid.
*/
#define BUS_CODE(C) FC_CODE(C)
#define BUS_ERRNO(C) FC_ERRNO(C)
#define SIGSEGV 11 /* segmentation violation */
#define SEGV_NOMAP FC_NOMAP /* no mapping at the fault address */
#define SEGV_PROT FC_PROT /* access exceeded protections */
#define SEGV_OBJERR FC_OBJERR /* object returned errno value */
/*
* The SEGV_CODE(code) will be SEGV_NOMAP, SEGV_PROT, or SEGV_OBJERR.
* In the SEGV_OBJERR case, doing a SEGV_ERRNO(code) gives an errno value
* reported by the underlying file object mapped at the fault address.
*/
#define SEGV_CODE(C) FC_CODE(C)
#define SEGV_ERRNO(C) FC_ERRNO(C)
#define SIGSYS 12 /* bad argument to system call */
#define SIGPIPE 13 /* write on a pipe with no one to read it */
#define SIGALRM 14 /* alarm clock */
#define SIGTERM 15 /* software termination signal from kill */
#define SIGURG 16 /* urgent condition on IO channel */
#define SIGSTOP 17 /* sendable stop signal not from tty */
#define SIGTSTP 18 /* stop signal from tty */
#define SIGCONT 19 /* continue a stopped process */
#define SIGCHLD 20 /* to parent on child stop or exit */
#define SIGCLD 20 /* System V name for SIGCHLD */
#define SIGTTIN 21 /* to readers pgrp upon background tty read */
#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */
#define SIGIO 23 /* input/output possible signal */
#define SIGPOLL SIGIO /* System V name for SIGIO */
#define SIGXCPU 24 /* exceeded CPU time limit */
#define SIGXFSZ 25 /* exceeded file size limit */
#define SIGVTALRM 26 /* virtual time alarm */
#define SIGPROF 27 /* profiling time alarm */
#define SIGWINCH 28 /* window changed */
#define SIGLOST 29 /* resource lost (eg, record-lock lost) */
#define SIGUSR1 30 /* user defined signal 1 */
#define SIGUSR2 31 /* user defined signal 2 */
/*
* If addr cannot be computed it is set to SIG_NOADDR.
*/
#define SIG_NOADDR ((char *)~0)
#if !defined(KERNEL) && !defined(LOCORE)
void (*signal())();
/*
* Define BSD 4.1 reliable signals for SVID compatibility.
* These functions may go away in a future release.
*/
void (*sigset())();
int sighold();
int sigrelse();
int sigignore();
#endif !KERNEL && !LOCORE
#ifndef LOCORE
/*
* Signal vector "template" used in sigvec call.
*/
struct sigvec {
void (*sv_handler)(); /* signal handler */
int sv_mask; /* signal mask to apply */
int sv_flags; /* see signal options below */
};
#define SV_ONSTACK 0x0001 /* take signal on signal stack */
#define SV_INTERRUPT 0x0002 /* do not restart system on signal return */
#define SV_RESETHAND 0x0004 /* reset signal handler to SIG_DFL when signal taken */
/*
* If any SA_NOCLDSTOP or SV_NOCLDSTOP is change, the same
* changes must be made in /usr/include/signal.h as well.
*/
#define SV_NOCLDSTOP 0x0008 /* don't send a SIGCHLD on child stop */
#define SA_ONSTACK SV_ONSTACK
#define SA_INTERRUPT SV_INTERRUPT
#define SA_RESETHAND SV_RESETHAND
#define SA_NOCLDSTOP SV_NOCLDSTOP
#define sv_onstack sv_flags /* isn't compatibility wonderful! */
/*
* Structure used in sigstack call.
*/
struct sigstack {
char *ss_sp; /* signal stack pointer */
int ss_onstack; /* current status */
};
/*
* Information pushed on stack when a signal is delivered.
* This is used by the kernel to restore state following
* execution of the signal handler. It is also made available
* to the handler to allow it to properly restore state if
* a non-standard exit is performed.
*/
struct sigcontext {
int sc_onstack; /* sigstack state to restore */
int sc_mask; /* signal mask to restore */
#ifdef vax
int sc_sp; /* sp to restore */
int sc_fp; /* fp to restore */
int sc_ap; /* ap to restore */
int sc_pc; /* pc to restore */
int sc_ps; /* psl to restore */
#endif vax
#ifdef mc68000
int sc_sp; /* sp to restore */
int sc_pc; /* pc to retore */
int sc_ps; /* psl to restore */
#endif mc68000
#ifdef sparc
#define SPARC_MAXREGWINDOW 31 /* max usable windows in sparc */
int sc_sp; /* sp to restore */
int sc_pc; /* pc to retore */
int sc_npc; /* next pc to restore */
int sc_psr; /* psr to restore */
int sc_g1; /* register that must be restored */
int sc_o0;
int sc_wbcnt; /* number of outstanding windows */
char *sc_spbuf[SPARC_MAXREGWINDOW]; /* sp's for each wbuf */
int sc_wbuf[SPARC_MAXREGWINDOW][16]; /* window save buf */
#endif sparc
#ifdef sun386
int sc_sp; /* sp to restore */
int sc_pc; /* pc to retore */
int sc_ps; /* psl to restore */
int sc_eax; /* eax to restore */
int sc_edx; /* edx to restore */
#endif
};
#endif !LOCORE
#define BADSIG (void (*)())-1
/*
* If SIG_ERR, SIG_DFL, SIG_IGN, or SIG_HOLD are changed, the same changes
* must be made in /usr/include/signal.h as well.
*/
#define SIG_ERR (void (*)())-1
#define SIG_DFL (void (*)())0
#define SIG_IGN (void (*)())1
#ifdef KERNEL
#define SIG_CATCH (void (*)())2
#endif KERNEL
#define SIG_HOLD (void (*)())3
/*
* Macro for converting signal number to a mask suitable for sigblock().
*/
#define sigmask(m) (1 << ((m)-1))
/*
* signals that can't caught, blocked, or ignored
*/
#ifdef KERNEL
#define cantmask (sigmask(SIGKILL)|sigmask(SIGSTOP))
#endif
/*
* If SIG_BLOCK, SIG_UNBLOCK, or SIG_SETMASK are changed, the same changes
* must be made in /usr/include/signal.h as well.
*/
#define SIG_BLOCK 0x0001
#define SIG_UNBLOCK 0x0002
#define SIG_SETMASK 0x0004
#if !defined(LOCORE) && !defined(KERNEL)
/*
* If changes are made to sigset_t or struct sigaction, the same changes
* must be made in /usr/include/signal.h as well.
*/
#include <sys/stdtypes.h>
struct sigaction {
void (*sa_handler)();
sigset_t sa_mask;
int sa_flags;
};
/*
* If changes are made to the function prototypes, the same changes
* must be made in /usr/include/signal.h as well.
*/
void (*signal())();
int kill(/* pid_t p, int sig */);
int sigaction(/* int signo,
struct sigaction *act, struct sigaction *oldact */);
int sigaddset(/* sigset_t *mask, int signo */);
int sigdelset(/* sigset_t *mask, int signo */);
int sigemptyset(/* sigset_t *mask */);
int sigfillset(/* sigset_t *mask */);
int sigismember(/* sigset_t *mask, int signo */);
int sigpending(/* sigset_t *set */);
int sigprocmask(/* int how, sigset_t *set, *oldset */);
int sigsuspend(/* sigset_t *mask */);
#endif /* !LOCORE && !KERNEL */
#endif /* !__sys_signal_h */
include/sys/stat.h
/* @(#)stat.h 2.19 90/01/24 SMI; from UCB 4.7 83/05/21 */
/*
* NOTE: changes to this file should also be made to xpg2include/sys/stat.h
*/
#ifndef __sys_stat_h
#define __sys_stat_h
#include <sys/types.h>
struct stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
short st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
off_t st_size;
time_t st_atime;
int st_spare1;
time_t st_mtime;
int st_spare2;
time_t st_ctime;
int st_spare3;
long st_blksize;
long st_blocks;
long st_spare4[2];
};
#define _IFMT 0170000 /* type of file */
#define _IFDIR 0040000 /* directory */
#define _IFCHR 0020000 /* character special */
#define _IFBLK 0060000 /* block special */
#define _IFREG 0100000 /* regular */
#define _IFLNK 0120000 /* symbolic link */
#define _IFSOCK 0140000 /* socket */
#define _IFIFO 0010000 /* fifo */
#define S_ISUID 0004000 /* set user id on execution */
#define S_ISGID 0002000 /* set group id on execution */
#ifndef _POSIX_SOURCE
#define S_ISVTX 0001000 /* save swapped text even after use */
#define S_IREAD 0000400 /* read permission, owner */
#define S_IWRITE 0000200 /* write permission, owner */
#define S_IEXEC 0000100 /* execute/search permission, owner */
#define S_ENFMT 0002000 /* enforcement-mode locking */
#define S_IFMT _IFMT
#define S_IFDIR _IFDIR
#define S_IFCHR _IFCHR
#define S_IFBLK _IFBLK
#define S_IFREG _IFREG
#define S_IFLNK _IFLNK
#define S_IFSOCK _IFSOCK
#define S_IFIFO _IFIFO
#endif !_POSIX_SOURCE
#define S_IRWXU 0000700 /* rwx, owner */
#define S_IRUSR 0000400 /* read permission, owner */
#define S_IWUSR 0000200 /* write permission, owner */
#define S_IXUSR 0000100 /* execute/search permission, owner */
#define S_IRWXG 0000070 /* rwx, group */
#define S_IRGRP 0000040 /* read permission, group */
#define S_IWGRP 0000020 /* write permission, grougroup */
#define S_IXGRP 0000010 /* execute/search permission, group */
#define S_IRWXO 0000007 /* rwx, other */
#define S_IROTH 0000004 /* read permission, other */
#define S_IWOTH 0000002 /* write permission, other */
#define S_IXOTH 0000001 /* execute/search permission, other */
#define S_ISBLK(m) (((m)&_IFMT) == _IFBLK)
#define S_ISCHR(m) (((m)&_IFMT) == _IFCHR)
#define S_ISDIR(m) (((m)&_IFMT) == _IFDIR)
#define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO)
#define S_ISREG(m) (((m)&_IFMT) == _IFREG)
#ifndef _POSIX_SOURCE
#define S_ISLNK(m) (((m)&_IFMT) == _IFLNK)
#define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK)
#endif
#ifndef KERNEL
int chmod(/* char *path, mode_t mode */);
int fstat(/* int fd; struct stat *sbuf */);
int mkdir(/* char *path; mode_t mode */);
int mkfifo(/* char *path; mode_t mode */);
int stat(/* char *path; struct stat *sbuf */);
mode_t umask(/* mode_t mask */);
#endif
#endif /* !__sys_stat_h */
include/sys/termio.h
/* @(#)termio.h 1.5 88/08/19 SMI; from S5R2 6.2 */
#ifndef _sys_termio_h
#define _sys_termio_h
#include <sys/ioccom.h>
#include <sys/termios.h>
#define NCC 8
#define SSPEED 7 /* default speed: 300 baud */
/*
* Ioctl control packet
*/
struct termio {
unsigned short c_iflag; /* input modes */
unsigned short c_oflag; /* output modes */
unsigned short c_cflag; /* control modes */
unsigned short c_lflag; /* line discipline modes */
char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control chars */
};
#define TCGETA _IOR(T, 1, struct termio)
#define TCSETA _IOW(T, 2, struct termio)
#define TCSETAW _IOW(T, 3, struct termio)
#define TCSETAF _IOW(T, 4, struct termio)
#define TCSBRK _IO(T, 5)
#endif /*!_sys_termio_h*/
include/sys/termios.h
/* @(#)termios.h 1.18 89/10/04 SMI */
#ifndef __sys_termios_h
#define __sys_termios_h
#include <sys/stdtypes.h>
#include <sys/ioccom.h>
#include <sys/ttydev.h>
#include <sys/ttycom.h>
#define NCCS 17
/*
* control characters
* the following are not (yet) posix
* VEOL2, VSWTCH, VDSUSP, VREPRINT, VDISCARD, VWERASE, VLNEXT, VSTATUS
*/
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VEOL 5
#ifndef _POSIX_SOURCE
#define VEOL2 6
#define VSWTCH 7
#endif
#define VSTART 8
#define VSTOP 9
#define VSUSP 10
#ifndef _POSIX_SOURCE
#define VDSUSP 11
#define VREPRINT 12
#define VDISCARD 13
#define VWERASE 14
#define VLNEXT 15
#define VSTATUS 16
#endif
#define VMIN VEOF
#define VTIME VEOL
#ifndef _POSIX_SOURCE
#define _CTRL(c) ('c'&037)
/*
* default control chars.
* guarded for ttychars.h.
*/
#ifndef CINTR
#define CINTR _CTRL(c)
#define CQUIT 034 /* FS, ^\ */
#define CERASE 0177 /* DEL, ^? */
#define CKILL _CTRL(u)
#define CEOF _CTRL(d)
#define CEOT CEOF
#define CEOL 0
#define CEOL2 0
#define CSWTCH 0
#define CNSWTCH 0
#define CSTART _CTRL(q)
#define CSTOP _CTRL(s)
#define CSUSP _CTRL(z)
#define CDSUSP _CTRL(y)
#define CRPRNT _CTRL(r)
#define CFLUSH _CTRL(o)
#define CWERASE _CTRL(w)
#define CLNEXT _CTRL(v)
#endif /* !CINTR */
#define CESC '\\'
#define CNUL 0
#define CDEL 0377
#endif !_POSIX_SOURCE
/* input modes */
#define IGNBRK 0x00000001
#define BRKINT 0x00000002
#define IGNPAR 0x00000004
#define PARMRK 0x00000008
#define INPCK 0x00000010
#define ISTRIP 0x00000020
#define INLCR 0x00000040
#define IGNCR 0x00000080
#define ICRNL 0x00000100
/* IUCLC 0x00000200 not posix, defined below */
#define IXON 0x00000400
/* IXANY 0x00000800 not posix, defined below */
#define IXOFF 0x00001000
/* IMAXBEL 0x00002000 not posix, defined below */
#ifndef _POSIX_SOURCE
#define IUCLC 0x00000200
#define IXANY 0x00000800
#define IMAXBEL 0x00002000
#endif /* !_POSIX_SOURCE */
/* output modes */
#define OPOST 0x00000001
#ifndef _POSIX_SOURCE
#define OLCUC 0x00000002
#define ONLCR 0x00000004
#define OCRNL 0x00000008
#define ONOCR 0x00000010
#define ONLRET 0x00000020
#define OFILL 0x00000040
#define OFDEL 0x00000080
#define NLDLY 0x00000100
#define NL0 0
#define NL1 0x00000100
#define CRDLY 0x00000600
#define CR0 0
#define CR1 0x00000200
#define CR2 0x00000400
#define CR3 0x00000600
#define TABDLY 0x00001800
#define TAB0 0
#define TAB1 0x00000800
#define TAB2 0x00001000
#define XTABS 0x00001800
#define TAB3 XTABS
#define BSDLY 0x00002000
#define BS0 0
#define BS1 0x00002000
#define VTDLY 0x00004000
#define VT0 0
#define VT1 0x00004000
#define FFDLY 0x00008000
#define FF0 0
#define FF1 0x00008000
#define PAGEOUT 0x00010000
#define WRAP 0x00020000
#endif /* !_POSIX_SOURCE */
/* control modes */
#ifndef _POSIX_SOURCE
#define CBAUD 0x0000000f
#endif
#define CSIZE 0x00000030
#define CS5 0
#define CS6 0x00000010
#define CS7 0x00000020
#define CS8 0x00000030
#define CSTOPB 0x00000040
#define CREAD 0x00000080
#define PARENB 0x00000100
#define PARODD 0x00000200
#define HUPCL 0x00000400
#define CLOCAL 0x00000800
#ifndef _POSIX_SOURCE
#define LOBLK 0x00001000
#define CIBAUD 0x000f0000
#define CRTSCTS 0x80000000
#define IBSHIFT 16
#endif /* !_POSIX_SOURCE */
/* line discipline 0 modes */
#define ISIG 0x00000001
#define ICANON 0x00000002
/* XCASE 0x00000004 not posix, defined below */
#define ECHO 0x00000008
#define ECHOE 0x00000010
#define ECHOK 0x00000020
#define ECHONL 0x00000040
#define NOFLSH 0x00000080
#define TOSTOP 0x00000100
/* ECHOCTL 0x00000200 not posix, defined below */
/* ECHOPRT 0x00000400 not posix, defined below */
/* ECHOKE 0x00000800 not posix, defined below */
/* DEFECHO 0x00001000 not posix, defined below */
/* FLUSHO 0x00002000 not posix, defined below */
/* PENDIN 0x00004000 not posix, defined below */
#define IEXTEN 0x00008000
#ifndef _POSIX_SOURCE
#define XCASE 0x00000004
#define ECHOCTL 0x00000200
#define ECHOPRT 0x00000400
#define ECHOKE 0x00000800
#define DEFECHO 0x00001000
#define FLUSHO 0x00002000
#define PENDIN 0x00004000
#endif /* !_POSIX_SOURCE */
#ifndef _POSIX_SOURCE
/*
* codes 1 through 5, not shown here, are old "termio" calls
*/
#define TCXONC _IO(T, 6)
#define TCFLSH _IO(T, 7)
#define TCGETS _IOR(T, 8, struct termios)
#define TCSETS _IOW(T, 9, struct termios)
#define TCSETSW _IOW(T, 10, struct termios)
#define TCSETSF _IOW(T, 11, struct termios)
#endif /* !_POSIX_SOURCE */
#define TCOOFF 0 /* arg to TCXONC & tcflow() */
#define TCOON 1 /* arg to TCXONC & tcflow() */
#define TCIOFF 2 /* arg to TCXONC & tcflow() */
#define TCION 3 /* arg to TCXONC & tcflow() */
#define TCIFLUSH 0 /* arg to TCFLSH & tcflush() */
#define TCOFLUSH 1 /* arg to TCFLSH & tcflush() */
#define TCIOFLUSH 2 /* arg to TCFLSH & tcflush() */
#define TCSANOW 0 /* arg to tcsetattr() */
#define TCSADRAIN 1 /* arg to tcsetattr() */
#define TCSAFLUSH 2 /* arg to tcsetattr() */
/*
* Ioctl control packet
*/
struct termios {
tcflag_t c_iflag; /* input modes */
tcflag_t c_oflag; /* output modes */
tcflag_t c_cflag; /* control modes */
tcflag_t c_lflag; /* line discipline modes */
char c_line; /* line discipline XXX */
cc_t c_cc[NCCS]; /* control chars */
};
#ifndef KERNEL
speed_t cfgetispeed(/* struct termios *termios_p */);
speed_t cfgetospeed(/* struct termios *termios_p */);
int cfsetispeed(/* struct termios *termios_p, speed_t speed */);
int cfsetospeed(/* struct termios *termios_p, speed_t speed */);
int tcdrain(/* int fildes */);
int tcflow(/* int fildes, int action */);
int tcflush(/* int fildes, int queue_selector */);
int tcgetattr(/* int fildes, struct termios *termios_p */);
int tcsendbreak(/* int fildes, int duration */);
int tcsetattr(/* int fildes, int optional_actions, struct *termios_p */);
#endif /* !KERNEL */
#endif /* !__sys_termios_h */
include/sys/ttold.h
/* @(#)ttold.h 1.7 88/08/19 SMI; from S5R2 6.1 */
#ifndef _sys_ttold_h
#define _sys_ttold_h
struct tchars {
char t_intrc; /* interrupt */
char t_quitc; /* quit */
char t_startc; /* start output */
char t_stopc; /* stop output */
char t_eofc; /* end-of-file */
char t_brkc; /* input delimiter (like nl) */
};
struct ltchars {
char t_suspc; /* stop process signal */
char t_dsuspc; /* delayed stop process signal */
char t_rprntc; /* reprint line */
char t_flushc; /* flush output (toggles) */
char t_werasc; /* word erase */
char t_lnextc; /* literal next character */
};
/*
* Structure for TIOCGETP and TIOCSETP ioctls.
*/
#ifndef _SGTTYB_
#define _SGTTYB_
struct sgttyb {
char sg_ispeed; /* input speed */
char sg_ospeed; /* output speed */
char sg_erase; /* erase character */
char sg_kill; /* kill character */
short sg_flags; /* mode flags */
};
#endif
#include <sys/ioccom.h>
/*
* 4.3BSD tty ioctl commands that are either:
* 1) deprecated
* 2) not implemented (and never were implemented)
* 3) implemented on top of new-style "ioctl"s.
*/
#define TIOCGETD _IOR(t, 0, int) /* get line discipline */
#define TIOCSETD _IOW(t, 1, int) /* set line discipline */
#define TIOCHPCL _IO(t, 2) /* hang up on last close */
#define TIOCMODG _IOR(t, 3, int) /* get modem state - OBSOLETE */
#define TIOCMODS _IOW(t, 4, int) /* set modem state - OBSOLETE */
#define TIOCGETP _IOR(t, 8,struct sgttyb)/* get parameters -- gtty */
#define TIOCSETP _IOW(t, 9,struct sgttyb)/* set parameters -- stty */
#define TIOCSETN _IOW(t,10,struct sgttyb)/* as above, but no flushtty */
#define TIOCEXCL _IO(t, 13) /* set exclusive use of tty */
#define TIOCNXCL _IO(t, 14) /* reset exclusive use of tty */
#define TIOCFLUSH _IOW(t, 16, int) /* flush buffers */
#define TIOCSETC _IOW(t,17,struct tchars)/* set special characters */
#define TIOCGETC _IOR(t,18,struct tchars)/* get special characters */
#define O_TANDEM 0x00000001 /* send stopc on out q full */
#define O_CBREAK 0x00000002 /* half-cooked mode */
#define O_LCASE 0x00000004 /* simulate lower case */
#define O_ECHO 0x00000008 /* echo input */
#define O_CRMOD 0x00000010 /* map \r to \r\n on output */
#define O_RAW 0x00000020 /* no i/o processing */
#define O_ODDP 0x00000040 /* get/send odd parity */
#define O_EVENP 0x00000080 /* get/send even parity */
#define O_ANYP 0x000000c0 /* get any parity/send none */
#define O_NLDELAY 0x00000300 /* \n delay */
#define O_NL0 0x00000000
#define O_NL1 0x00000100 /* tty 37 */
#define O_NL2 0x00000200 /* vt05 */
#define O_NL3 0x00000300
#define O_TBDELAY 0x00000c00 /* horizontal tab delay */
#define O_TAB0 0x00000000
#define O_TAB1 0x00000400 /* tty 37 */
#define O_TAB2 0x00000800
#define O_XTABS 0x00000c00 /* expand tabs on output */
#define O_CRDELAY 0x00003000 /* \r delay */
#define O_CR0 0x00000000
#define O_CR1 0x00001000 /* tn 300 */
#define O_CR2 0x00002000 /* tty 37 */
#define O_CR3 0x00003000 /* concept 100 */
#define O_VTDELAY 0x00004000 /* vertical tab delay */
#define O_FF0 0x00000000
#define O_FF1 0x00004000 /* tty 37 */
#define O_BSDELAY 0x00008000 /* \b delay */
#define O_BS0 0x00000000
#define O_BS1 0x00008000
#define O_ALLDELAY (O_NLDELAY|O_TBDELAY|O_CRDELAY|O_VTDELAY|O_BSDELAY)
#define O_CRTBS 0x00010000 /* do backspacing for crt */
#define O_PRTERA 0x00020000 /* \ ... / erase */
#define O_CRTERA 0x00040000 /* " \b " to wipe out char */
#define O_TILDE 0x00080000 /* hazeltine tilde kludge */
#define O_MDMBUF 0x00100000 /* start/stop output on carrier intr */
#define O_LITOUT 0x00200000 /* literal output */
#define O_TOSTOP 0x00400000 /* SIGSTOP on background output */
#define O_FLUSHO 0x00800000 /* flush output to terminal */
#define O_NOHANG 0x01000000 /* no SIGHUP on carrier drop */
#define O_L001000 0x02000000
#define O_CRTKIL 0x04000000 /* kill line with " \b " */
#define O_PASS8 0x08000000
#define O_CTLECH 0x10000000 /* echo control chars as ^X */
#define O_PENDIN 0x20000000 /* tp->t_rawq needs reread */
#define O_DECCTQ 0x40000000 /* only ^Q starts after ^S */
#define O_NOFLSH 0x80000000 /* no output flush on signal */
/* locals, from 127 down */
#define TIOCLBIS _IOW(t, 127, int) /* bis local mode bits */
#define TIOCLBIC _IOW(t, 126, int) /* bic local mode bits */
#define TIOCLSET _IOW(t, 125, int) /* set entire local mode word */
#define TIOCLGET _IOR(t, 124, int) /* get local modes */
#define LCRTBS (O_CRTBS>>16)
#define LPRTERA (O_PRTERA>>16)
#define LCRTERA (O_CRTERA>>16)
#define LTILDE (O_TILDE>>16)
#define LMDMBUF (O_MDMBUF>>16)
#define LLITOUT (O_LITOUT>>16)
#define LTOSTOP (O_TOSTOP>>16)
#define LFLUSHO (O_FLUSHO>>16)
#define LNOHANG (O_NOHANG>>16)
#define LCRTKIL (O_CRTKIL>>16)
#define LPASS8 (O_PASS8>>16)
#define LCTLECH (O_CTLECH>>16)
#define LPENDIN (O_PENDIN>>16)
#define LDECCTQ (O_DECCTQ>>16)
#define LNOFLSH (O_NOFLSH>>16)
#define TIOCSBRK _IO(t, 123) /* set break bit */
#define TIOCCBRK _IO(t, 122) /* clear break bit */
#define TIOCSDTR _IO(t, 121) /* set data terminal ready */
#define TIOCCDTR _IO(t, 120) /* clear data terminal ready */
#define TIOCSLTC _IOW(t,117,struct ltchars)/* set local special chars */
#define TIOCGLTC _IOR(t,116,struct ltchars)/* get local special chars */
#define TIOCSTOP _IO(t, 111) /* stop output, like ^S */
#define TIOCSTART _IO(t, 110) /* start output, like ^Q */
/*
* Sun-specific ioctls, which have been moved to the Sun-specific range.
* The old codes will be kept around for binary compatibility; the
* codes for TIOCCONS and TIOCGSIZE don't collide with the 4.3BSD codes
* because the structure size and copy direction fields are different.
* Unfortunately, the old TIOCSSIZE code does collide with TIOCSWINSZ,
* but they can be disambiguated by checking whether a "struct ttysize"
* structure's "ts_lines" field is greater than 64K or not. If so,
* it's almost certainly a "struct winsize" instead.
*/
#define _O_TIOCCONS _IO(t, 104) /* get console I/O */
#define _O_TIOCSSIZE _IOW(t,103,struct ttysize)/* get tty size */
#define _O_TIOCGSIZE _IOR(t,102,struct ttysize)/* get tty size */
/*
* Sun-specific ioctls.
*/
#define TIOCSETX _IOW(t, 34, int) /* set extra modes for S5 compatibility */
#define TIOCGETX _IOR(t, 35, int) /* get extra modes for S5 compatibility */
#define NOPOST 0x00000001 /* no processing on output (LITOUT with 7 bits + parity) */
#define NOISIG 0x00000002 /* disable all signal-generating characters */
#define STOPB 0x00000004 /* two stop bits */
#define OTTYDISC 0 /* old, v7 std tty driver */
#define NETLDISC 1 /* line discip for berk net */
#define NTTYDISC 2 /* new tty discipline */
#define TABLDISC 3 /* hitachi tablet discipline */
#define NTABLDISC 4 /* gtco tablet discipline */
#define MOUSELDISC 5 /* mouse discipline */
#define KBDLDISC 6 /* up/down keyboard trans (console) */
#include <sys/ttycom.h>
#endif /*!_sys_ttold_h*/
include/sys/tty.h
/* @(#)tty.h 2.17 91/05/22 SMI */
/*
* Copyright (c) 1989 by Sun Microsystems, Inc.
*/
#ifndef _sys_tty_h
#define _sys_tty_h
#ifndef _sys_ttycom_h
#include <sys/ttycom.h>
#endif
typedef struct tty_common {
int t_flags;
queue_t *t_readq; /* stream's read queue */
queue_t *t_writeq; /* stream's write queue */
unsigned long t_iflag; /* copy of iflag from tty modes */
unsigned long t_cflag; /* copy of cflag from tty modes */
u_char t_stopc; /* copy of c_cc[VSTOP] from tty modes */
u_char t_startc; /* copy of c_cc[VSTART] from tty modes */
struct winsize t_size; /* screen/page size */
mblk_t *t_iocpending; /* ioctl reply pending successful allocation */
} tty_common_t;
#define TS_XCLUDE 0x00000001 /* tty is open for exclusive use */
#define TS_SOFTCAR 0x00000002 /* force carrier on */
extern void ttycommon_close(/*tty_common_t *tc*/);
extern void ttycommon_qfull(/*tty_common_t *tc, queue_t *q*/);
extern unsigned ttycommon_ioctl(/*tty_common_t *tc, queue_t *q, mblk_t *mp*/);
/*
* M_CTL message types.
*/
#define MC_NOCANON 0 /* module below saying it will canonicalize */
#define MC_DOCANON 1 /* module below saying it won't canonicalize */
#define MC_CANONQUERY 2 /* module above asking whether module below canonicalizes */
#define MC_SERVICEIMM 3 /* tell the ZS driver to return input immediately */
#define MC_SERVICEDEF 4 /* tell the ZS driver it can wait */
#endif /*!_sys_tty_h*/
include/sparc/a.out.h
/* @(#)a.out.h 1.7 89/09/06 SMI; from UCB 4.1 83/05/03 */
#ifndef _sparc_a_out_h
#define _sparc_a_out_h
#include <sys/exec.h>
/*
* memory management parameters
*/
#define PAGSIZ 0x02000
#define SEGSIZ PAGSIZ
#define OLD_PAGSIZ 0x00800 /* Page size under Release 2.0 */
#define OLD_SEGSIZ 0x08000 /* Segment size under Release 2.0 */
/*
* returns 1 if an object file type is invalid, i.e., if the other macros
* defined below will not yield the correct offsets. Note that a file may
* have N_BADMAG(x) = 0 and may be fully linked, but still may not be
* executable.
*/
#define N_BADMAG(x) \
((x).a_magic!=OMAGIC && (x).a_magic!=NMAGIC && (x).a_magic!=ZMAGIC)
/*
* relocation parameters. These are architecture-dependent
* and can be deduced from the machine type. They are used
* to calculate offsets of segments within the object file;
* See N_TXTOFF(x), etc. below.
*/
#define N_PAGSIZ(x) \
((x).a_machtype == M_OLDSUN2? OLD_PAGSIZ : PAGSIZ)
#define N_SEGSIZ(x) \
((x).a_machtype == M_OLDSUN2? OLD_SEGSIZ : SEGSIZ)
/*
* offsets of various sections of an object file.
*/
#define N_TXTOFF(x) \
/* text segment */ \
( (x).a_machtype == M_OLDSUN2 \
? ((x).a_magic==ZMAGIC ? N_PAGSIZ(x) : sizeof (struct exec)) \
: ((x).a_magic==ZMAGIC ? 0 : sizeof (struct exec)) )
#define N_DATOFF(x) /* data segment */ \
(N_TXTOFF(x) + (x).a_text)
#define N_TRELOFF(x) /* text reloc'n */ \
(N_DATOFF(x) + (x).a_data)
#define N_DRELOFF(x) /* data relocation*/ \
(N_TRELOFF(x) + (x).a_trsize)
#define N_SYMOFF(x) \
/* symbol table */ \
(N_TXTOFF(x)+(x).a_text+(x).a_data+(x).a_trsize+(x).a_drsize)
#define N_STROFF(x) \
/* string table */ \
(N_SYMOFF(x) + (x).a_syms)
/*
* Macros which take exec structures as arguments and tell where the
* various pieces will be loaded.
*/
#define _N_BASEADDR(x) \
(((x).a_magic == ZMAGIC) && ((x).a_entry < N_PAGSIZ(x)) ? \
0 : N_PAGSIZ(x))
#define N_TXTADDR(x) \
((x).a_machtype == M_OLDSUN2 ? N_SEGSIZ(x) : _N_BASEADDR(x))
#define N_DATADDR(x) \
(((x).a_magic==OMAGIC)? (N_TXTADDR(x)+(x).a_text) \
: (N_SEGSIZ(x)+((N_TXTADDR(x)+(x).a_text-1) & ~(N_SEGSIZ(x)-1))))
#define N_BSSADDR(x) (N_DATADDR(x)+(x).a_data)
/*
* Format of a relocation datum.
*/
/*
* Sparc relocation types
*/
enum reloc_type
{
RELOC_8, RELOC_16, RELOC_32, /* simplest relocs */
RELOC_DISP8, RELOC_DISP16, RELOC_DISP32, /* Disp's (pc-rel) */
RELOC_WDISP30, RELOC_WDISP22, /* SR word disp's */
RELOC_HI22, RELOC_22, /* SR 22-bit relocs */
RELOC_13, RELOC_LO10, /* SR 13&10-bit relocs*/
RELOC_SFA_BASE, RELOC_SFA_OFF13, /* SR S.F.A. relocs */
RELOC_BASE10, RELOC_BASE13, RELOC_BASE22, /* base_relative pic */
RELOC_PC10, RELOC_PC22, /* special pc-rel pic*/
RELOC_JMP_TBL, /* jmp_tbl_rel in pic */
RELOC_SEGOFF16, /* ShLib offset-in-seg*/
RELOC_GLOB_DAT, RELOC_JMP_SLOT, RELOC_RELATIVE, /* rtld relocs */
};
/*
* Format of a relocation datum.
*/
struct reloc_info_sparc /* used when header.a_machtype == M_SPARC */
{
unsigned long int r_address; /* relocation addr (offset in segment)*/
unsigned int r_index :24; /* segment index or symbol index */
unsigned int r_extern : 1; /* if F, r_index==SEG#; if T, SYM idx */
int : 2; /* <unused> */
enum reloc_type r_type : 5; /* type of relocation to perform */
long int r_addend; /* addend for relocation value */
};
/*
* Format of a symbol table entry
*/
struct nlist {
union {
char *n_name; /* for use when in-core */
long n_strx; /* index into file string table */
} n_un;
unsigned char n_type; /* type flag (N_TEXT,..) */
char n_other; /* unused */
short n_desc; /* see <stab.h> */
unsigned long n_value; /* value of symbol (or sdb offset) */
};
/*
* Simple values for n_type.
*/
#define N_UNDF 0x0 /* undefined */
#define N_ABS 0x2 /* absolute */
#define N_TEXT 0x4 /* text */
#define N_DATA 0x6 /* data */
#define N_BSS 0x8 /* bss */
#define N_COMM 0x12 /* common (internal to ld) */
#define N_FN 0x1e /* file name symbol */
#define N_EXT 01 /* external bit, or'ed in */
#define N_TYPE 0x1e /* mask for all the type bits */
/*
* Dbx entries have some of the N_STAB bits set.
* These are given in <stab.h>
*/
#define N_STAB 0xe0 /* if any of these bits set, a dbx symbol */
/*
* Format for namelist values.
*/
#define N_FORMAT "%08x"
/*
* secondary sections.
* this stuff follows the string table.
* not even its presence or absence is noted in the
* exec header (?). the secondary header gives
* the number of sections. following it is an
* array of "extra_nsects" int's which give the
* sizeof of the individual sections. the presence of
* even the header is optional.
*/
#define EXTRA_MAGIC 1040 /* taxing concept */
#define EXTRA_IDENT 0 /* ident's in 0th extra section */
struct extra_sections {
int extra_magic; /* should be EXTRA_MAGIC */
int extra_nsects; /* number of extra sections */
};
#endif /*!_sparc_a_out_h*/
include/sparc/asm_linkage.h
/* @(#)asm_linkage.h 1.11 91/05/22 SMI */
/*
* Copyright (c) 1987 by Sun Microsystems, Inc.
*/
/*
* A stack frame looks like:
*
* %fp->| |
* |-------------------------------|
* | Locals, temps, saved floats |
* |-------------------------------|
* | outgoing parameters past 6 |
* |-------------------------------|-\
* | 6 words for callee to dump | |
* | register arguments | |
* |-------------------------------| > minimum stack frame
* | One word struct-ret address | |
* |-------------------------------| |
* | 16 words to save IN and | |
* %sp->| LOCAL register on overflow | |
* |-------------------------------|-/
*/
#ifndef _sparc_asm_linkage_h
#define _sparc_asm_linkage_h
/*
* Constants defining a stack frame.
*/
#define WINDOWSIZE (16*4) /* size of window save area */
#define ARGPUSHSIZE (6*4) /* size of arg dump area */
#define ARGPUSH (WINDOWSIZE+4) /* arg dump area offset */
#define MINFRAME (WINDOWSIZE+ARGPUSHSIZE+4) /* min frame */
/*
* Stack alignment macros.
*/
#define STACK_ALIGN 8
#define SA(X) (((X)+(STACK_ALIGN-1)) & ~(STACK_ALIGN-1))
/*
* Profiling causes defintions of the MCOUNT and RTMCOUNT
* particular to the type. Note: the nop in the following
* macros allows them to be used in a delay slot.
*/
#ifdef GPROF
#define MCOUNT(x) \
nop; \
save %sp, -SA(MINFRAME), %sp; \
call mcount; \
nop ; \
restore ;
#define RTMCOUNT(x) \
nop; \
save %sp, -SA(MINFRAME), %sp; \
call mcount; \
nop ; \
restore ;
#endif GPROF
#ifdef PROF
#define MCOUNT(x) \
nop; \
save %sp, -SA(MINFRAME), %sp; \
sethi %hi(L_/**/x/**/1), %o0; \
call mcount; \
or %o0, %lo(L_/**/x/**/1), %o0; \
restore; \
.reserve L_/**/x/**/1, 4, "data", 4
#define RTMCOUNT(x) \
nop; \
save %sp, -SA(MINFRAME), %sp; \
sethi %hi(L/**/x/**/1), %o0; \
call mcount; \
or %o0, %lo(L/**/x/**/1), %o0; \
restore; \
.reserve L/**/x/**/1, 4, "data", 4
#endif PROF
/*
* if we are not profiling,
* MCOUNT and RTMCOUNT should be defined to nothing
*/
#if !defined(PROF) && !defined(GPROF)
#define MCOUNT(x)
#define RTMCOUNT(x)
#endif !PROF && !GPROF
/*
* Entry macros for assembler subroutines.
* NAME prefixes the underscore before a symbol.
* ENTRY provides a way to insert the calls to mcount for profiling.
* RTENTRY is similar to the above but provided for run-time routines
* whose names should not be prefixed with an underscore.
*/
#define NAME(x) _/**/x
#define ENTRY(x) \
.global NAME(x); \
NAME(x): MCOUNT(x)
#define ENTRY2(x,y) \
.global NAME(x), NAME(y); \
NAME(x): ; \
NAME(y): MCOUNT(x)
#define RTENTRY(x) \
.global x; x: RTMCOUNT(x)
/*
* For additional entry points.
*/
#define ALTENTRY(x) \
.global NAME(x); \
NAME(x):
#ifdef KERNEL
/*
* Macros for saving/restoring registers.
*/
#define SAVE_GLOBALS(RP) \
st %g1, [RP + G1*4]; \
std %g2, [RP + G2*4]; \
std %g4, [RP + G4*4]; \
std %g6, [RP + G6*4]; \
mov %y, %g1; \
st %g1, [RP + Y*4]
#define RESTORE_GLOBALS(RP) \
ld [RP + Y*4], %g1; \
mov %g1, %y; \
ld [RP + G1*4], %g1; \
ldd [RP + G2*4], %g2; \
ldd [RP + G4*4], %g4; \
ldd [RP + G6*4], %g6;
#define SAVE_OUTS(RP) \
std %i0, [RP + O0*4]; \
std %i2, [RP + O2*4]; \
std %i4, [RP + O4*4]; \
std %i6, [RP + O6*4]
#define RESTORE_OUTS(RP) \
ldd [RP + O0*4], %i0; \
ldd [RP + O2*4], %i2; \
ldd [RP + O4*4], %i4; \
ldd [RP + O6*4], %i6;
#define SAVE_WINDOW(SBP) \
std %l0, [SBP + (0*4)]; \
std %l2, [SBP + (2*4)]; \
std %l4, [SBP + (4*4)]; \
std %l6, [SBP + (6*4)]; \
std %i0, [SBP + (8*4)]; \
std %i2, [SBP + (10*4)]; \
std %i4, [SBP + (12*4)]; \
std %i6, [SBP + (14*4)]
#define RESTORE_WINDOW(SBP) \
ldd [SBP + (0*4)], %l0; \
ldd [SBP + (2*4)], %l2; \
ldd [SBP + (4*4)], %l4; \
ldd [SBP + (6*4)], %l6; \
ldd [SBP + (8*4)], %i0; \
ldd [SBP + (10*4)], %i2; \
ldd [SBP + (12*4)], %i4; \
ldd [SBP + (14*4)], %i6;
#define STORE_FPREGS(FCP) \
std %f0, [FCP + FPCTX_REGS]; \
std %f2, [FCP + FPCTX_REGS + 8]; \
std %f4, [FCP + FPCTX_REGS + 16]; \
std %f6, [FCP + FPCTX_REGS + 24]; \
std %f8, [FCP + FPCTX_REGS + 32]; \
std %f10, [FCP + FPCTX_REGS + 40]; \
std %f12, [FCP + FPCTX_REGS + 48]; \
std %f14, [FCP + FPCTX_REGS + 56]; \
std %f16, [FCP + FPCTX_REGS + 64]; \
std %f18, [FCP + FPCTX_REGS + 72]; \
std %f20, [FCP + FPCTX_REGS + 80]; \
std %f22, [FCP + FPCTX_REGS + 88]; \
std %f24, [FCP + FPCTX_REGS + 96]; \
std %f26, [FCP + FPCTX_REGS + 104]; \
std %f28, [FCP + FPCTX_REGS + 112]; \
std %f30, [FCP + FPCTX_REGS + 120]
#define LOAD_FPREGS(FCP) \
ldd [FCP + FPCTX_REGS ], %f0; \
ldd [FCP + FPCTX_REGS + 8], %f2; \
ldd [FCP + FPCTX_REGS + 16], %f4; \
ldd [FCP + FPCTX_REGS + 24], %f6; \
ldd [FCP + FPCTX_REGS + 32], %f8; \
ldd [FCP + FPCTX_REGS + 40], %f10; \
ldd [FCP + FPCTX_REGS + 48], %f12; \
ldd [FCP + FPCTX_REGS + 56], %f14; \
ldd [FCP + FPCTX_REGS + 64], %f16; \
ldd [FCP + FPCTX_REGS + 72], %f18; \
ldd [FCP + FPCTX_REGS + 80], %f20; \
ldd [FCP + FPCTX_REGS + 88], %f22; \
ldd [FCP + FPCTX_REGS + 96], %f24; \
ldd [FCP + FPCTX_REGS + 104], %f26; \
ldd [FCP + FPCTX_REGS + 112], %f28; \
ldd [FCP + FPCTX_REGS + 120], %f30; \
#endif KERNEL
#endif /*!_sparc_asm_linkage_h*/
include/sun3/a.out.h
/* @(#)a.out.h 1.6 89/08/21 SMI; from UCB 4.1 83/05/03 */
#ifndef _sun3_a_out_h
#define _sun3_a_out_h
#include <sys/exec.h>
/*
* memory management parameters
*/
#define PAGSIZ 0x02000
#define SEGSIZ 0x20000
#define OLD_PAGSIZ 0x00800 /* Page size under Release 2.0 */
#define OLD_SEGSIZ 0x08000 /* Segment size under Release 2.0 */
/*
* returns 1 if an object file type is invalid, i.e., if the other macros
* defined below will not yield the correct offsets. Note that a file may
* have N_BADMAG(x) = 0 and may be fully linked, but still may not be
* executable.
*/
#define N_BADMAG(x) \
((x).a_magic!=OMAGIC && (x).a_magic!=NMAGIC && (x).a_magic!=ZMAGIC)
/*
* relocation parameters. These are architecture-dependent
* and can be deduced from the machine type. They are used
* to calculate offsets of segments within the object file;
* See N_TXTOFF(x), etc. below.
*/
#define N_PAGSIZ(x) \
((x).a_machtype == M_OLDSUN2? OLD_PAGSIZ : PAGSIZ)
#define N_SEGSIZ(x) \
((x).a_machtype == M_OLDSUN2? OLD_SEGSIZ : SEGSIZ)
/*
* offsets of various sections of an object file.
*/
#define N_TXTOFF(x) \
/* text segment */ \
( (x).a_machtype == M_OLDSUN2 \
? ((x).a_magic==ZMAGIC ? N_PAGSIZ(x) : sizeof (struct exec)) \
: ((x).a_magic==ZMAGIC ? 0 : sizeof (struct exec)) )
#define N_DATOFF(x) /* data segment */ \
(N_TXTOFF(x) + (x).a_text)
#define N_TRELOFF(x) /* text reloc'n */ \
(N_DATOFF(x) + (x).a_data)
#define N_DRELOFF(x) /* data relocation*/ \
(N_TRELOFF(x) + (x).a_trsize)
#define N_SYMOFF(x) \
/* symbol table */ \
(N_TXTOFF(x)+(x).a_text+(x).a_data+(x).a_trsize+(x).a_drsize)
#define N_STROFF(x) \
/* string table */ \
(N_SYMOFF(x) + (x).a_syms)
/*
* Macros which take exec structures as arguments and tell where the
* various pieces will be loaded.
*/
#define _N_BASEADDR(x) \
(((x).a_magic == ZMAGIC) && ((x).a_entry < N_PAGSIZ(x)) ? \
0 : N_PAGSIZ(x))
#define N_TXTADDR(x) \
((x).a_machtype == M_OLDSUN2? N_SEGSIZ(x) : _N_BASEADDR(x))
#define N_DATADDR(x) \
(((x).a_magic==OMAGIC)? (N_TXTADDR(x)+(x).a_text) \
: (N_SEGSIZ(x)+((N_TXTADDR(x)+(x).a_text-1) & ~(N_SEGSIZ(x)-1))))
#define N_BSSADDR(x) (N_DATADDR(x)+(x).a_data)
/*
* Format of a relocation datum.
*/
/*
* Sparc relocation types
*/
enum reloc_type
{
RELOC_8, RELOC_16, RELOC_32, /* simplest relocs */
RELOC_DISP8, RELOC_DISP16, RELOC_DISP32, /* Disp's (pc-rel) */
RELOC_WDISP30, RELOC_WDISP22, /* SR word disp's */
RELOC_HI22, RELOC_22, /* SR 22-bit relocs */
RELOC_13, RELOC_LO10, /* SR 13&10-bit relocs*/
RELOC_SFA_BASE, RELOC_SFA_OFF13, /* SR S.F.A. relocs */
RELOC_BASE10, RELOC_BASE13, RELOC_BASE22, /* base_relative pic */
RELOC_PC10, RELOC_PC22, /* special pc-rel pic*/
RELOC_JMP_TBL, /* jmp_tbl_rel in pic */
RELOC_SEGOFF16, /* ShLib offset-in-seg*/
RELOC_GLOB_DAT, RELOC_JMP_SLOT, RELOC_RELATIVE, /* rtld relocs */
};
/*
* Format of a relocation datum.
*/
struct reloc_info_68k {
long r_address; /* address which is relocated */
unsigned int r_symbolnum:24, /* local symbol ordinal */
r_pcrel:1, /* was relocated pc relative already */
r_length:2, /* 0=byte, 1=word, 2=long */
r_extern:1, /* does not include value of sym referenced */
r_baserel:1, /* linkage table relative */
r_jmptable:1, /* pc-relative to jump table */
r_relative:1, /* relative relocation */
:1;
};
#define relocation_info reloc_info_68k /* for backward compatibility */
/*
* Format of a symbol table entry
*/
struct nlist {
union {
char *n_name; /* for use when in-core */
long n_strx; /* index into file string table */
} n_un;
unsigned char n_type; /* type flag (N_TEXT,..) */
char n_other; /* unused */
short n_desc; /* see <stab.h> */
unsigned long n_value; /* value of symbol (or sdb offset) */
};
/*
* Simple values for n_type.
*/
#define N_UNDF 0x0 /* undefined */
#define N_ABS 0x2 /* absolute */
#define N_TEXT 0x4 /* text */
#define N_DATA 0x6 /* data */
#define N_BSS 0x8 /* bss */
#define N_COMM 0x12 /* common (internal to ld) */
#define N_FN 0x1e /* file name symbol */
#define N_EXT 01 /* external bit, or'ed in */
#define N_TYPE 0x1e /* mask for all the type bits */
/*
* Dbx entries have some of the N_STAB bits set.
* These are given in <stab.h>
*/
#define N_STAB 0xe0 /* if any of these bits set, a dbx symbol */
/*
* Format for namelist values.
*/
#define N_FORMAT "%08x"
/*
* secondary sections.
* this stuff follows the string table.
* not even its presence or absence is noted in the
* exec header (?). the secondary header gives
* the number of sections. following it is an
* array of "extra_nsects" int's which give the
* sizeof of the individual sections. the presence of
* even the header is optional.
*/
#define EXTRA_MAGIC 1040 /* taxing concept */
#define EXTRA_IDENT 0 /* ident's in 0th extra section */
struct extra_sections {
int extra_magic; /* should be EXTRA_MAGIC */
int extra_nsects; /* number of extra sections */
};
#endif /*!_sun3_a_out_h*/
include/sun3/asm_linkage.h
/* @(#)asm_linkage.h 1.13 88/08/19 SMI */
/*
* Copyright (c) 1987 by Sun Microsystems, Inc.
*/
/*
* Entry macros for assembler subroutines.
*/
#ifndef _sun3_asm_linkage_h
#define _sun3_asm_linkage_h
#define IDENTITY(x) x
#define NAME(x) IDENTITY(_)x
#ifdef GPROF
#define ENTRY(x) \
.globl NAME(x); \
NAME(x): \
link a6,#0; \
movl #1f,a0; \
jbsr mcount; \
unlk a6; \
.bss; \
.even; \
1: .skip 4; \
.text
#define ENTRY2(x,y) \
.globl NAME(x), NAME(y); \
NAME(x): ; \
NAME(y): \
link a6,#0; \
movl #1f,a0; \
jbsr mcount; \
unlk a6; \
.bss; \
.even; \
1: .skip 4; \
.text
/*
* CCENTRY is for cc known subroutines like ldivt which
* know and use a0, a1, d0 and d1. This means we have to
* save them.
*/
#define CCENTRY(x) \
.globl x; \
x: \
link a6,#-16; \
moveml #0x0303,sp@; \
movl #1f,a0; \
jbsr mcount; \
moveml sp@,#0x0303; \
unlk a6; \
.bss; \
.even; \
1: .skip 4; \
.text
#else GPROF
#define ENTRY(x) \
.globl NAME(x); \
NAME(x):
#define ENTRY2(x,y) \
.globl NAME(x), NAME(y); \
NAME(x): \
NAME(y):
#define CCENTRY(x) \
.globl x; \
x:
#endif GPROF
/*
* For additional entry points.
*/
#define ALTENTRY(x) \
.globl NAME(x); \
NAME(x):
/*
* Macro for autovectored interrupts.
* Assembler can't do arith on 2 relocatables in diff module
* (both in autoconf.c) so we can't do:
* addl #_levelLEVEL_names - _levelLEVEL_vector - 4, a2
*/
#define IOINTR(LEVEL) \
moveml #0xE0E0,sp@- /* save regs we trash <d0,d1,d2,a0,a1,a2> */;\
movl sp,d2 /* save copy of previous sp */;\
cmpl #eintstack,sp /* on interrupt stack? */;\
jls 1f /* yes, skip */;\
lea eintstack,sp /* no, switch to interrupt stack */;\
1: movl #_level/**/LEVEL/**/_vector,a2 /* get vector ptr */;\
2: movl a2@+,a1 /* get routine address */;\
jsr a1@ /* go there */;\
tstl d0 /* success? */;\
beqs 2b /* no, try next one */;\
/* get location of per-device interrupt counter */\
subl #_level/**/LEVEL/**/_vector + 4, a2 ;\
addl #_level/**/LEVEL/**/_intcnt, a2 ;\
addql #1, a2@ /* count the per-device interrupt */;\
movl d2,sp /* restore stack pointer */;\
cmpl #0x80000000,d0 /* spurious? */;\
jeq rei_iop /* yes */;\
clrl _level/**/LEVEL/**/_spurious /* no, clr spurious cnt */;\
jra rei_iop
/*
* Macro for vectored interrupts.
*/
#define VECINTR(ifunc, cfunc, carg, pos) \
.globl ifunc;\
ifunc:;\
moveml #0xE0C0,sp@- /* save regs we trash <d0,d1,d2,a0,a1> */;\
movl sp,d2 /* save copy of previous sp */;\
cmpl #eintstack,sp /* on interrupt stack? */;\
jls 1f /* yes, skip */;\
lea eintstack,sp /* no, switch to interrupt stack */;\
1: movl #(pos * 4) + _intrcnt, a1 /* position in count table */;\
addql #1, a1@ /* count interrupt */;\
movl carg,sp@- /* push arg to interrupt routine */;\
jsr cfunc /* go to it */;\
movl d2,sp /* restore stack pointer */;\
moveml sp@+,#0x0307 /* restore saved registers <a1,a0,d2,d1,d0> */;\
jra rei_io
#endif /*!_sun3_asm_linkage_h*/
include/a.out.h
/* @(#)a.out.h 1.25 89/02/22 SMI; from UCB 4.1 83/05/03 */
#ifndef _a_out_h
#define _a_out_h
#if !defined(_CROSS_TARGET_ARCH)
/* The usual, native case. Usage:
* #include <a.out.h>
*/
#include <machine/a.out.h>
#else /*defined(_CROSS_TARGET_ARCH)*/
/* Used when building a cross-tool, with the target system architecture
* determined by the _CROSS_TARGET_ARCH preprocessor variable at compile
* time. Usage:
* #include <a.out.h>
* ...plus compilation with command (e.g. for Sun-4 target architecture):
* cc -DSUN2=2 -DSUN3=3 -DSUN3X=31 -DSUN4=4 \
* -D_CROSS_TARGET_ARCH=SUN4 ...
* Note: this may go away in a future release.
*/
# if _CROSS_TARGET_ARCH == SUN2
# include "sun2/a.out.h"
# elif _CROSS_TARGET_ARCH == SUN3
# include "sun3/a.out.h"
# elif _CROSS_TARGET_ARCH == SUN3X
# include "sun3x/a.out.h"
# elif _CROSS_TARGET_ARCH == SUN4
# include "sun4/a.out.h"
# elif _CROSS_TARGET_ARCH == VAX
# include "vax/a.out.h"
# endif
#endif /*defined(_CROSS_TARGET_ARCH)*/
/*
* Usage when building a cross-tool with a fixed target system architecture
* (Sun-4 in this example), bypassing this file:
* #include <sun4/a.out.h>
*/
#endif /*!_a_out_h*/
include/errno.h
/* @(#)errno.h 1.4 88/08/19 SMI; from S5R2 1.2 */
/*
* Error codes
*/
#ifndef _errno_h
#define _errno_h
#include <sys/errno.h>
extern int errno;
#endif /*!_errno_h*/
include/signal.h
/* @(#)signal.h 1.4 89/06/25 SMI; from sys/signal.h 2.34 */
/*
* Copyright (c) 1982 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* Copyright (c) 1987 by Sun Microsystems, Inc.
*/
#ifndef __signal_h
#define __signal_h
#ifndef _POSIX_SOURCE
#include <sys/signal.h>
#else
/*
* All of the below is drawn from sys/signal.h. Adding anything here means you
* add it in sys/signal.h as well.
*/
#define SIGHUP 1 /* hangup */
#define SIGINT 2 /* interrupt */
#define SIGQUIT 3 /* quit */
#define SIGILL 4 /* illegal instruction (not reset when caught) */
#define SIGTRAP 5 /* trace trap (not reset when caught) */
#define SIGIOT 6 /* IOT instruction */
#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
#define SIGEMT 7 /* EMT instruction */
#define SIGFPE 8 /* floating point exception */
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
#define SIGBUS 10 /* bus error */
#define SIGSEGV 11 /* segmentation violation */
#define SIGSYS 12 /* bad argument to system call */
#define SIGPIPE 13 /* write on a pipe with no one to read it */
#define SIGALRM 14 /* alarm clock */
#define SIGTERM 15 /* software termination signal from kill */
#define SIGURG 16 /* urgent condition on IO channel */
#define SIGSTOP 17 /* sendable stop signal not from tty */
#define SIGTSTP 18 /* stop signal from tty */
#define SIGCONT 19 /* continue a stopped process */
#define SIGCHLD 20 /* to parent on child stop or exit */
#define SIGCLD 20 /* System V name for SIGCHLD */
#define SIGTTIN 21 /* to readers pgrp upon background tty read */
#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */
#define SIGIO 23 /* input/output possible signal */
#define SIGPOLL SIGIO /* System V name for SIGIO */
#define SIGXCPU 24 /* exceeded CPU time limit */
#define SIGXFSZ 25 /* exceeded file size limit */
#define SIGVTALRM 26 /* virtual time alarm */
#define SIGPROF 27 /* profiling time alarm */
#define SIGWINCH 28 /* window changed */
#define SIGLOST 29 /* resource lost (eg, record-lock lost) */
#define SIGUSR1 30 /* user defined signal 1 */
#define SIGUSR2 31 /* user defined signal 2 */
/* signal() args & returns */
#define SIG_ERR (void (*)())-1
#define SIG_DFL (void (*)())0
#define SIG_IGN (void (*)())1
#define SIG_HOLD (void (*)())3
/* sigprocmask flags */
#define SIG_BLOCK 0x0001
#define SIG_UNBLOCK 0x0002
#define SIG_SETMASK 0x0004
/* sa_flags flag; also supports all the sigvec flags in sys/signal.h */
#define SA_NOCLDSTOP 0x0008 /* don't send a SIGCHLD on child stop */
#include <sys/stdtypes.h> /* for sigset_t */
struct sigaction {
void (*sa_handler)();
sigset_t sa_mask;
int sa_flags;
};
void (*signal())();
int kill(/* pid_t p, int sig */);
int sigaction(/* int signo,
struct sigaction *act, struct sigaction *oldact */);
int sigaddset(/* sigset_t *mask, int signo */);
int sigdelset(/* sigset_t *mask, int signo */);
int sigemptyset(/* sigset_t *mask */);
int sigfillset(/* sigset_t *mask */);
int sigismember(/* sigset_t *mask, int signo */);
int sigpending(/* sigset_t *set */);
int sigprocmask(/* int how, sigset_t *set, *oldset */);
int sigsuspend(/* sigset_t *mask */);
#endif /* _POSIX_SOURCE */
#endif /* !__signal_h */
include/ustat.h
/* @(#)ustat.h 1.4 88/08/19 SMI; from S5R2 1.1 */
#ifndef _ustat_h
#define _ustat_h
struct ustat {
daddr_t f_tfree; /* total free */
ino_t f_tinode; /* total inodes free */
char f_fname[6]; /* filsys name */
char f_fpack[6]; /* filsys pack name */
};
#endif /*!_ustat_h*/
include/ctype.h
/* @(#)ctype.h 1.9 89/10/06 SMI; from UCB 4.1 83/05/03 */
#define _U 01
#define _L 02
#define _N 04
#define _S 010
#define _P 020
#define _C 040
#define _X 0100
#define _B 0200
extern char _ctype_[];
#define isalpha(c) ((_ctype_+1)[c]&(_U|_L))
#define isupper(c) ((_ctype_+1)[c]&_U)
#define islower(c) ((_ctype_+1)[c]&_L)
#define isdigit(c) ((_ctype_+1)[c]&_N)
#define isxdigit(c) ((_ctype_+1)[c]&_X)
#define isspace(c) ((_ctype_+1)[c]&_S)
#define ispunct(c) ((_ctype_+1)[c]&_P)
#define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N))
#define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
#define isgraph(c) ((_ctype_+1)[c]&(_P|_U|_L|_N))
#define iscntrl(c) ((_ctype_+1)[c]&_C)
#define isascii(c) ((unsigned)(c)<=0177)
#define toascii(c) ((c)&0177)
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="description" content="Solaris1" />
<meta name="keywords" content=" " />
<meta name="generator" content="indexify V.20031121 ( Loren Heal )" />
<link rel="stylesheet" type="text/css" href="http://healconsulting.com/plain.css" />
<title>Solaris1</title>
</head>
<body>
<div id="header">
<a href="http://healconsulting.com"> <img src="http://healconsulting.com/images/healcons.png" alt="[Heal Consulting]"
style="border:none" /> </a>
<h1> <a href="http://healconsulting.com"> Heal Consulting </a> </h1>
<h2> <a href="http://healconsulting.com"> Loren Heal Home </a> </h2>
<h3>Solaris1</h3>
</div>
<div id="content">
<pre>
ln -s ctype.h 5include/ctype.h.txt
ln -s acct.h include/sys/acct.h.txt
ln -s errno.h include/sys/errno.h.txt
ln -s exec.h include/sys/exec.h.txt
ln -s filio.h include/sys/filio.h.txt
ln -s ioccom.h include/sys/ioccom.h.txt
ln -s ioctl.h include/sys/ioctl.h.txt
ln -s ipc.h include/sys/ipc.h.txt
ln -s shm.h include/sys/shm.h.txt
ln -s signal.h include/sys/signal.h.txt
ln -s stat.h include/sys/stat.h.txt
ln -s termio.h include/sys/termio.h.txt
ln -s termios.h include/sys/termios.h.txt
ln -s ttold.h include/sys/ttold.h.txt
ln -s tty.h include/sys/tty.h.txt
ln -s a.out.h include/sparc/a.out.h.txt
ln -s asm_linkage.h include/sparc/asm_linkage.h.txt
ln -s a.out.h include/sun3/a.out.h.txt
ln -s asm_linkage.h include/sun3/asm_linkage.h.txt
ln -s a.out.h include/a.out.h.txt
ln -s errno.h include/errno.h.txt
ln -s signal.h include/signal.h.txt
ln -s ustat.h include/ustat.h.txt
ln -s ctype.h include/ctype.h.txt
</pre>
</div>
<div id="footer">
<!-- indexify V.20031121 footer -->
<a href="http://validator.w3.org/check/referer"><img src="http://healconsulting.com/images/valid-xhtml11.png" alt="Valid XHTML 1.1!" style="border:none" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://healconsulting.com/images/vcss.png" alt="Valid CSS!" style="border:none" /> </a>
Created 20040219 Loren Heal <script type="text/javascript"><!--
modi = new Date(document.lastModified);
mz=((modi.getMonth()+1)<=9?"0":"");
dz=(modi.getDate()<=9?"0":"");
document.writeln("Updated: " +
(1900 + modi.getYear())
+ mz + (1+modi.getMonth())
+ dz + modi.getDate());
//--></script>
</div>
</body>
</html>