diff options
Diffstat (limited to 'mit-pthreads/machdep/hpux-9.03')
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/__math.h | 3 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/__signal.h | 28 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/__stdio.h | 8 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/__stdlib.h | 24 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/__string.h | 20 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/__time.h | 31 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/__unistd.h | 66 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/cdefs.h | 61 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/compat.h | 45 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/dirent.h | 61 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/socket.h | 171 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/stdtypes.h | 74 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/time.h | 228 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/timers.h | 68 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/uio.h | 25 | ||||
-rwxr-xr-x | mit-pthreads/machdep/hpux-9.03/wait.h | 92 |
16 files changed, 1005 insertions, 0 deletions
diff --git a/mit-pthreads/machdep/hpux-9.03/__math.h b/mit-pthreads/machdep/hpux-9.03/__math.h new file mode 100755 index 00000000000..8066bd60713 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/__math.h @@ -0,0 +1,3 @@ +#define HUGE_VAL 1.7976931348623157e+308 + + diff --git a/mit-pthreads/machdep/hpux-9.03/__signal.h b/mit-pthreads/machdep/hpux-9.03/__signal.h new file mode 100755 index 00000000000..fbb1d6ce2b1 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/__signal.h @@ -0,0 +1,28 @@ +#include <sys/signal.h> + +#ifndef SIGCLD +#define SIGCLD SIGCHLD +#endif + +/* #define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1))) */ +#define sigword(n) (((unsigned int)((n) - 1))>>5) + +#define __SIGEMPTYSET { 0, 0, 0, 0, 0, 0, 0, 0 } +#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff,\ + 0xffffffff,0xffffffff,0xffffffff,0xffffffff} +#define __SIGADDSET(s, n) ((s)->sigset[sigword(n)] |= sigmask(n)) +#define __SIGDELSET(s, n) ((s)->sigset[sigword(n)] &= ~sigmask(n)) +#define __SIGISMEMBER(s, n) ((s)->sigset[sigword(n)] & sigmask(n)) + +#define SIGSET_SIZE sizeof(sigset_t)/sizeof(long) + +#define SIG_ANY(sig) sig_any(&sig) + +static inline int sig_any(sigset_t *sig) { + int i; + for (i=0; i < SIGSET_SIZE; i++) + if (sig->sigset[i] != 0) + return 1; + return 0; +} + diff --git a/mit-pthreads/machdep/hpux-9.03/__stdio.h b/mit-pthreads/machdep/hpux-9.03/__stdio.h new file mode 100755 index 00000000000..091b065a2e9 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/__stdio.h @@ -0,0 +1,8 @@ + +#ifndef _SIZE_T +#define _SIZE_T +typedef pthread_size_t size_t; +#endif + +typedef pthread_fpos_t fpos_t; + diff --git a/mit-pthreads/machdep/hpux-9.03/__stdlib.h b/mit-pthreads/machdep/hpux-9.03/__stdlib.h new file mode 100755 index 00000000000..37a14a960d5 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/__stdlib.h @@ -0,0 +1,24 @@ +/* $Id$ */ + +#ifndef __sys_stdtypes_h + +#ifndef _SYS___STDLIB_H_ +#define _SYS___STDLIB_H_ + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned int size_t; +#endif + +#ifndef _WCHAR_T +#define _WCHAR_T +typedef unsigned int wchar_t; +#endif + +#ifndef NULL +#define NULL 0 +#endif + +#endif + +#endif diff --git a/mit-pthreads/machdep/hpux-9.03/__string.h b/mit-pthreads/machdep/hpux-9.03/__string.h new file mode 100755 index 00000000000..1badf6d660c --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/__string.h @@ -0,0 +1,20 @@ + +#ifndef _SYS_STDSYMS_INCLUDED +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef pthread_size_t size_t; +#endif + +/* Non-standard SunOS 4.x string routines. */ +#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +__BEGIN_DECLS +int bcmp __P_((const void *, const void *, size_t)); +void bcopy __P_((const void *, void *, size_t)); +void bzero __P_((void *, size_t)); +char *index __P_((const char *, int)); +char *rindex __P_((const char *, int)); +char *strdup __P_((const char *)); +__END_DECLS +#endif diff --git a/mit-pthreads/machdep/hpux-9.03/__time.h b/mit-pthreads/machdep/hpux-9.03/__time.h new file mode 100755 index 00000000000..ae958dcc3cf --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/__time.h @@ -0,0 +1,31 @@ +/* $Id$ */ + +#ifndef __sys_stdtypes_h + +#ifndef _SYS__TIME_H_ +#define _SYS__TIME_H_ + +#ifndef _CLOCK_T +#define _CLOCK_T +typedef long clock_t; +#endif + +#ifndef _TIME_T +#define _TIME_T +typedef long time_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned int size_t; +#endif + +#define CLOCKS_PER_SEC 1000000 + +#if !defined(_ANSI_SOURCE) && !defined(CLK_TCK) +#define CLK_TCK 60 +#endif /* not ANSI */ + +#endif + +#endif /* !_SYS__TIME_H_ */ diff --git a/mit-pthreads/machdep/hpux-9.03/__unistd.h b/mit-pthreads/machdep/hpux-9.03/__unistd.h new file mode 100755 index 00000000000..0e8515b1f96 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/__unistd.h @@ -0,0 +1,66 @@ +/* /afs/sipb.mit.edu/project/pthreads/src/CVS/pthreads/machdep/hpux-9.03/__unist +d.h,v 1.2 1995/03/10 03:59:53 snl Exp */ + +#ifndef _SYS___UNISTD_H_ +#define _SYS___UNISTD_H_ + +#include <sys/stdsyms.h> +#include <sys/types.h> +#include <utime.h> + +#ifndef NULL +#define NULL 0 +#endif + +#ifndef _GID_T +#define _GID_T +typedef long gid_t; +#endif + +#ifndef _UID_T +#define _UID_T +typedef long uid_t; +#endif + +#ifndef _PID_T +#define _PID_T +typedef long pid_t; +#endif + +#ifndef _OFF_T +#define _OFF_T +typedef long off_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef unsigned int size_t; +#endif + +#ifndef _SSIZE_T +#define _SSIZE_T +typedef int ssize_t; +#endif + +/* Symbolic constants for sysconf() variables defined by POSIX.1-1988: 0-7 */ + +#define _SC_ARG_MAX 0 /* ARG_MAX: Max length of argument to exec() + including environment data */ +#define _SC_CHILD_MAX 1 /* CHILD_MAX: Max of processes per userid */ +#define _SC_CLK_TCK 2 /* Number of clock ticks per second */ +#define _SC_NGROUPS_MAX 3 /* NGROUPS_MAX: Max of simultaneous + supplementary group IDs per process */ +#define _SC_OPEN_MAX 4 /* OPEN_MAX: Max of files that one process + can have open at any one time */ +#define _SC_JOB_CONTROL 5 /* _POSIX_JOB_CONTROL: 1 iff supported */ +#define _SC_SAVED_IDS 6 /* _POSIX_SAVED_IDS: 1 iff supported */ +#define _SC_1_VERSION_88 7 /* _POSIX_VERSION: Date of POSIX.1-1988 */ + +/* Symbolic constants for sysconf() variables added by POSIX.1-1990: 100-199 */ + +#define _SC_STREAM_MAX 100 /* STREAM_MAX: Max of open stdio FILEs */ +#define _SC_TZNAME_MAX 101 /* TZNAME_MAX: Max length of timezone name */ +#define _SC_1_VERSION_90 102 /* _POSIX_VERSION: Date of POSIX.1-1990 */ + +#endif /* _SYS___UNISTD_H_ */ + diff --git a/mit-pthreads/machdep/hpux-9.03/cdefs.h b/mit-pthreads/machdep/hpux-9.03/cdefs.h new file mode 100755 index 00000000000..041300cbe02 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/cdefs.h @@ -0,0 +1,61 @@ +/* ==== cdefs.h ============================================================ + * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu + * + * Description : Similar to the BSD cdefs.h file. + * + * 1.00 94/01/26 proven + * -Started coding this file. + */ + +#ifndef _PTHREAD_SYS_CDEFS_H_ +#define _PTHREAD_SYS_CDEFS_H_ + +/* Stuff for compiling */ +#if defined(__GNUC__) +#if defined(__cplusplus) +#define __INLINE static inline +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS }; +#else +#define __INLINE extern inline +#define __CAN_DO_EXTERN_INLINE +#define __BEGIN_DECLS +#define __END_DECLS +#if !defined(__STDC__) +#define const __const +#define inline __inline +#define signed __signed +#define volatile __volatile +#endif +#endif +#else /* !__GNUC__ */ +#define __INLINE static +#define __BEGIN_DECLS +#define __END_DECLS +#endif + +#ifndef __NORETURN +#define __NORETURN +#endif /* __NORETURN not defined. */ + +#ifndef _U_INT32_T_ +#define _U_INT32_T_ +typedef unsigned int u_int32_t; +#endif + +#ifndef _U_INT16_T_ +#define _U_INT16_T_ +typedef unsigned short u_int16_t; +#endif + +#ifndef _INT32_T_ +#define _INT32_T_ +typedef int int32_t; +#endif + +#ifndef _INT16_T_ +#define _INT16_T_ +typedef short int16_t; +#endif + +#endif diff --git a/mit-pthreads/machdep/hpux-9.03/compat.h b/mit-pthreads/machdep/hpux-9.03/compat.h new file mode 100755 index 00000000000..5a59434417c --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/compat.h @@ -0,0 +1,45 @@ +/* ==== compat.h ============================================================ + * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Chris Provenzano. + * 4. The name of Chris Provenzano may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + * + * Description : Compatibility header for networking code. + * + * 1.00 94/06/13 proven + * -Started coding this file. + */ + +#ifndef _SYS_COMPAT_H_ +#define _SYS_COMPAT_H_ + +#define omsghdr msghdr + +#endif diff --git a/mit-pthreads/machdep/hpux-9.03/dirent.h b/mit-pthreads/machdep/hpux-9.03/dirent.h new file mode 100755 index 00000000000..5f17af345db --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/dirent.h @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dirent.h 5.18 (Berkeley) 2/23/91 + */ + +#ifndef _SYS_DIRENT_H_ +#define _SYS_DIRENT_H_ + +/* + * A directory entry has a struct dirent at the front of it, containing its + * inode number, the length of the entry, and the length of the name + * contained in the entry. These are followed by the name padded to a 4 + * byte boundary with null bytes. All names are guaranteed null terminated. + * The maximum length of a name in a directory is MAXNAMLEN. + */ + +struct dirent { + u_long d_fileno; /* file number of entry */ + u_short d_reclen; /* length of this record */ + u_short d_namlen; /* length of string in d_name */ +#ifdef _POSIX_SOURCE + char d_name[255 + 1]; /* name must be no longer than this */ +#else +#define MAXNAMLEN 255 + char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */ +#endif +}; + +#define d_ino d_fileno + +#endif /* !_SYS_DIRENT_H_ */ diff --git a/mit-pthreads/machdep/hpux-9.03/socket.h b/mit-pthreads/machdep/hpux-9.03/socket.h new file mode 100755 index 00000000000..c7a37706940 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/socket.h @@ -0,0 +1,171 @@ +/* + * Copyright (c) 1982, 1985, 1986 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)socket.h 7.3 (Berkeley) 6/27/88 + */ + +/* + * Definitions related to sockets: types, address families, options. + */ + +#include <sys/stdsyms.h> +#include <pthread/posix.h> +#include <sys/cdefs.h> + +/* + * Types of sockets + */ +#define SOCK_STREAM 1 /* stream socket */ +#define SOCK_DGRAM 2 /* datagram socket */ +#define SOCK_RAW 3 /* raw-protocol interface */ +#define SOCK_RDM 4 /* reliably-delivered message */ +#define SOCK_SEQPACKET 5 /* sequenced packet stream */ + +/* + * Option flags per-socket. + */ +#define SO_DEBUG 0x0001 /* turn on debugging info recording */ +#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ +#define SO_REUSEADDR 0x0004 /* allow local address reuse */ +#define SO_KEEPALIVE 0x0008 /* keep connections alive */ +#define SO_DONTROUTE 0x0010 /* just use interface addresses */ +#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ +#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ +#define SO_LINGER 0x0080 /* linger on close if data present */ +#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ + +/* + * Additional options, not kept in so_options. + */ +#define SO_SNDBUF 0x1001 /* send buffer size */ +#define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SO_SNDLOWAT 0x1003 /* send low-water mark */ +#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ +#define SO_SNDTIMEO 0x1005 /* send timeout */ +#define SO_RCVTIMEO 0x1006 /* receive timeout */ +#define SO_ERROR 0x1007 /* get error status and clear */ +#define SO_TYPE 0x1008 /* get socket type */ +#define SO_SND_COPYAVOID 0x1009 /* avoid copy on send*/ +#define SO_RCV_COPYAVOID 0x100a /* avoid copy on rcv */ + +/* + * Level number for (get/set)sockopt() to apply to socket itself. + */ +#define SOL_SOCKET 0xffff /* options for socket level */ + +/* + * Address families. + */ +#define AF_UNSPEC 0 /* unspecified */ +#define AF_UNIX 1 /* local to host (pipes, portals) */ +#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ +#define AF_IMPLINK 3 /* arpanet imp addresses */ +#define AF_PUP 4 /* pup protocols: e.g. BSP */ +#define AF_CHAOS 5 /* mit CHAOS protocols */ +#define AF_NS 6 /* XEROX NS protocols */ +#define AF_NBS 7 /* nbs protocols */ +#define AF_ECMA 8 /* european computer manufacturers */ +#define AF_DATAKIT 9 /* datakit protocols */ +#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ +#define AF_SNA 11 /* IBM SNA */ +#define AF_DECnet 12 /* DECnet */ +#define AF_DLI 13 /* Direct data link interface */ +#define AF_LAT 14 /* LAT */ +#define AF_HYLINK 15 /* NSC Hyperchannel */ +#define AF_APPLETALK 16 /* Apple Talk */ +#define AF_OTS 17 /* Used for OSI in the ifnets */ +#define AF_NIT 18 /* NIT */ + +#define AF_MAX 19 + +/* + * Structure used by kernel to store most + * addresses. + */ +struct sockaddr { + unsigned short sa_family; /* address family */ + char sa_data[14]; /* up to 14 bytes of direct address */ +}; + +/* + * Structure used by kernel to pass protocol + * information in raw sockets. + */ +struct sockproto { + unsigned short sp_family; /* address family */ + unsigned short sp_protocol; /* protocol */ +}; + +/* + * Protocol families, same as address families for now. + */ +#define PF_UNSPEC AF_UNSPEC +#define PF_UNIX AF_UNIX +#define PF_INET AF_INET +#define PF_IMPLINK AF_IMPLINK +#define PF_PUP AF_PUP +#define PF_CHAOS AF_CHAOS +#define PF_NS AF_NS +#define PF_NBS AF_NBS +#define PF_ECMA AF_ECMA +#define PF_DATAKIT AF_DATAKIT +#define PF_CCITT AF_CCITT +#define PF_SNA AF_SNA +#define PF_DECnet AF_DECnet +#define PF_DLI AF_DLI +#define PF_LAT AF_LAT +#define PF_HYLINK AF_HYLINK +#define PF_APPLETALK AF_APPLETALK + +#define PF_MAX AF_MAX + +/* + * Maximum queue length specifiable by listen. + */ +#define SOMAXCONN 20 + +/* + * Message header for recvmsg and sendmsg calls. + */ +struct msghdr { + caddr_t msg_name; /* optional address */ + int msg_namelen; /* size of address */ + struct iovec *msg_iov; /* scatter/gather array */ + int msg_iovlen; /* # elements in msg_iov */ + caddr_t msg_accrights; /* access rights sent/received */ + int msg_accrightslen; +}; + +#define MSG_OOB 0x1 /* process out-of-band data */ +#define MSG_PEEK 0x2 /* peek at incoming message */ +#define MSG_DONTROUTE 0x4 /* send without using routing tables */ + +#define MSG_MAXIOVLEN 16 + +/* + * Functions + */ + +__BEGIN_DECLS + +int accept __P_((int, struct sockaddr *, int *)); +int bind __P_((int, const struct sockaddr *, int)); +int connect __P_((int, const struct sockaddr *, int)); +int listen __P_((int, int)); +int socket __P_((int, int, int)); + +__END_DECLS + diff --git a/mit-pthreads/machdep/hpux-9.03/stdtypes.h b/mit-pthreads/machdep/hpux-9.03/stdtypes.h new file mode 100755 index 00000000000..2b22abbf818 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/stdtypes.h @@ -0,0 +1,74 @@ +/* @(#)stdtypes.h 1.6 90/01/04 SMI */ + +/* + * Suppose you have an ANSI C or POSIX thingy that needs a typedef + * for thingy_t. Put it here and include this file wherever you + * define the thingy. This is used so that we don't have size_t in + * N (N > 1) different places and so that we don't have to have + * types.h included all the time and so that we can include this in + * the lint libs instead of termios.h which conflicts with ioctl.h. + */ +#ifndef __sys_stdtypes_h +#define __sys_stdtypes_h + +#ifndef _SIGSET_T_ +#define _SIGSET_T_ +typedef int sigset_t; /* signal mask - may change */ +#endif + +#ifndef _SPEED_T_ +#define _SPEED_T_ +typedef unsigned int speed_t; /* tty speeds */ +#endif + +#ifndef _TCFLAG_T_ +#define _TCFLAG_T_ +typedef unsigned long tcflag_t; /* tty line disc modes */ +#endif + +#ifndef _CC_T_ +#define _CC_T_ +typedef unsigned char cc_t; /* tty control char */ +#endif + +#ifndef _PID_T_ +#define _PID_T_ +typedef int pid_t; /* process id */ +#endif + +#ifndef _MODE_T_ +#define _MODE_T_ +typedef unsigned short mode_t; /* file mode bits */ +#endif + +#ifndef _NLINK_T_ +#define _NLINK_T_ +typedef short nlink_t; /* links to a file */ +#endif + +#ifndef _CLOCK_T_ +#define _CLOCK_T_ +typedef long clock_t; /* units=ticks (typically 60/sec) */ +#endif + +#ifndef _TIME_T_ +#define _TIME_T_ +typedef long time_t; /* value = secs since epoch */ +#endif + +#ifndef _SIZE_T_ +#define _SIZE_T_ +typedef int size_t; /* ??? */ +#endif + +#ifndef _PTRDIFF_T_ +#define _PTRDIFF_T_ +typedef int ptrdiff_t; /* result of subtracting two pointers */ +#endif + +#ifndef _WCHAR_T_ +#define _WCHAR_T_ +typedef unsigned short wchar_t; /* big enough for biggest char set */ +#endif + +#endif /* !__sys_stdtypes_h */ diff --git a/mit-pthreads/machdep/hpux-9.03/time.h b/mit-pthreads/machdep/hpux-9.03/time.h new file mode 100755 index 00000000000..544905b0749 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/time.h @@ -0,0 +1,228 @@ +/* $Header$ */ + +#ifndef _SYS_TIME_INCLUDED +#define _SYS_TIME_INCLUDED + +/* time.h: Definitions for time handling functions */ + +#ifdef _KERNEL_BUILD +#include "../h/stdsyms.h" +#else /* ! _KERNEL_BUILD */ +#include <sys/stdsyms.h> +#endif /* _KERNEL_BUILD */ + +#include <sys/types.h> + +/* ANSI C time constants, types, and structures */ + +#ifdef _INCLUDE__STDC__ +# define CLOCKS_PER_SEC 1000000 + +# ifndef NULL +# define NULL 0 +# endif + +# ifndef _CLOCK_T +# define _CLOCK_T + typedef unsigned long clock_t; +# endif /* _CLOCK_T */ + +# ifndef _TIME_T +# define _TIME_T + typedef long time_t; +# endif /* _TIME_T */ + +# ifndef _SIZE_T +# define _SIZE_T + typedef unsigned int size_t; +# endif /* _SIZE_T */ + + /* Structure used with gmtime(), localtime(), mktime(), strftime(). */ + struct tm { + int tm_sec; /* second (0-61, allows for leap seconds) */ + int tm_min; /* minute (0-59) */ + int tm_hour; /* hour (0-23) */ + int tm_mday; /* day of the month (1-31) */ + int tm_mon; /* month (0-11) */ + int tm_year; /* years since 1900 */ + int tm_wday; /* day of the week (0-6) */ + int tm_yday; /* day of the year (0-365) */ + int tm_isdst; /* non-0 if daylight savings time is in effect */ + }; +#endif /* _INCLUDE__STDC__ */ + + +/* Additional types needed for HP-UX */ + +#ifdef _INCLUDE_HPUX_SOURCE +# ifndef _STRUCT_TIMEVAL +# define _STRUCT_TIMEVAL + /* Structure returned by gettimeofday(2) system call and others */ + struct timeval { + unsigned long tv_sec; /* seconds */ + long tv_usec; /* and microseconds */ + }; +# endif /* _STRUCT_TIMEVAL */ + + /* Structure used to represent timezones for gettimeofday(2) and others */ + struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ + }; + + /* Structure defining a timer setting. */ + struct itimerval { + struct timeval it_interval; /* timer interval */ + struct timeval it_value; /* current value */ + }; +#endif /* _INCLUDE_HPUX_SOURCE */ + + +/* Function prototypes and external variable declarations */ + +#ifndef _KERNEL +#ifdef __cplusplus + extern "C" { +#endif /* __cplusplus */ + +#ifdef _INCLUDE__STDC__ +# ifdef _PROTOTYPES + extern double difftime(time_t, time_t); + extern time_t mktime(struct tm *); + extern time_t time(time_t *); + extern char *ctime(const time_t *); + extern struct tm *gmtime(const time_t *); + extern struct tm *localtime(const time_t *); + extern size_t strftime(char *, size_t, const char *, const struct tm *); +# else /* not _PROTOTYPES */ + extern double difftime(); + extern time_t mktime(); + extern time_t time(); + extern char *ctime(); + extern struct tm *gmtime(); + extern struct tm *localtime(); + extern size_t strftime(); +# endif /* not _PROTOTYPES */ + +# ifdef _CLASSIC_ANSI_TYPES + extern long clock(); +# else /* not _CLASSIC_ANSI_TYPES */ +# ifdef _PROTOTYPES + extern clock_t clock(void); +# else /* not _PROTOTYPES */ + extern clock_t clock(); +# endif /* not _PROTOTYPES */ +# endif /* not _CLASSIC_ANSI_TYPES */ +#endif /* _INCLUDE__STDC__ */ + +#ifdef _INCLUDE_POSIX_SOURCE +# ifdef _PROTOTYPES + extern void tzset(void); +# else /* not _PROTOTYPES */ + extern void tzset(); +# endif /* not _PROTOTYPES */ + + extern char *tzname[2]; +#endif /* _INCLUDE_POSIX_SOURCE */ + + +#ifdef _INCLUDE_XOPEN_SOURCE +# ifdef _PROTOTYPES + extern char *strptime(const char *, const char *, struct tm *); +# else /* not _PROTOTYPES */ + extern char *strptime(); +# endif /* not _PROTOTYPES */ + + extern long timezone; + extern int daylight; +#endif /* _INCLUDE_XOPEN_SOURCE */ + + +#ifdef _INCLUDE_HPUX_SOURCE +# ifdef _PROTOTYPES + extern struct tm *getdate(const char *); + extern char *nl_asctime(struct tm *, char *, int); + extern char *nl_ctime(long *, char *, int); + extern char *nl_ascxtime(struct tm *, char *); + extern char *nl_cxtime(long *, char *); + extern int getitimer(int, struct itimerval *); + extern int setitimer(int, const struct itimerval *, struct itimerval *); + extern int gettimeofday(struct timeval *, struct timezone *); + extern int settimeofday(const struct timeval *, const struct timezone *); + extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); + extern int stime(const time_t *); +# else /* not _PROTOTYPES */ + extern struct tm *getdate(); + extern char *nl_asctime(); + extern char *nl_ctime(); + extern char *nl_ascxtime(); + extern char *nl_cxtime(); + extern int getitimer(); + extern int setitimer(); + extern int gettimeofday(); + extern int settimeofday(); + extern int select(); + extern int stime(); +# endif /* not _PROTOTYPES */ + extern int getdate_err; +#endif /* _INCLUDE_HPUX_SOURCE */ + +#ifdef __cplusplus + } +#endif /* __cplusplus */ +#endif /* not _KERNEL */ + + +/* + * CLK_TCK is needed by the kernel, and also in the POSIX namespace. + */ + +#ifdef _INCLUDE_POSIX_SOURCE +# ifndef CLK_TCK +# ifdef __hp9000s300 +# define CLK_TCK 50 +# endif /* __hp9000s300 */ +# ifdef __hp9000s800 +# define CLK_TCK 100 +# endif /* __hp9000s800 */ +# endif /* CLK_TCK */ +#endif + + +/* Additional HP-UX structures, macros, and constants */ + +#ifdef _INCLUDE_HPUX_SOURCE + + /* Kernel instrumentation time value */ + struct ki_timeval { + long tv_sec; /* seconds */ + long tv_nunit; /* and native units */ + }; + + /* Kinds of daylight savings time */ +# define DST_NONE 0 /* not on dst */ +# define DST_USA 1 /* USA style dst */ +# define DST_AUST 2 /* Australian style dst */ +# define DST_WET 3 /* Western European dst */ +# define DST_MET 4 /* Middle European dst */ +# define DST_EET 5 /* Eastern European dst */ + + /* + * Operations on timevals. + * + * NB: timercmp does not work for >= or <=. + */ +# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +# define timercmp(tvp, uvp, cmp) \ + ((tvp)->tv_sec cmp (uvp)->tv_sec || \ + (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) +# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) + + /* Names of the interval timers */ +# define ITIMER_REAL 0 +# define ITIMER_VIRTUAL 1 +# define ITIMER_PROF 2 + +#endif /* _INCLUDE_HPUX_SOURCE */ + +#endif /* _SYS_TIME_INCLUDED */ diff --git a/mit-pthreads/machdep/hpux-9.03/timers.h b/mit-pthreads/machdep/hpux-9.03/timers.h new file mode 100755 index 00000000000..3c4d057976a --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/timers.h @@ -0,0 +1,68 @@ +/* ==== timers.h ============================================================ + * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Chris Provenzano. + * 4. The name of Chris Provenzano may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + * + * Description : Basic timers header. + * + * 1.00 94/06/13 proven + * -Started coding this file. + */ + +#ifndef _SYS_TIMERS_H_ +#define _SYS_TIMERS_H_ + +#include <sys/types.h> +#include <time.h> + +struct timespec { + time_t tv_sec; + long tv_nsec; +}; + +#define TIMEVAL_TO_TIMESPEC(tv, ts) { \ + (ts)->tv_sec = (tv)->tv_sec; \ + (ts)->tv_nsec = (tv)->tv_usec * 1000; \ +} +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (ts)->tv_sec; \ + (tv)->tv_usec = (ts)->tv_nsec / 1000; \ +} + +/* + * New functions + */ + +__BEGIN_DECLS + +__END_DECLS + +#endif diff --git a/mit-pthreads/machdep/hpux-9.03/uio.h b/mit-pthreads/machdep/hpux-9.03/uio.h new file mode 100755 index 00000000000..d1ec4c94f22 --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/uio.h @@ -0,0 +1,25 @@ +/* ==== uio.h ============================================================ + * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu + * + * Description : Correct HP-UX header file. + */ + +#ifndef _PTHREAD_UIO_H_ +#define _PTHREAD_UIO_H_ + +#include <sys/cdefs.h> + +struct iovec { + void *iov_base; + size_t iov_len; +}; + +__BEGIN_DECLS + +int readv __P_((int, const struct iovec *, int)); +int writev __P_((int, const struct iovec *, int)); + +__END_DECLS + +#endif + diff --git a/mit-pthreads/machdep/hpux-9.03/wait.h b/mit-pthreads/machdep/hpux-9.03/wait.h new file mode 100755 index 00000000000..bca70d9f1ec --- /dev/null +++ b/mit-pthreads/machdep/hpux-9.03/wait.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)wait.h 8.1 (Berkeley) 6/2/93 + * $Id$ + */ + +#ifndef _SYS_WAIT_H_ +#define _SYS_WAIT_H_ + +/* + * Macros to test the exit status returned by wait + * and extract the relevant values. + */ +#define _W_INT(i) (i) +#define WCOREFLAG 0200 + +#define _WSTATUS(x) (_W_INT(x) & 0177) +#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */ +#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED) +#define WSTOPSIG(x) (_W_INT(x) >> 8) +#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0) +#define WTERMSIG(x) (_WSTATUS(x)) +#define WIFEXITED(x) (_WSTATUS(x) == 0) +#define WEXITSTATUS(x) (_W_INT(x) >> 8) +#ifndef _POSIX_SOURCE +#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG) + +#define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) +#define W_STOPCODE(sig) ((sig) << 8 | _WSTOPPED) +#endif + +#define WNOHANG 1 /* dont hang in wait */ +#define WUNTRACED 2 /* tell about stopped, untraced children */ + +#ifndef _POSIX_SOURCE +/* POSIX extensions and 4.2/4.3 compatability: */ + +/* + * Tokens for special values of the "pid" parameter to wait4. + */ +#define WAIT_ANY (-1) /* any process */ +#define WAIT_MYPGRP 0 /* any process in my process group */ + +#define WSTOPPED _WSTOPPED +#endif /* _POSIX_SOURCE */ + +#include <sys/types.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS +struct rusage; /* forward declaration */ + +pid_t wait __P_((int *)); +pid_t waitpid __P_((pid_t, int *, int)); + +#ifndef _POSIX_SOURCE +pid_t wait3 __P_((int *, int, void *)); +#endif + +__END_DECLS + +#endif |