summaryrefslogtreecommitdiff
path: root/mit-pthreads/machdep
diff options
context:
space:
mode:
Diffstat (limited to 'mit-pthreads/machdep')
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__math.h16
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__signal.h106
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__stdio.h13
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__stdlib.h3
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__string.h19
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__time.h21
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/__unistd.h6
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/cdefs.h62
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/compat.h1
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/dirent.h7
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/signal.h3
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/socket.h296
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/timers.h60
-rwxr-xr-xmit-pthreads/machdep/alpha-osf1/uio.h12
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/compat.h43
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/dirent.h73
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/errno.h160
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/socket.h277
-rwxr-xr-xmit-pthreads/machdep/bsdi-1.1/timers.h59
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__path.h13
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__signal.h7
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__stdio.h7
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__stdlib.h60
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__string.h19
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__time.h63
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/__unistd.h109
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/compat.h65
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/dirent.h65
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/errno.h162
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/time.h6
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/bsdi-2.0/wait.h159
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.1.c196
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.1.h111
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.3.c204
-rw-r--r--mit-pthreads/machdep/engine-alpha-netbsd-1.3.h114
-rw-r--r--mit-pthreads/machdep/engine-alpha-osf1.c207
-rw-r--r--mit-pthreads/machdep/engine-alpha-osf1.h110
-rw-r--r--mit-pthreads/machdep/engine-arm32-netbsd-1.3.c203
-rw-r--r--mit-pthreads/machdep/engine-arm32-netbsd-1.3.h102
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-10.20.c169
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-10.20.h143
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-9.03.c153
-rw-r--r--mit-pthreads/machdep/engine-hppa-hpux-9.03.h141
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-1.1.c180
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-1.1.h84
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-2.0.c210
-rw-r--r--mit-pthreads/machdep/engine-i386-bsdi-2.0.h98
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-1.1.c179
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-1.1.h83
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-2.0.c208
-rw-r--r--mit-pthreads/machdep/engine-i386-freebsd-2.0.h97
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-1.0.c503
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-1.0.h98
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-2.0.c504
-rw-r--r--mit-pthreads/machdep/engine-i386-linux-2.0.h98
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-0.9.c155
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-0.9.h83
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.0.c218
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.0.h97
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.3.c225
-rw-r--r--mit-pthreads/machdep/engine-i386-netbsd-1.3.h98
-rw-r--r--mit-pthreads/machdep/engine-i386-openbsd-2.0.c215
-rw-r--r--mit-pthreads/machdep/engine-i386-openbsd-2.0.h97
-rwxr-xr-xmit-pthreads/machdep/engine-i386-sco-3.2v5.c1072
-rw-r--r--mit-pthreads/machdep/engine-i386-sco-3.2v5.h104
-rw-r--r--mit-pthreads/machdep/engine-ip22-irix-5.2.c225
-rw-r--r--mit-pthreads/machdep/engine-ip22-irix-5.2.h108
-rw-r--r--mit-pthreads/machdep/engine-m68000-netbsd.c256
-rw-r--r--mit-pthreads/machdep/engine-m68000-netbsd.h107
-rw-r--r--mit-pthreads/machdep/engine-r2000-ultrix-4.2.c209
-rw-r--r--mit-pthreads/machdep/engine-r2000-ultrix-4.2.h107
-rw-r--r--mit-pthreads/machdep/engine-romp-bsd.c99
-rw-r--r--mit-pthreads/machdep/engine-romp-bsd.h100
-rw-r--r--mit-pthreads/machdep/engine-sparc-netbsd-1.3.c232
-rw-r--r--mit-pthreads/machdep/engine-sparc-netbsd-1.3.h106
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c227
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h105
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-5.3.c308
-rw-r--r--mit-pthreads/machdep/engine-sparc-sunos-5.3.h129
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/compat.h43
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/socket.h267
-rwxr-xr-xmit-pthreads/machdep/freebsd-1.1/timers.h68
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__signal.h8
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__stdlib.h66
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__string.h21
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__time.h70
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/__unistd.h113
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/compat.h43
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/errno.h160
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/freebsd-2.0/wait.h162
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__math.h3
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__signal.h28
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__stdio.h11
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__stdlib.h24
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__string.h20
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__time.h31
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/__unistd.h68
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/cdefs.h67
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/compat.h45
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/dirent.h61
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/socket.h171
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/stdtypes.h74
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/time.h228
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/timers.h71
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/uio.h25
-rwxr-xr-xmit-pthreads/machdep/hpux-10.20/wait.h92
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__math.h3
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__signal.h28
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__stdlib.h24
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__string.h20
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__time.h31
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/__unistd.h66
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/cdefs.h61
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/compat.h45
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/dirent.h61
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/socket.h171
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/stdtypes.h74
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/time.h228
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/timers.h68
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/uio.h25
-rwxr-xr-xmit-pthreads/machdep/hpux-9.03/wait.h92
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/__math.h219
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/__signal.h109
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/__stdio.h113
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/__stdlib.h137
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/__string.h125
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/__time.h141
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/__unistd.h48
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/compat.h46
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/dirent.h145
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/posix/__signal.h69
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/socket.h490
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/syscall.h175
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/timers.h68
-rwxr-xr-xmit-pthreads/machdep/i386-sco-3.2v5/trash.can1
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__math.h4
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__signal.h15
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__stdio.h6
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__stdlib.h30
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__string.h5
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__time.h21
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/__unistd.h8
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/compat.h45
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/dirent.h21
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/socket.h304
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/timers.h18
-rwxr-xr-xmit-pthreads/machdep/irix-5.2/wait.h104
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__math.h4
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__signal.h24
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__stdio.h7
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__stdlib.h20
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__string.h18
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__time.h72
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/__unistd.h56
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/cdefs.h23
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/compat.h47
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/dirent.h27
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/errno.h12
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/socket.h193
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/timers.h71
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/uio.h15
-rwxr-xr-xmit-pthreads/machdep/linux-1.0/wait.h98
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__math.h4
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__signal.h24
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__stdio.h7
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__stdlib.h20
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__string.h18
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__time.h78
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/__unistd.h62
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/cdefs.h36
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/compat.h47
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/dirent.h27
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/errno.h12
-rw-r--r--mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h15
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/extra/bits/socket.h193
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/socket.h196
-rw-r--r--mit-pthreads/machdep/linux-2.0/socketcall.h0
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/timers.h71
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/uio.h15
-rwxr-xr-xmit-pthreads/machdep/linux-2.0/wait.h98
-rwxr-xr-xmit-pthreads/machdep/netbsd-0.9/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__signal.h8
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__stdlib.h60
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__string.h20
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__time.h69
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/__unistd.h107
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/compat.h43
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/errno.h160
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/time.h125
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.0/wait.h158
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__math.h6
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__path.h14
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__signal.h20
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__stdlib.h60
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__string.h20
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__time.h69
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/__unistd.h107
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/compat.h43
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/dirent.h95
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/errno.h170
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/time.h153
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/timers.h45
-rwxr-xr-xmit-pthreads/machdep/netbsd-1.1/wait.h163
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__math.h6
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__path.h14
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__signal.h8
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__stdio.h8
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__stdlib.h66
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__string.h21
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__time.h70
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/__unistd.h109
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/compat.h43
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/errno.h160
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/timers.h45
-rwxr-xr-xmit-pthreads/machdep/openbsd-2.0/wait.h162
-rw-r--r--mit-pthreads/machdep/posix-alpha-osf1.h7
-rw-r--r--mit-pthreads/machdep/posix-bsdi-1.1.h34
-rw-r--r--mit-pthreads/machdep/posix-bsdi-2.0.h34
-rw-r--r--mit-pthreads/machdep/posix-freebsd-1.1.h33
-rw-r--r--mit-pthreads/machdep/posix-freebsd-2.0.h31
-rw-r--r--mit-pthreads/machdep/posix-hpux-10.20.h23
-rw-r--r--mit-pthreads/machdep/posix-hpux-9.03.h23
-rw-r--r--mit-pthreads/machdep/posix-i386-sco-3.2v5.h35
-rw-r--r--mit-pthreads/machdep/posix-irix-5.2.h31
-rw-r--r--mit-pthreads/machdep/posix-linux-1.0.h31
-rw-r--r--mit-pthreads/machdep/posix-linux-2.0.h31
-rw-r--r--mit-pthreads/machdep/posix-netbsd-0.9.h22
-rw-r--r--mit-pthreads/machdep/posix-netbsd-1.0.h31
-rw-r--r--mit-pthreads/machdep/posix-netbsd-1.1.h31
-rw-r--r--mit-pthreads/machdep/posix-openbsd-2.0.h31
-rw-r--r--mit-pthreads/machdep/posix-romp-bsd.h33
-rw-r--r--mit-pthreads/machdep/posix-sco-3.2v5.h35
-rw-r--r--mit-pthreads/machdep/posix-sunos-4.1.3.h27
-rw-r--r--mit-pthreads/machdep/posix-sunos-5.3.h22
-rw-r--r--mit-pthreads/machdep/posix-sunos-5.5.h22
-rw-r--r--mit-pthreads/machdep/posix-ultrix-4.2.h24
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/__math.h219
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/__signal.h109
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/__stdio.h113
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/__stdlib.h137
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/__string.h125
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/__time.h141
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/__unistd.h48
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/compat.h46
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/dirent.h145
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/posix/__signal.h69
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/socket.h490
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/syscall.h175
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/timers.h68
-rwxr-xr-xmit-pthreads/machdep/sco-3.2v5/trash.can1
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__math.h5
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__path.h12
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__signal.h11
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__stdio.h4
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__stdlib.h28
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__string.h14
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__time.h2
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/__unistd.h73
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/cdefs.h61
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/compat.h45
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/fcntlcom.h163
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/signal.h98
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/stat.h94
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/time.h69
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/timers.h68
-rwxr-xr-xmit-pthreads/machdep/sunos-4.1.3/wait.h22
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__math.h16
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__signal.h19
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__stdio.h6
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__stdlib.h27
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__string.h12
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__time.h69
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/__unistd.h47
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/cdefs.h59
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/compat.h45
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/socket.h180
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/timers.h72
-rwxr-xr-xmit-pthreads/machdep/sunos-5.3/uio.h40
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__math.h16
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__signal.h19
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__stdio.h6
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__stdlib.h27
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__string.h12
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__time.h69
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/__unistd.h47
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/cdefs.h59
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/compat.h45
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/dirent.h64
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/socket.h180
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/timers.h70
-rwxr-xr-xmit-pthreads/machdep/sunos-5.5/uio.h40
-rw-r--r--mit-pthreads/machdep/syscall-alpha-netbsd-1.1.S206
-rw-r--r--mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S228
-rw-r--r--mit-pthreads/machdep/syscall-alpha-osf1.S97
-rw-r--r--mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S193
-rw-r--r--mit-pthreads/machdep/syscall-hppa-hpux-10.20.S23
-rw-r--r--mit-pthreads/machdep/syscall-hppa-hpux-9.03.S23
-rw-r--r--mit-pthreads/machdep/syscall-i386-bsdi-1.1.S288
-rw-r--r--mit-pthreads/machdep/syscall-i386-bsdi-2.0.S294
-rw-r--r--mit-pthreads/machdep/syscall-i386-freebsd-1.1.S293
-rw-r--r--mit-pthreads/machdep/syscall-i386-freebsd-2.0.S240
-rw-r--r--mit-pthreads/machdep/syscall-i386-linux-1.0.S406
-rw-r--r--mit-pthreads/machdep/syscall-i386-linux-2.0.S389
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-0.9.S229
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-1.0.S158
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-1.1.S181
-rw-r--r--mit-pthreads/machdep/syscall-i386-netbsd-1.3.S200
-rw-r--r--mit-pthreads/machdep/syscall-i386-openbsd-2.0.S237
-rw-r--r--mit-pthreads/machdep/syscall-i386-sco-3.2v5.S442
-rw-r--r--mit-pthreads/machdep/syscall-ip22-irix-5.2.S106
-rw-r--r--mit-pthreads/machdep/syscall-m68000-netbsd.S83
-rw-r--r--mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S166
-rw-r--r--mit-pthreads/machdep/syscall-romp-bsd.S327
-rw-r--r--mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S102
-rw-r--r--mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S172
-rw-r--r--mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S113
-rw-r--r--mit-pthreads/machdep/syscall-sparc-sunos-5.3.S65
-rw-r--r--mit-pthreads/machdep/syscall-sparc-sunos4.S113
-rw-r--r--mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S46
-rw-r--r--mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S53
-rw-r--r--mit-pthreads/machdep/syscall-template-alpha-osf1.S46
-rw-r--r--mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S55
-rw-r--r--mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S27
-rw-r--r--mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S27
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S48
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S59
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S49
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S56
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S49
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S48
-rw-r--r--mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S67
-rw-r--r--mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S51
-rw-r--r--mit-pthreads/machdep/syscall-template-m68000-netbsd.S43
-rw-r--r--mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S77
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S40
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S48
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S45
-rw-r--r--mit-pthreads/machdep/syscall-template-sparc-sunos4.S40
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__math.h2
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__signal.h66
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__stdio.h7
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__stdlib.h21
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__string.h17
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__time.h69
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/__unistd.h51
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/cdefs.h66
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/compat.h45
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/dirent.h61
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/errno.h180
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/time.h83
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/timers.h68
-rwxr-xr-xmit-pthreads/machdep/ultrix-4.2/wait.h121
-rw-r--r--mit-pthreads/machdep/unistd-i386-freebsd-1.1.h178
-rw-r--r--mit-pthreads/machdep/unistd-i386-linux-1.0.h59
-rw-r--r--mit-pthreads/machdep/unistd-i386-linux-2.0.h59
-rw-r--r--mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h215
376 files changed, 33287 insertions, 0 deletions
diff --git a/mit-pthreads/machdep/alpha-osf1/__math.h b/mit-pthreads/machdep/alpha-osf1/__math.h
new file mode 100755
index 00000000000..12fdc85678c
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/__math.h
@@ -0,0 +1,16 @@
+/*
+ * ANSI required entries in math.h
+ *
+ */
+#ifdef _ANSI_C_SOURCE
+
+#if defined(_IEEE_FP)
+# define HUGE_VAL 1.8e308
+#else
+# define HUGE_VAL 1.797693134862315708e308
+#endif
+
+#endif /*_ANSI_C_SOURCE */
+
+
+
diff --git a/mit-pthreads/machdep/alpha-osf1/__signal.h b/mit-pthreads/machdep/alpha-osf1/__signal.h
new file mode 100755
index 00000000000..2bb13380314
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/__signal.h
@@ -0,0 +1,106 @@
+#include <standards.h>
+
+typedef int sig_atomic_t; /* accessable as an atomic entity (ANSI) */
+
+/*
+ * valid signal values: all undefined values are reserved for future use
+ * note: POSIX requires a value of 0 to be used as the null signal in kill()
+ */
+#define SIGHUP 1 /* hangup, generated when terminal disconnects */
+#define SIGINT 2 /* interrupt, generated from terminal special char */
+#define SIGQUIT 3 /* (*) quit, generated from terminal special char */
+#define SIGILL 4 /* (*) illegal instruction (not reset when caught)*/
+#define SIGTRAP 5 /* (*) trace trap (not reset when caught) */
+#define SIGABRT 6 /* (*) abort process */
+#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 (specification exception) */
+#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 timeout */
+#define SIGTERM 15 /* software termination signal */
+#define SIGURG 16 /* (+) urgent contition on I/O channel */
+#define SIGSTOP 17 /* (@) stop (cannot be caught or ignored) */
+#define SIGTSTP 18 /* (@) interactive stop */
+#define SIGCONT 19 /* (!) continue (cannot be caught or ignored) */
+#define SIGCHLD 20 /* (+) sent to parent on child stop or exit */
+#define SIGTTIN 21 /* (@) background read attempted from control terminal*/
+#define SIGTTOU 22 /* (@) background write attempted to control terminal */
+#define SIGIO 23 /* (+) I/O possible, or completed */
+#define SIGXCPU 24 /* cpu time limit exceeded (see setrlimit()) */
+#define SIGXFSZ 25 /* file size limit exceeded (see setrlimit()) */
+#define SIGVTALRM 26 /* virtual time alarm (see setitimer) */
+#define SIGPROF 27 /* profiling time alarm (see setitimer) */
+#define SIGWINCH 28 /* (+) window size changed */
+#define SIGINFO 29 /* information request */
+#define SIGUSR1 30 /* user defined signal 1 */
+#define SIGUSR2 31 /* user defined signal 2 */
+#define SIGMAX 31
+#define NSIG 31
+
+/*
+ * additional signal names supplied for compatibility, only
+ */
+#define SIGIOINT SIGURG /* printer to backend error signal */
+#define SIGAIO SIGIO /* base lan i/o */
+#define SIGPTY SIGIO /* pty i/o */
+#define SIGPOLL SIGIO /* STREAMS version of this signal */
+#define SIGIOT SIGABRT /* abort (terminate) process */
+#define SIGLOST SIGIOT /* old BSD signal ?? */
+#define SIGPWR SIGINFO /* Power Fail/Restart -- SVID3/SVR4 */
+#define SIGCLD SIGCHLD
+
+/*
+ * valid signal action values; other values => pointer to handler function
+ */
+#define SIG_DFL (void (*)())0
+#define SIG_IGN (void (*)())1
+
+/*
+ * values of "how" argument to sigprocmask() call
+ */
+#define SIG_BLOCK 1
+#define SIG_UNBLOCK 2
+#define SIG_SETMASK 3
+
+/*
+ * sigaction structure used in sigaction() system call
+ * The order of the fields in this structure must match those in
+ * the sigvec structure (below).
+ */
+struct sigaction {
+ void (*sa_handler)(); /* signal handler, or action value */
+ sigset_t sa_mask; /* signals to block while in handler */
+ int sa_flags; /* signal action flags */
+};
+
+#define __SIGEMPTYSET 0
+#define __SIGFILLSET 0xffffffff
+#define __SIGADDSET(s, n) ( *(s) |= 1L << ((n) - 1), 0)
+#define __SIGDELSET(s, n) ( *(s) &= ~(1L << ((n) - 1)), 0)
+#define __SIGISMEMBER(s, n) ( (*(s) & (1L << ((n) - 1))) != (sigset_t)0)
+
+
+#define SIGSTKSZ (16384)
+#define MINSIGSTKSZ (4096)
+
+/*
+ * valid flags define for sa_flag field of sigaction structure
+ */
+#define SA_ONSTACK 0x00000001 /* run on special signal stack */
+#define SA_RESTART 0x00000002 /* restart system calls on sigs */
+#define SA_NOCLDSTOP 0x00000004 /* do not set SIGCHLD for child stops*/
+#define SA_NODEFER 0x00000008 /* don't block while handling */
+#define SA_RESETHAND 0x00000010 /* old sys5 style behavior */
+#define SA_NOCLDWAIT 0x00000020 /* no zombies */
+#define SA_SIGINFO 0x00000040 /* deliver siginfo to handler */
+
+/* This is for sys/time.h */
+/* Removed for OSF1 V3.2
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+*/
diff --git a/mit-pthreads/machdep/alpha-osf1/__stdio.h b/mit-pthreads/machdep/alpha-osf1/__stdio.h
new file mode 100755
index 00000000000..39801b125c8
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/__stdio.h
@@ -0,0 +1,13 @@
+
+#ifndef _FPOS_T
+#define _FPOS_T
+typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+#define HAVE_SYS_ERRLIST_WITHOUT_CONST
+
diff --git a/mit-pthreads/machdep/alpha-osf1/__stdlib.h b/mit-pthreads/machdep/alpha-osf1/__stdlib.h
new file mode 100755
index 00000000000..79ca737e0c8
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/__stdlib.h
@@ -0,0 +1,3 @@
+/* bleah */
+
+#include <stddef.h>
diff --git a/mit-pthreads/machdep/alpha-osf1/__string.h b/mit-pthreads/machdep/alpha-osf1/__string.h
new file mode 100755
index 00000000000..6558102a282
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/__string.h
@@ -0,0 +1,19 @@
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+__BEGIN_DECLS
+
+/*
+void * memchr __P_((const void *, int , size_t ));
+void * memcpy __P_((void *, const void *, size_t ));
+void * memset __P_((void *, int , size_t ));
+size_t strcspn __P_((const char *, const char *));
+size_t strlen __P_((const char *));
+size_t strspn __P_((const char *, const char *));
+*/
+
+__END_DECLS
+
diff --git a/mit-pthreads/machdep/alpha-osf1/__time.h b/mit-pthreads/machdep/alpha-osf1/__time.h
new file mode 100755
index 00000000000..b4ce1ead2bf
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/__time.h
@@ -0,0 +1,21 @@
+#include <pthread/types.h>
+#include <machine/machtime.h> /* CLOCKS_PER_SEC is defined here */
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef pthread_clock_t clock_t;
+#endif
+
+#ifndef _TIME_T
+#define _TIME_T
+typedef pthread_time_t time_t;
+#endif
+
+#ifndef CLK_TCK
+#define CLK_TCK 60
+#endif
diff --git a/mit-pthreads/machdep/alpha-osf1/__unistd.h b/mit-pthreads/machdep/alpha-osf1/__unistd.h
new file mode 100755
index 00000000000..2a7fbe9389b
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/__unistd.h
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+
+#ifndef _SSIZE_T
+#define _SSIZE_T
+typedef long ssize_t; /* Added by monty */
+#endif
diff --git a/mit-pthreads/machdep/alpha-osf1/cdefs.h b/mit-pthreads/machdep/alpha-osf1/cdefs.h
new file mode 100755
index 00000000000..c9b54f033ec
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/cdefs.h
@@ -0,0 +1,62 @@
+/* ==== 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 __BEGIN_DECLS
+#define __END_DECLS
+#define __INLINE static
+#define inline
+#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/alpha-osf1/compat.h b/mit-pthreads/machdep/alpha-osf1/compat.h
new file mode 100755
index 00000000000..4c2801e05de
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/compat.h
@@ -0,0 +1 @@
+#define omsghdr msghdr
diff --git a/mit-pthreads/machdep/alpha-osf1/dirent.h b/mit-pthreads/machdep/alpha-osf1/dirent.h
new file mode 100755
index 00000000000..697ef7b8a8c
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/dirent.h
@@ -0,0 +1,7 @@
+struct dirent {
+ ino_t d_ino;
+ ushort_t d_reclen, d_namlen;
+ char d_name[256];
+};
+#define d_fileno d_ino
+#define MAXNAMLEN 256
diff --git a/mit-pthreads/machdep/alpha-osf1/signal.h b/mit-pthreads/machdep/alpha-osf1/signal.h
new file mode 100755
index 00000000000..c387f9f31ad
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/signal.h
@@ -0,0 +1,3 @@
+
+
+#include <signal.h>
diff --git a/mit-pthreads/machdep/alpha-osf1/socket.h b/mit-pthreads/machdep/alpha-osf1/socket.h
new file mode 100755
index 00000000000..28e17ca463d
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/socket.h
@@ -0,0 +1,296 @@
+/*
+ * Copyright (c) 1982,1985,1986,1988 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.
+ *
+ * @(#)socket.h 7.13 (Berkeley) 4/20/91
+ */
+
+#ifndef _SOCKET_H_
+#define _SOCKET_H_
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Types
+ */
+#define SOCK_STREAM 1 /* stream socket */
+#define SOCK_DGRAM 2 /* datagram socket */
+#define SOCK_RAW 4 /* raw-protocol interface */
+#define SOCK_RDM 5 /* reliably-delivered message */
+#define SOCK_SEQPACKET 6 /* 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_PROTOTYPE 0x1009 /* get/set protocol type */
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+/*
+ * 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 /* DEC Direct data link interface */
+#define AF_LAT 14 /* LAT */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_APPLETALK 16 /* Apple Talk */
+#define AF_NIT 17 /* Network Interface Tap */
+#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
+#define AF_ISO 19 /* ISO protocols */
+#define AF_OSI AF_ISO
+#define AF_X25 20 /* CCITT X.25 in particular */
+#define AF_OSINET 21
+#define AF_GOSIP 22
+#define AF_MAX 22
+
+/* Not supported by solaris */
+/* #define AF_ROUTE 17 /* Internal Routing Protocol */
+/* #define AF_LINK 18 /* Link layer interface */
+/* #define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+
+
+/*
+ * Structure used by kernel to store most
+ * addresses.
+ */
+struct sockaddr {
+ u_short sa_family; /* address family */
+ char sa_data[14]; /* actually longer; address value */
+};
+
+/*
+ * Structure used by kernel to pass protocol
+ * information in raw sockets.
+ */
+struct sockproto {
+ u_short sp_family; /* address family */
+ u_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_NIT AF_NIT
+#define PF_802 AF_802
+#define PF_ISO AF_ISO
+#define PF_OSI AF_ISO
+#define PF_X25 AF_X25
+#define PF_OSINET AF_OSINET
+#define PF_GOSIP AF_GOSIP
+#define PF_MAX AF_MAX
+
+/* #define PF_ROUTE AF_ROUTE */
+/* #define PF_LINK AF_LINK */
+/* #define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ * Used value-result for recvmsg, value only for sendmsg.
+ */
+struct msghdr {
+ caddr_t msg_name; /* optional address */
+ u_int msg_namelen; /* size of address */
+ struct iovec *msg_iov; /* scatter/gather array */
+ u_int msg_iovlen; /* # elements in msg_iov */
+ caddr_t msg_accrights; /* access rights sent/received */
+ int msg_accrightslen;
+};
+
+#define MSG_MAXIOVLEN 16
+
+#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_EOR 0x8 data completes record */
+/* #define MSG_TRUNC 0x10 data discarded before delivery */
+/* #define MSG_CTRUNC 0x20 control data lost before delivery */
+/* #define MSG_WAITALL 0x40 wait for full request or error */
+
+/*
+ * Header for ancillary data objects in msg_control buffer.
+ * Used for additional information with/about a datagram
+ * not expressible by flags. The format is a sequence
+ * of message elements headed by cmsghdr structures.
+ */
+struct cmsghdr {
+ u_int cmsg_len; /* data byte count, including hdr */
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+/* followed by u_char cmsg_data[]; */
+};
+
+/* given pointer to struct adatahdr, return pointer to data */
+#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
+
+/* given pointer to struct adatahdr, return pointer to next adatahdr */
+#define CMSG_NXTHDR(mhdr, cmsg) \
+ (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
+ (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
+ (struct cmsghdr *)NULL : \
+ (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
+
+#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
+
+/* "Socket"-level control message types: */
+#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+
+/*
+ * 4.3 compat sockaddr, move to compat file later
+ */
+struct osockaddr {
+ u_short sa_family; /* address family */
+ char sa_data[14]; /* up to 14 bytes of direct address */
+};
+
+#define SYS_socketcall 83
+
+#define SO_ACCEPT 1
+#define SO_BIND 2
+#define SO_CONNECT 3
+#define SO_GETPEERNAME 4
+#define SO_GETSOCKNAME 5
+#define SO_GETSOCKOPT 6
+#define SO_LISTEN 7
+#define SO_RECV 8
+#define SO_RECVFROM 9
+#define SO_SEND 10
+#define SO_SENDTO 11
+#define SO_SETSOCKOPT 12
+#define SO_SHUTDOWN 13
+#define SO_SOCKET 14
+#define SO_SOCKPOLL 15
+#define SO_GETIPDOMAIN 16
+#define SO_SETIPDOMAIN 17
+#define SO_ADJTIME 18
+
+#include <sys/cdefs.h>
+
+__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 getpeername __P_((int, struct sockaddr *, int *));
+int getsockname __P_((int, struct sockaddr *, int *));
+int getsockopt __P_((int, int, int, void *, int *));
+int listen __P_((int, int));
+/* original definitions
+int recv __P_((int, void *, int, int));
+int recvfrom __P_((int, void *, int, int,
+ struct sockaddr *, int *));
+int recvmsg __P_((int, struct msghdr *, int));
+int send __P_((int, const void *, int, int));
+int sendto __P_((int, const void *, int, int, const struct sockaddr *, int));
+int sendmsg __P_((int, const struct msghdr *, int));
+*/
+ssize_t recv __P_((int, void *, size_t, int));
+ssize_t recvfrom __P_((int, void *, size_t, int,
+ struct sockaddr *, int *));
+ssize_t recvmsg __P_((int, struct msghdr *, int));
+ssize_t send __P_((int, const void *, size_t, int));
+ssize_t sendto __P_((int, const void *, size_t, int,
+ const struct sockaddr *, int));
+ssize_t sendmsg __P_((int, const struct msghdr *, int));
+int setsockopt __P_((int, int, int, const void *, int));
+int shutdown __P_((int, int));
+int socket __P_((int, int, int));
+int socketpair __P_((int, int, int, int *));
+__END_DECLS
+
+#endif /* !_SOCKET_H_ */
diff --git a/mit-pthreads/machdep/alpha-osf1/timers.h b/mit-pthreads/machdep/alpha-osf1/timers.h
new file mode 100755
index 00000000000..36317d083f0
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/timers.h
@@ -0,0 +1,60 @@
+/* ==== 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; \
+}
+
+#endif
diff --git a/mit-pthreads/machdep/alpha-osf1/uio.h b/mit-pthreads/machdep/alpha-osf1/uio.h
new file mode 100755
index 00000000000..8d494672ee4
--- /dev/null
+++ b/mit-pthreads/machdep/alpha-osf1/uio.h
@@ -0,0 +1,12 @@
+/* N.B.: The Alpha, under OSF/1, does *not* use size_t for the length,
+ or for the returned values from readv and writev. */
+
+struct iovec {
+ void *iov_base;
+ int iov_len;
+};
+
+/* I'm assuming the iovec structures are const. I haven't verified
+ it. */
+extern ssize_t readv (int, const struct iovec *, int);
+extern ssize_t writev (int, const struct iovec *, int);
diff --git a/mit-pthreads/machdep/bsdi-1.1/compat.h b/mit-pthreads/machdep/bsdi-1.1/compat.h
new file mode 100755
index 00000000000..e6f60c372c7
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-1.1/compat.h
@@ -0,0 +1,43 @@
+/* ==== 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 : COmpat header to make socket code compile.
+ *
+ * 1.00 94/08/01 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#endif
diff --git a/mit-pthreads/machdep/bsdi-1.1/dirent.h b/mit-pthreads/machdep/bsdi-1.1/dirent.h
new file mode 100755
index 00000000000..d0272a4ee38
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-1.1/dirent.h
@@ -0,0 +1,73 @@
+/* BSDI $Id$ */
+
+/*-
+ * 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 {
+ unsigned long
+ d_fileno; /* file number of entry */
+ unsigned short
+ d_reclen; /* length of this record */
+ unsigned 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
+};
+
+/*
+ * There should probably be no need for this. In the BSDI sources,
+ * it is excluded if _POSIX_SOURCE is defined, and pthreads are supposed
+ * to be posix. Sources that use d_ino should really be using d_fileno.
+ * mbd
+ */
+#define d_ino d_fileno /* backward compatibility */
+
+#endif /* !_SYS_DIRENT_H_ */
+
diff --git a/mit-pthreads/machdep/bsdi-1.1/errno.h b/mit-pthreads/machdep/bsdi-1.1/errno.h
new file mode 100755
index 00000000000..3da61d692a3
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-1.1/errno.h
@@ -0,0 +1,160 @@
+/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#endif
+#define EBUSY 16 /* Device busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define ETXTBSY 26 /* Text file busy */
+#endif
+#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 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define EAGAIN 35 /* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define EWOULDBLOCK EAGAIN /* 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 */
+#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 */
+
+/* ipc/network software -- 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 /* Operation timed out */
+#define ECONNREFUSED 61 /* Connection refused */
+
+#define ELOOP 62 /* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define ENAMETOOLONG 63 /* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+#endif /* _POSIX_SOURCE */
+#define ENOTEMPTY 66 /* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#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 */
+#define EBADRPC 72 /* RPC struct is bad */
+#define ERPCMISMATCH 73 /* RPC version wrong */
+#define EPROGUNAVAIL 74 /* RPC prog. not avail */
+#define EPROGMISMATCH 75 /* Program version wrong */
+#define EPROCUNAVAIL 76 /* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define ENOLCK 77 /* No locks available */
+#define ENOSYS 78 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define EFTYPE 79 /* Inappropriate file type or format */
+#define EAUTH 80 /* Authentication error */
+#define ENEEDAUTH 81 /* Need authenticator */
+#define ELAST 81 /* Must be equal largest errno */
+#endif /* _POSIX_SOURCE */
+
+#endif
diff --git a/mit-pthreads/machdep/bsdi-1.1/socket.h b/mit-pthreads/machdep/bsdi-1.1/socket.h
new file mode 100755
index 00000000000..39d7c1cce26
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-1.1/socket.h
@@ -0,0 +1,277 @@
+/* BSDI $Id$ */
+
+/*
+ * Copyright (c) 1982,1985,1986,1988 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.
+ *
+ * @(#)socket.h 7.13 (Berkeley) 4/20/91
+ */
+
+#ifndef _SOCKET_H_
+#define _SOCKET_H_
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Types
+ */
+#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 */
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+/*
+ * 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_ISO 7 /* ISO protocols */
+#define AF_OSI AF_ISO
+#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 /* DEC Direct data link interface */
+#define AF_LAT 14 /* LAT */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_APPLETALK 16 /* Apple Talk */
+#define AF_ROUTE 17 /* Internal Routing Protocol */
+#define AF_LINK 18 /* Link layer interface */
+#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+
+#define AF_MAX 20
+
+/*
+ * Structure used by kernel to store most
+ * addresses.
+ */
+struct sockaddr {
+ u_char sa_len; /* total length */
+ u_char sa_family; /* address family */
+ char sa_data[14]; /* actually longer; address value */
+};
+
+/*
+ * Structure used by kernel to pass protocol
+ * information in raw sockets.
+ */
+struct sockproto {
+ u_short sp_family; /* address family */
+ u_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_ISO AF_ISO
+#define PF_OSI AF_ISO
+#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_ROUTE AF_ROUTE
+#define PF_LINK AF_LINK
+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
+
+#define PF_MAX AF_MAX
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ * Used value-result for recvmsg, value only for sendmsg.
+ */
+struct msghdr {
+ caddr_t msg_name; /* optional address */
+ u_int msg_namelen; /* size of address */
+ struct iovec *msg_iov; /* scatter/gather array */
+ u_int msg_iovlen; /* # elements in msg_iov */
+ caddr_t msg_control; /* ancillary data, see below */
+ u_int msg_controllen; /* ancillary data buffer len */
+ int msg_flags; /* flags on received message */
+};
+
+#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_EOR 0x8 /* data completes record */
+#define MSG_TRUNC 0x10 /* data discarded before delivery */
+#define MSG_CTRUNC 0x20 /* control data lost before delivery */
+#define MSG_WAITALL 0x40 /* wait for full request or error */
+
+/*
+ * Header for ancillary data objects in msg_control buffer.
+ * Used for additional information with/about a datagram
+ * not expressible by flags. The format is a sequence
+ * of message elements headed by cmsghdr structures.
+ */
+struct cmsghdr {
+ u_int cmsg_len; /* data byte count, including hdr */
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+/* followed by u_char cmsg_data[]; */
+};
+
+/* given pointer to struct adatahdr, return pointer to data */
+#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
+
+/* given pointer to struct adatahdr, return pointer to next adatahdr */
+#define CMSG_NXTHDR(mhdr, cmsg) \
+ (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
+ (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
+ (struct cmsghdr *)NULL : \
+ (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
+
+#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
+
+/* "Socket"-level control message types: */
+#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+
+/*
+ * 4.3 compat sockaddr, move to compat file later
+ */
+struct osockaddr {
+ u_short sa_family; /* address family */
+ char sa_data[14]; /* up to 14 bytes of direct address */
+};
+
+/*
+ * 4.3-compat message header (move to compat file later).
+ */
+struct omsghdr {
+ 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;
+};
+
+#ifndef KERNEL
+
+#include <sys/cdefs.h>
+
+__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 getpeername __P_((int, struct sockaddr *, int *));
+int getsockname __P_((int, struct sockaddr *, int *));
+int getsockopt __P_((int, int, int, void *, int *));
+int listen __P_((int, int));
+/* original definitions
+int recv __P_((int, void *, int, int));
+int recvfrom __P_((int, void *, int, int,
+ struct sockaddr *, int *));
+int recvmsg __P_((int, struct msghdr *, int));
+int send __P_((int, const void *, int, int));
+int sendto __P_((int, const void *, int, int, const struct sockaddr *, int));
+int sendmsg __P_((int, const struct msghdr *, int));
+*/
+ssize_t recv __P_((int, void *, size_t, int));
+ssize_t recvfrom __P_((int, void *, size_t, int,
+ struct sockaddr *, int *));
+ssize_t recvmsg __P_((int, struct msghdr *, int));
+ssize_t send __P_((int, const void *, size_t, int));
+ssize_t sendto __P_((int, const void *, size_t, int,
+ const struct sockaddr *, int));
+ssize_t sendmsg __P_((int, const struct msghdr *, int));
+int setsockopt __P_((int, int, int, const void *, int));
+int shutdown __P_((int, int));
+int socket __P_((int, int, int));
+int socketpair __P_((int, int, int, int *));
+__END_DECLS
+
+#endif /* !KERNEL */
+
+#endif /* !_SOCKET_H_ */
diff --git a/mit-pthreads/machdep/bsdi-1.1/timers.h b/mit-pthreads/machdep/bsdi-1.1/timers.h
new file mode 100755
index 00000000000..7101ab99106
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-1.1/timers.h
@@ -0,0 +1,59 @@
+/* ==== 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/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; \
+}
+
+#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/__math.h b/mit-pthreads/machdep/bsdi-2.0/__math.h
new file mode 100755
index 00000000000..2c919472f33
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__math.h
@@ -0,0 +1,6 @@
+/*
+ * ANSI/POSIX
+ */
+/* Generate an overflow to create +Inf; the multiply shuts up gcc 1 */
+#define HUGE_VAL (1e250*1e250) /* IEEE: positive infinity */
+
diff --git a/mit-pthreads/machdep/bsdi-2.0/__path.h b/mit-pthreads/machdep/bsdi-2.0/__path.h
new file mode 100755
index 00000000000..9c347016f5f
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__path.h
@@ -0,0 +1,13 @@
+/*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * __path.h,v 1.1 1995/01/03 12:53:32 proven Exp
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/share/zoneinfo"
+#define _PATH_TZFILE "/etc/localtime"
+
+#endif /* !_SYS__PATH_H_ */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__signal.h b/mit-pthreads/machdep/bsdi-2.0/__signal.h
new file mode 100755
index 00000000000..d3deecf15e2
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__signal.h
@@ -0,0 +1,7 @@
+#include <sys/signal.h>
+
+#define __SIGEMPTYSET 0
+#define __SIGFILLSET 0xffffffff
+#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
+#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
+#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
diff --git a/mit-pthreads/machdep/bsdi-2.0/__stdio.h b/mit-pthreads/machdep/bsdi-2.0/__stdio.h
new file mode 100755
index 00000000000..d4d37c2017c
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__stdio.h
@@ -0,0 +1,7 @@
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__stdlib.h b/mit-pthreads/machdep/bsdi-2.0/__stdlib.h
new file mode 100755
index 00000000000..189bb5e8799
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__stdlib.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __stdlib.h,v 1.1 1995/01/03 12:53:34 proven Exp
+ */
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#ifdef _BSD_WCHAR_T_
+typedef _BSD_WCHAR_T_ wchar_t;
+#undef _BSD_WCHAR_T_
+#endif
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__string.h b/mit-pthreads/machdep/bsdi-2.0/__string.h
new file mode 100755
index 00000000000..275032946ea
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__string.h
@@ -0,0 +1,19 @@
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+/* Non-standard NetBSD 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 *));
+void strmode __P_((int, char *));
+char *strsep __P_((char **, const char *));
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/__time.h b/mit-pthreads/machdep/bsdi-2.0/__time.h
new file mode 100755
index 00000000000..bc4d956486d
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__time.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * __time.h,v 1.1 1994/12/13 07:18:55 proven Exp
+ */
+
+#ifndef _SYS__TIME_H_
+#define _SYS__TIME_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_CLOCK_T_
+typedef _BSD_CLOCK_T_ clock_t;
+#undef _BSD_CLOCK_T_
+#endif
+
+#ifdef _BSD_TIME_T_
+typedef _BSD_TIME_T_ time_t;
+#undef _BSD_TIME_T_
+#endif
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/bsdi-2.0/__unistd.h b/mit-pthreads/machdep/bsdi-2.0/__unistd.h
new file mode 100755
index 00000000000..4a5ee6a245e
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/__unistd.h
@@ -0,0 +1,109 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __unistd.h,v 1.1 1995/01/03 12:53:35 proven Exp
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define ioctl_request_type unsigned long /* For fd.c */
+
+/* compile-time symbolic constants */
+#define _POSIX_JOB_CONTROL /* implementation supports job control */
+
+#ifdef _NOT_AVAILABLE
+#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
+#endif
+
+#define _POSIX_VERSION 198808L
+#define _POSIX2_VERSION 199212L
+
+/* execution-time symbolic constants */
+ /* chown requires appropriate privileges */
+#define _POSIX_CHOWN_RESTRICTED 1
+ /* too-long path components generate errors */
+#define _POSIX_NO_TRUNC 1
+ /* may disable terminal special characters */
+#define _POSIX_VDISABLE ((unsigned char)'\377')
+
+/* configurable pathname variables */
+#define _PC_LINK_MAX 1
+#define _PC_MAX_CANON 2
+#define _PC_MAX_INPUT 3
+#define _PC_NAME_MAX 4
+#define _PC_PATH_MAX 5
+#define _PC_PIPE_BUF 6
+#define _PC_CHOWN_RESTRICTED 7
+#define _PC_NO_TRUNC 8
+#define _PC_VDISABLE 9
+
+/* configurable system variables */
+#define _SC_ARG_MAX 1
+#define _SC_CHILD_MAX 2
+#define _SC_CLK_TCK 3
+#define _SC_NGROUPS_MAX 4
+#define _SC_OPEN_MAX 5
+#define _SC_JOB_CONTROL 6
+#define _SC_SAVED_IDS 7
+#define _SC_VERSION 8
+#define _SC_BC_BASE_MAX 9
+#define _SC_BC_DIM_MAX 10
+#define _SC_BC_SCALE_MAX 11
+#define _SC_BC_STRING_MAX 12
+#define _SC_COLL_WEIGHTS_MAX 13
+#define _SC_EXPR_NEST_MAX 14
+#define _SC_LINE_MAX 15
+#define _SC_RE_DUP_MAX 16
+#define _SC_2_VERSION 17
+#define _SC_2_C_BIND 18
+#define _SC_2_C_DEV 19
+#define _SC_2_CHAR_TERM 20
+#define _SC_2_FORT_DEV 21
+#define _SC_2_FORT_RUN 22
+#define _SC_2_LOCALEDEF 23
+#define _SC_2_SW_DEV 24
+#define _SC_2_UPE 25
+#define _SC_STREAM_MAX 26
+#define _SC_TZNAME_MAX 27
+
+/* configurable system strings */
+#define _CS_PATH 1
+
+#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/compat.h b/mit-pthreads/machdep/bsdi-2.0/compat.h
new file mode 100755
index 00000000000..0dfdc27f9e8
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/compat.h
@@ -0,0 +1,65 @@
+/*-
+ * 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 /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+#endif /* !_DIRENT_H_ */
+
diff --git a/mit-pthreads/machdep/bsdi-2.0/dirent.h b/mit-pthreads/machdep/bsdi-2.0/dirent.h
new file mode 100755
index 00000000000..0dfdc27f9e8
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/dirent.h
@@ -0,0 +1,65 @@
+/*-
+ * 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 /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+#endif /* !_DIRENT_H_ */
+
diff --git a/mit-pthreads/machdep/bsdi-2.0/errno.h b/mit-pthreads/machdep/bsdi-2.0/errno.h
new file mode 100755
index 00000000000..1a3c37d0147
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/errno.h
@@ -0,0 +1,162 @@
+
+/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#endif
+#define EBUSY 16 /* Device busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define ETXTBSY 26 /* Text file busy */
+#endif
+#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 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define EAGAIN 35 /* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define EWOULDBLOCK EAGAIN /* 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 */
+#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 */
+
+/* ipc/network software -- 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 /* Operation timed out */
+#define ECONNREFUSED 61 /* Connection refused */
+
+#define ELOOP 62 /* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define ENAMETOOLONG 63 /* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+#endif /* _POSIX_SOURCE */
+#define ENOTEMPTY 66 /* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#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 */
+#define EBADRPC 72 /* RPC struct is bad */
+#define ERPCMISMATCH 73 /* RPC version wrong */
+#define EPROGUNAVAIL 74 /* RPC prog. not avail */
+#define EPROGMISMATCH 75 /* Program version wrong */
+#define EPROCUNAVAIL 76 /* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define ENOLCK 77 /* No locks available */
+#define ENOSYS 78 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define EFTYPE 79 /* Inappropriate file type or format */
+#define EAUTH 80 /* Authentication error */
+#define ENEEDAUTH 81 /* Need authenticator */
+#define ELAST 81 /* Must be equal largest errno */
+#endif /* _POSIX_SOURCE */
+
+#endif
+
diff --git a/mit-pthreads/machdep/bsdi-2.0/time.h b/mit-pthreads/machdep/bsdi-2.0/time.h
new file mode 100755
index 00000000000..a8bf0ff8f82
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/time.h
@@ -0,0 +1,6 @@
+#ifndef ts_sec
+#define ts_sec tv_sec
+#define ts_nsec tv_nsec
+#endif
+#include "/usr/include/sys/time.h"
+
diff --git a/mit-pthreads/machdep/bsdi-2.0/timers.h b/mit-pthreads/machdep/bsdi-2.0/timers.h
new file mode 100755
index 00000000000..b603b78e6b2
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/timers.h
@@ -0,0 +1,45 @@
+/* ==== 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.
+ *
+ * timers.h,v 1.50 1994/08/08 03:44:09 proven Exp
+ *
+ * Description : Basic timers header.
+ *
+ * 1.00 94/06/13 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_TIMERS_H_
+#define _SYS_TIMERS_H_
+
+#include <sys/time.h>
+
+#endif
diff --git a/mit-pthreads/machdep/bsdi-2.0/wait.h b/mit-pthreads/machdep/bsdi-2.0/wait.h
new file mode 100755
index 00000000000..5f7635a73a7
--- /dev/null
+++ b/mit-pthreads/machdep/bsdi-2.0/wait.h
@@ -0,0 +1,159 @@
+/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
+
+/*
+ * 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.
+ *
+ * @(#)wait.h 8.1 (Berkeley) 6/2/93
+ */
+
+/*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+/*
+ * Macros to test the exit status returned by wait
+ * and extract the relevant values.
+ */
+#ifdef _POSIX_SOURCE
+#define _W_INT(i) (i)
+#else
+#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
+#define WCOREFLAG 0200
+#endif
+
+#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
+
+/*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#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 */
+
+#include <machine/endian.h>
+
+/*
+ * Deprecated:
+ * Structure of the information in the status word returned by wait4.
+ * If w_stopval==WSTOPPED, then the second structure describes
+ * the information returned, else the first.
+ */
+union wait {
+ int w_status; /* used in syscall */
+ /*
+ * Terminated process status.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Termsig:7, /* termination signal */
+ w_Coredump:1, /* core dump indicator */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Coredump:1, /* core dump indicator */
+ w_Termsig:7; /* termination signal */
+#endif
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Stopval:8; /* == W_STOPPED if stopped */
+#endif
+ } w_S;
+};
+#define w_termsig w_T.w_Termsig
+#define w_coredump w_T.w_Coredump
+#define w_retcode w_T.w_Retcode
+#define w_stopval w_S.w_Stopval
+#define w_stopsig w_S.w_Stopsig
+
+#define WSTOPPED _WSTOPPED
+#endif /* _POSIX_SOURCE */
+
+#ifndef KERNEL
+#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 *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+__END_DECLS
+#endif
+
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.1.c b/mit-pthreads/machdep/engine-alpha-netbsd-1.1.c
new file mode 100644
index 00000000000..c1ff04db16d
--- /dev/null
+++ b/mit-pthreads/machdep/engine-alpha-netbsd-1.1.c
@@ -0,0 +1,196 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for NetBSD/Alpha 1.1(+)
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ *
+ * 95/04/22 cgd
+ * -Modified to make it go with NetBSD/Alpha
+ */
+
+#ifndef lint
+static const char rcsid[] = "engine-alpha-osf1.c,v 1.4.4.1 1995/12/13 05:41:37 proven Exp";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/syscall.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return __machdep_save_int_state(pthread_run->machdep_data.machdep_istate);
+}
+
+void machdep_restore_state(void)
+{
+ __machdep_restore_int_state(pthread_run->machdep_data.machdep_istate);
+}
+
+void machdep_save_float_state (void)
+{
+ __machdep_save_fp_state(pthread_run->machdep_data.machdep_fstate);
+}
+
+void machdep_restore_float_state (void)
+{
+ __machdep_restore_fp_state(pthread_run->machdep_data.machdep_fstate);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume ();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ /* Set up new stack frame so that it looks like it returned from a
+ longjmp() to the beginning of machdep_pthread_start(). */
+ machdep_pthread->machdep_istate[8/*ISTATE_RA*/] = 0;
+ machdep_pthread->machdep_istate[0/*ISTATE_PC*/] = (long)machdep_pthread_start;
+ machdep_pthread->machdep_istate[10/*ISTATE_PV*/] = (long)machdep_pthread_start;
+
+ /* Alpha stack starts high and builds down. */
+ {
+ long stk_addr = (long) machdep_pthread->machdep_stack;
+ stk_addr += stack_size - 1024;
+ stk_addr &= ~15;
+ machdep_pthread->machdep_istate[9/*ISTATE_SP*/] = stk_addr;
+ }
+}
+
+int safe_store (loc, new)
+ int *loc;
+ int new;
+{
+ int locked, old;
+ asm ("mb" : : : "memory");
+ do {
+ asm ("ldl_l %0,%1" : "=r" (old) : "m" (*loc));
+ asm ("stl_c %0,%1" : "=r" (locked), "=m" (*loc) : "0" (new));
+ } while (!locked);
+ asm ("mb" : : : "memory");
+ return old;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+off_t machdep_sys_lseek(int fd, off_t offset, int whence)
+{
+ extern off_t __syscall();
+
+ return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
+}
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.1.h b/mit-pthreads/machdep/engine-alpha-netbsd-1.1.h
new file mode 100644
index 00000000000..50c872da7b6
--- /dev/null
+++ b/mit-pthreads/machdep/engine-alpha-netbsd-1.1.h
@@ -0,0 +1,111 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1994 Chris Provenzano (proven@athena.mit.edu) and
+ * Ken Raeburn (raeburn@mit.edu).
+ *
+ * engine-alpha-osf1.h,v 1.4.4.1 1995/12/13 05:41:42 proven Exp
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+
+/* The first machine dependent functions are the SEMAPHORES needing
+ the test and set instruction.
+
+ On the Alpha, the actual values here are irrelevant; they just have
+ to be different. */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#if 0
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ int *_sem_lock = (lock), locked, old; \
+ asm ("mb" : : : "memory"); \
+ do { asm ("ldl_l %0,%1" : "=r" (old) : "m" (*_sem_lock)); \
+ /* ?? if (old != SEMAPHORE_CLEAR) break; */ \
+ asm ("stl_c %0,%1" : "=r" (locked), "=m" (*_sem_lock) \
+ : "0" (SEMAPHORE_SET)); \
+ } while (!locked); \
+ asm ("mb" : : : "memory"); \
+ old == SEMAPHORE_CLEAR; })
+
+#define SEMAPHORE_RESET(lock) \
+({ int *_sem_lock = (lock); \
+ *_sem_lock = SEMAPHORE_CLEAR; \
+ asm ("mb" : : : "memory"); })
+#endif
+
+/*
+ * New types
+ */
+typedef int semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ unsigned long machdep_istate[11];
+ unsigned long machdep_fstate[9];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+ { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 2048
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+int __machdep_save_int_state __P_((unsigned long *));
+void __machdep_restore_int_state __P_((unsigned long *));
+void __machdep_save_fp_state __P_((unsigned long *));
+void __machdep_restore_fp_state __P_((unsigned long *));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.3.c b/mit-pthreads/machdep/engine-alpha-netbsd-1.3.c
new file mode 100644
index 00000000000..0932c421ea2
--- /dev/null
+++ b/mit-pthreads/machdep/engine-alpha-netbsd-1.3.c
@@ -0,0 +1,204 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for NetBSD/Alpha 1.1(+)
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ *
+ * 95/04/22 cgd
+ * -Modified to make it go with NetBSD/Alpha
+ */
+
+#ifndef lint
+static const char rcsid[] = "engine-alpha-osf1.c,v 1.4.4.1 1995/12/13 05:41:37 proven Exp";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/syscall.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return __machdep_save_int_state(pthread_run->machdep_data.machdep_istate);
+}
+
+void machdep_restore_state(void)
+{
+ __machdep_restore_int_state(pthread_run->machdep_data.machdep_istate);
+}
+
+void machdep_save_float_state (void)
+{
+ __machdep_save_fp_state(pthread_run->machdep_data.machdep_fstate);
+}
+
+void machdep_restore_float_state (void)
+{
+ __machdep_restore_fp_state(pthread_run->machdep_data.machdep_fstate);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume ();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ /* Set up new stack frame so that it looks like it returned from a
+ longjmp() to the beginning of machdep_pthread_start(). */
+ machdep_pthread->machdep_istate[8/*ISTATE_RA*/] = 0;
+ machdep_pthread->machdep_istate[0/*ISTATE_PC*/] = (long)machdep_pthread_start;
+ machdep_pthread->machdep_istate[10/*ISTATE_PV*/] = (long)machdep_pthread_start;
+
+ /* Alpha stack starts high and builds down. */
+ {
+ long stk_addr = (long) machdep_pthread->machdep_stack;
+ stk_addr += stack_size - 1024;
+ stk_addr &= ~15;
+ machdep_pthread->machdep_istate[9/*ISTATE_SP*/] = stk_addr;
+ }
+}
+
+int safe_store (loc, new)
+ int *loc;
+ int new;
+{
+ int locked, old;
+ asm ("mb" : : : "memory");
+ do {
+ asm ("ldl_l %0,%1" : "=r" (old) : "m" (*loc));
+ asm ("stl_c %0,%1" : "=r" (locked), "=m" (*loc) : "0" (new));
+ } while (!locked);
+ asm ("mb" : : : "memory");
+ return old;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+off_t machdep_sys_lseek(int fd, off_t offset, int whence)
+{
+ extern off_t __syscall();
+
+ return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
diff --git a/mit-pthreads/machdep/engine-alpha-netbsd-1.3.h b/mit-pthreads/machdep/engine-alpha-netbsd-1.3.h
new file mode 100644
index 00000000000..bc4178d3c41
--- /dev/null
+++ b/mit-pthreads/machdep/engine-alpha-netbsd-1.3.h
@@ -0,0 +1,114 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1994 Chris Provenzano (proven@athena.mit.edu) and
+ * Ken Raeburn (raeburn@mit.edu).
+ *
+ * engine-alpha-osf1.h,v 1.4.4.1 1995/12/13 05:41:42 proven Exp
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+#include <sys/signal.h> /* for _NSIG */
+
+/* The first machine dependent functions are the SEMAPHORES needing
+ the test and set instruction.
+
+ On the Alpha, the actual values here are irrelevant; they just have
+ to be different. */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#if 0
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ int *_sem_lock = (lock), locked, old; \
+ asm ("mb" : : : "memory"); \
+ do { asm ("ldl_l %0,%1" : "=r" (old) : "m" (*_sem_lock)); \
+ /* ?? if (old != SEMAPHORE_CLEAR) break; */ \
+ asm ("stl_c %0,%1" : "=r" (locked), "=m" (*_sem_lock) \
+ : "0" (SEMAPHORE_SET)); \
+ } while (!locked); \
+ asm ("mb" : : : "memory"); \
+ old == SEMAPHORE_CLEAR; })
+
+#define SEMAPHORE_RESET(lock) \
+({ int *_sem_lock = (lock); \
+ *_sem_lock = SEMAPHORE_CLEAR; \
+ asm ("mb" : : : "memory"); })
+#endif
+
+/*
+ * New types
+ */
+typedef int semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX (_NSIG-1)
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ unsigned long machdep_istate[11];
+ unsigned long machdep_fstate[9];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+ { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 2048
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+int __machdep_save_int_state __P_((unsigned long *));
+void __machdep_restore_int_state __P_((unsigned long *));
+void __machdep_save_fp_state __P_((unsigned long *));
+void __machdep_restore_fp_state __P_((unsigned long *));
+
+extern off_t machdep_sys_lseek(int, off_t, int);
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-alpha-osf1.c b/mit-pthreads/machdep/engine-alpha-osf1.c
new file mode 100644
index 00000000000..9b563a56c28
--- /dev/null
+++ b/mit-pthreads/machdep/engine-alpha-osf1.c
@@ -0,0 +1,207 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for SunOS-4.1.3 on sparc
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <stdlib.h>
+
+/* These would be defined in setjmp.h, if _POSIX_SOURCE and _XOPEN_SOURCE
+ were both undefined. But we've already included it, and lost the
+ opportunity. */
+#define JB_PC 2
+#define JB_RA 30
+#define JB_PV 31
+#define JB_SP 34
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return setjmp (pthread_run->machdep_data.machdep_state);
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+extern void machdep_restore_from_setjmp (jmp_buf, long);
+void machdep_restore_state(void)
+{
+ machdep_restore_from_setjmp (pthread_run->machdep_data.machdep_state, 1);
+}
+
+void machdep_save_float_state (void) { }
+void machdep_restore_float_state (void) { }
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume ();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ setjmp(machdep_pthread->machdep_state);
+
+ /* Set up new stack frame so that it looks like it returned from a
+ longjmp() to the beginning of machdep_pthread_start(). */
+ machdep_pthread->machdep_state[JB_RA] = 0;
+ machdep_pthread->machdep_state[JB_PC] = (long)machdep_pthread_start;
+ machdep_pthread->machdep_state[JB_PV] = (long)machdep_pthread_start;
+
+ /* Alpha stack starts high and builds down. */
+ {
+ long stk_addr = (long) machdep_pthread->machdep_stack;
+ stk_addr += stack_size - 1024;
+ stk_addr &= ~15;
+ machdep_pthread->machdep_state[JB_SP] = stk_addr;
+ }
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int pid, int * statusp, int options)
+{
+ return machdep_sys_wait4 (pid, statusp, options, NULL);
+}
+
+/* These are found in flsbuf.o in the Alpha libc. I don't know what
+ they're for, precisely. */
+static xxx;
+_bufsync (p)
+ char *p;
+{
+ long a1 = *(long *)(p+48);
+ long t0 = *(long *)(p+8);
+ long v0 = a1 - t0;
+ long t1, t2;
+
+ abort ();
+
+ v0 += xxx;
+ if (v0 < 0)
+ {
+ *(char**)(p + 8) = p;
+ return v0;
+ }
+ t1 = *(int*)p;
+ t2 = v0 - t1;
+ if (t2 < 0)
+ *(int*)p = (int) v0;
+ return v0;
+}
+
+_findbuf () { abort (); }
+_wrtchk () { abort (); }
+_xflsbuf () { abort (); }
+_flsbuf () { abort (); }
+
+void __xxx_never_called () {
+ /* Force other stuff to get dragged in. */
+ _cleanup ();
+ fflush (NULL);
+ fclose (NULL);
+}
+
+int safe_store (loc, new)
+ int *loc;
+ int new;
+{
+ int locked, old;
+ asm ("mb" : : : "memory");
+ do {
+ asm ("ldl_l %0,%1" : "=r" (old) : "m" (*loc));
+ asm ("stl_c %0,%1" : "=r" (locked), "=m" (*loc) : "0" (new));
+ } while (!locked);
+ asm ("mb" : : : "memory");
+ return old;
+}
diff --git a/mit-pthreads/machdep/engine-alpha-osf1.h b/mit-pthreads/machdep/engine-alpha-osf1.h
new file mode 100644
index 00000000000..fdf374ccc44
--- /dev/null
+++ b/mit-pthreads/machdep/engine-alpha-osf1.h
@@ -0,0 +1,110 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1994 Chris Provenzano (proven@athena.mit.edu) and
+ * Ken Raeburn (raeburn@mit.edu).
+ *
+ * $Id$
+ *
+ */
+
+#ifndef sigwait
+#define sigwait __bogus_osf1_sigwait
+#endif
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+
+#undef sigwait
+
+/* The first machine dependent functions are the SEMAPHORES needing
+ the test and set instruction.
+
+ On the Alpha, the actual values here are irrelevant; they just have
+ to be different. */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#if 0
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ int *_sem_lock = (lock), locked, old; \
+ asm ("mb" : : : "memory"); \
+ do { asm ("ldl_l %0,%1" : "=r" (old) : "m" (*_sem_lock)); \
+ /* ?? if (old != SEMAPHORE_CLEAR) break; */ \
+ asm ("stl_c %0,%1" : "=r" (locked), "=m" (*_sem_lock) \
+ : "0" (SEMAPHORE_SET)); \
+ } while (!locked); \
+ asm ("mb" : : : "memory"); \
+ old == SEMAPHORE_CLEAR; })
+
+#define SEMAPHORE_RESET(lock) \
+({ int *_sem_lock = (lock); \
+ *_sem_lock = SEMAPHORE_CLEAR; \
+ asm ("mb" : : : "memory"); })
+#endif
+
+/*
+ * New types
+ */
+typedef int semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+ { NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 2048
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-arm32-netbsd-1.3.c b/mit-pthreads/machdep/engine-arm32-netbsd-1.3.c
new file mode 100644
index 00000000000..510b35fdb0e
--- /dev/null
+++ b/mit-pthreads/machdep/engine-arm32-netbsd-1.3.c
@@ -0,0 +1,203 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for NetBSD on arm32
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ *
+ * 98/10/22 bad
+ * -adapt from i386 version
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/syscall.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+#if defined(_JB_REG_R13)
+#define REG_LR _JB_REG_R14
+#define REG_SP _JB_REG_R13
+#else
+#define REG_LR JMPBUF_REG_R14
+#define REG_SP JMPBUF_REG_R13
+#endif
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[REG_LR] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[REG_SP] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
diff --git a/mit-pthreads/machdep/engine-arm32-netbsd-1.3.h b/mit-pthreads/machdep/engine-arm32-netbsd-1.3.h
new file mode 100644
index 00000000000..c8a4e79386a
--- /dev/null
+++ b/mit-pthreads/machdep/engine-arm32-netbsd-1.3.h
@@ -0,0 +1,102 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Id: engine-i386-netbsd-1.3.h,v 1.1 1998/02/28 04:53:15 cjs Exp
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/signal.h> /* for _NSIG */
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#if 0
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+#endif
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX (_NSIG-1)
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+#if 0
+ char machdep_float_state[108];
+#endif
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-10.20.c b/mit-pthreads/machdep/engine-hppa-hpux-10.20.c
new file mode 100644
index 00000000000..f6f0b2e0f1d
--- /dev/null
+++ b/mit-pthreads/machdep/engine-hppa-hpux-10.20.c
@@ -0,0 +1,169 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for HP-UX 9.03 on hppa
+ *
+ * 1.00 93/12/14 proven
+ * -Started coding this file.
+ */
+
+#include <pthread.h>
+#include <setjmp.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+volatile int setupStack = 0;
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_save_float_state()
+ */
+void machdep_save_float_state(struct pthread * pthread)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+void machdep_restore_float_state()
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(jmp_buf j)
+{
+ setjmp(j);
+ if( setupStack )
+ return;
+
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ jmp_buf tmp_jmp_buf;
+
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ /*
+ * Set up new stack frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ setjmp(machdep_pthread->machdep_state);
+
+ /* get the stack frame from the real machdep_pthread_start */
+ setupStack = 1;
+/* machdep_pthread_start(machdep_pthread->machdep_state); */
+ machdep_pthread_start(tmp_jmp_buf);
+ setupStack = 0;
+
+ /* copy over the interesting part of the frame */
+ ((int *)machdep_pthread->machdep_state)[44] = ((int *)tmp_jmp_buf)[44];
+
+ /* Stack starts low and builds up, but needs two start frames */
+ ((int *)machdep_pthread->machdep_state)[1] =
+ (int)machdep_pthread->machdep_stack + (64 * 2);
+}
+
+int machdep_sys_getdtablesize()
+{
+ return sysconf(_SC_OPEN_MAX);
+}
+
+void sig_check_and_resume()
+{
+ return;
+}
+
+void ___exit(int status)
+{
+ exit(status);
+ PANIC();
+}
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-10.20.h b/mit-pthreads/machdep/engine-hppa-hpux-10.20.h
new file mode 100644
index 00000000000..9cbe3349a3d
--- /dev/null
+++ b/mit-pthreads/machdep/engine-hppa-hpux-10.20.h
@@ -0,0 +1,143 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * Stuff for compiling
+ */
+#if defined(__GNUC__)
+#if defined(__cplusplus)
+#define __BEGIN_DECLS extern "C" {
+#define __END_DECLS };
+#else
+#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 __BEGIN_DECLS
+#define __END_DECLS
+#if !defined(__STDC__)
+#define const
+#endif
+#define inline
+#define signed
+#define volatile
+#endif
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ *
+ * Note: The set and clear defines are backwards.
+ */
+#define SEMAPHORE_CLEAR { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
+#define SEMAPHORE_SET 0
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long real_addr; \
+long temp; \
+ \
+real_addr = ((long)((*lock) + 15) & ~15); \
+ \
+__asm__ volatile("ldcwx %%r0(%2),%0" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (real_addr)); \
+temp ? 0 : 1; \
+})
+
+#define SEMAPHORE_RESET(lock) \
+({ \
+char *real_addr; \
+ \
+real_addr = (char*)((long)((*lock) + 15) & ~15); \
+*real_addr = 0xff; \
+})
+
+/*
+ * New types
+ * The semaphore is really 16 bytes but must be aligened on a 16 byte
+ * boundary. By specifing 31 bytes the macros can frob it correctly.
+ */
+typedef char semaphore[31];
+
+/*
+ * Macros for sigset_t
+ */
+#define SIGMAX 30
+/* see hpux-9.03/__signal.h for SIG_ANY */
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ /* long machdep_state[_JBLEN]; */
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 4096
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * page size
+ */
+#define getpagesize() 4096
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-9.03.c b/mit-pthreads/machdep/engine-hppa-hpux-9.03.c
new file mode 100644
index 00000000000..3770a2e106a
--- /dev/null
+++ b/mit-pthreads/machdep/engine-hppa-hpux-9.03.c
@@ -0,0 +1,153 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for HP-UX 9.03 on hppa
+ *
+ * 1.00 93/12/14 proven
+ * -Started coding this file.
+ */
+
+#include <pthread.h>
+#include <setjmp.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_save_float_state()
+ */
+void machdep_save_float_state(struct pthread * pthread)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+void machdep_restore_float_state()
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ ((int *)machdep_pthread->machdep_state)[0] = (int)machdep_pthread_start;
+
+ /* Stack starts low and builds up, but needs two start frames */
+ ((int *)machdep_pthread->machdep_state)[1] =
+ (int)machdep_pthread->machdep_stack + (64 * 2);
+}
+
+int machdep_sys_getdtablesize()
+{
+ return sysconf(_SC_OPEN_MAX);
+}
+
+void sig_check_and_resume()
+{
+ return;
+}
+
+void ___exit(int status)
+{
+ exit(status);
+ PANIC();
+}
diff --git a/mit-pthreads/machdep/engine-hppa-hpux-9.03.h b/mit-pthreads/machdep/engine-hppa-hpux-9.03.h
new file mode 100644
index 00000000000..7c599400e3e
--- /dev/null
+++ b/mit-pthreads/machdep/engine-hppa-hpux-9.03.h
@@ -0,0 +1,141 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * Stuff for compiling
+ */
+#if defined(__GNUC__)
+#if defined(__cplusplus)
+#define __BEGIN_DECLS extern "C" {
+#define __END_DECLS };
+#else
+#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 __BEGIN_DECLS
+#define __END_DECLS
+#define const
+#define inline
+#define signed
+#define volatile
+#endif
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ *
+ * Note: The set and clear defines are backwards.
+ */
+#define SEMAPHORE_CLEAR { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
+#define SEMAPHORE_SET 0
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long real_addr; \
+long temp; \
+ \
+real_addr = ((long)((*lock) + 15) & ~15); \
+ \
+__asm__ volatile("ldcwx %%r0(%2),%0" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (real_addr)); \
+temp ? 0 : 1; \
+})
+
+#define SEMAPHORE_RESET(lock) \
+({ \
+char *real_addr; \
+ \
+real_addr = (char*)((long)((*lock) + 15) & ~15); \
+*real_addr = 0xff; \
+})
+
+/*
+ * New types
+ * The semaphore is really 16 bytes but must be aligened on a 16 byte
+ * boundary. By specifing 31 bytes the macros can frob it correctly.
+ */
+typedef char semaphore[31];
+
+/*
+ * Macros for sigset_t
+ */
+#define SIGMAX 30
+/* see hpux-9.03/__signal.h for SIG_ANY */
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ /* long machdep_state[_JBLEN]; */
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 4096
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * page size
+ */
+#define getpagesize() 4096
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-1.1.c b/mit-pthreads/machdep/engine-i386-bsdi-1.1.c
new file mode 100644
index 00000000000..da78bef393e
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-bsdi-1.1.c
@@ -0,0 +1,180 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ sig_check_and_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * machdep_pthread_create()
+ */
+void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument, long stack_size,
+ void *stack_start, long nsec)
+{
+ machdep_pthread->machdep_stack = stack_start;
+
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_send()
+ */
+machdep_sys_send(int s, const void *buf, int len, int flags)
+{
+ return(machdep_sys_sendto(s, buf, len, flags, (struct sockaddr*)NULL, 0));
+}
+
+/* ==========================================================================
+ * machdep_sys_recv()
+ */
+machdep_sys_recv(int s, void *buf, int len, int flags)
+{
+ return(machdep_sys_recvfrom(s, buf, len, flags, (struct sockaddr*)NULL, 0));
+}
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-1.1.h b/mit-pthreads/machdep/engine-i386-bsdi-1.1.h
new file mode 100644
index 00000000000..7f7b8a62d06
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-bsdi-1.1.h
@@ -0,0 +1,84 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
+
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-2.0.c b/mit-pthreads/machdep/engine-i386-bsdi-2.0.c
new file mode 100644
index 00000000000..63a6de1b092
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-bsdi-2.0.c
@@ -0,0 +1,210 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
diff --git a/mit-pthreads/machdep/engine-i386-bsdi-2.0.h b/mit-pthreads/machdep/engine-i386-bsdi-2.0.h
new file mode 100644
index 00000000000..3be254b4090
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-bsdi-2.0.h
@@ -0,0 +1,98 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * engine-i386-netbsd-1.0.h,v 1.53 1994/12/13 07:17:23 proven Exp
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK (O_NONBLOCK|O_NDELAY)
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
+
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-1.1.c b/mit-pthreads/machdep/engine-i386-freebsd-1.1.c
new file mode 100644
index 00000000000..422193e77e3
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-freebsd-1.1.c
@@ -0,0 +1,179 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ sig_check_and_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * machdep_pthread_create()
+ */
+void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument, long stack_size,
+ void *stack_start, long nsec)
+{
+ machdep_pthread->machdep_stack = stack_start;
+
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_send()
+ */
+machdep_sys_send(int s, const void *buf, int len, int flags)
+{
+ return(machdep_sys_sendto(s, buf, len, flags, NULL, 0));
+}
+
+/* ==========================================================================
+ * machdep_sys_recv()
+ */
+machdep_sys_recv(int s, void *buf, int len, int flags)
+{
+ return(machdep_sys_recvfrom(s, buf, len, flags, NULL, 0));
+}
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-1.1.h b/mit-pthreads/machdep/engine-i386-freebsd-1.1.h
new file mode 100644
index 00000000000..0e8e93bdbfb
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-freebsd-1.1.h
@@ -0,0 +1,83 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-2.0.c b/mit-pthreads/machdep/engine-i386-freebsd-2.0.c
new file mode 100644
index 00000000000..3b6b8f31ae0
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-freebsd-2.0.c
@@ -0,0 +1,208 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1995 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "engine-i386-freebsd-2.0.c,v 1.1 1995/03/01 01:21:20 proven Exp";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(machdep_sys_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ machdep_sys_longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ machdep_sys_setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state->_jb[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state->_jb[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
diff --git a/mit-pthreads/machdep/engine-i386-freebsd-2.0.h b/mit-pthreads/machdep/engine-i386-freebsd-2.0.h
new file mode 100644
index 00000000000..87ef21389ce
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-freebsd-2.0.h
@@ -0,0 +1,97 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-linux-1.0.c b/mit-pthreads/machdep/engine-i386-linux-1.0.c
new file mode 100644
index 00000000000..fac044fe47c
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-linux-1.0.c
@@ -0,0 +1,503 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for Linux-1.0 on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/uio.h>
+#include <sys/types.h>
+#include <sys/param.h> /* for OPEN_MAX */
+#include <sys/socket.h>
+#include <sys/socketcall.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_save_float_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flag)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state->__pc = (char *)machdep_pthread_start;
+ machdep_pthread->machdep_state->__bp = (char *)0;/* So the backtrace
+ * is sensible (mevans) *
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state->__sp =
+ (char *)machdep_pthread->machdep_stack + stack_size;
+}
+
+
+/* ==========================================================================
+ * Linux Socket calls are a bit different
+ * ==========================================================================
+ * machdep_sys_socket()
+ */
+int machdep_sys_socket(int a, int b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_SOCKET, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_accept()
+ */
+int machdep_sys_accept(int a, struct sockaddr * b, int * c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_ACCEPT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_bind()
+ */
+int machdep_sys_bind(int a, const struct sockaddr * b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_BIND, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_connect()
+ */
+int machdep_sys_connect(int a, const struct sockaddr * b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_CONNECT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_listen()
+ */
+int machdep_sys_listen(int a, const struct sockaddr * b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_LISTEN, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_shutdown()
+ */
+int machdep_sys_shutdown(int a, int b)
+{
+ int array[2];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+
+ return(machdep_sys_socketcall(SYS_SHUTDOWN, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_getsockopt()
+ */
+int machdep_sys_getsockopt(int a, int b, int c, char *d, int *e)
+{
+ int array[5];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+
+ return(machdep_sys_socketcall(SYS_GETSOCKOPT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_setsockopt()
+ */
+int machdep_sys_setsockopt(int a, int b, int c, char *d, int e)
+{
+ int array[5];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+
+ return(machdep_sys_socketcall(SYS_SETSOCKOPT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_getpeername()
+ */
+int machdep_sys_getpeername(int a, struct sockaddr *b, int *c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_GETPEERNAME, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_send()
+ */
+int machdep_sys_send(int a, char *b, int c, int d)
+{
+ int array[4];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+
+ return(machdep_sys_socketcall(SYS_SEND, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_sendto()
+ */
+int machdep_sys_sendto(int a, char *b, int c, int d,
+ struct sockaddr *e, int f)
+{
+ int array[6];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+ array[5] = (int)f;
+
+ return(machdep_sys_socketcall(SYS_SENDTO, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_recv()
+ */
+int machdep_sys_recv(int a, char *b, int c, int d)
+{
+ int array[4];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+
+ return(machdep_sys_socketcall(SYS_RECV, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_recvfrom()
+ */
+int machdep_sys_recvfrom(int a, char *b, int c, int d,
+ struct sockaddr *e, int *f)
+{
+ int array[6];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+ array[5] = (int)f;
+
+ return(machdep_sys_socketcall(SYS_RECVFROM, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_socketpair()
+ */
+int machdep_sys_socketpair(int a, int b, int c, int d[2])
+{
+ int array[4];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+
+ return(machdep_sys_socketcall(SYS_SOCKETPAIR, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_getsockname()
+ */
+int machdep_sys_getsockname(int a, char * b, int * c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_GETSOCKNAME, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_sendmsg()
+ */
+int machdep_sys_sendmsg(int a, char * b, int c)
+{
+#ifdef SYS_SENDMSG
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_SENDMSG, array));
+#else
+ return(-ENOSYS);
+#endif
+}
+
+/* ==========================================================================
+ * machdep_sys_recvmsg()
+ */
+int machdep_sys_recvmsg(int a, char * b, int c)
+{
+#ifdef SYS_RECVMSG
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_RECVMSG, array));
+#else
+ return(-ENOSYS);
+#endif
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ int ret;
+
+ if ((ret = machdep_sys_readdir(fd, buf, 1)) > 0) {
+ return(1);
+ }
+ return(ret);
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* getdtablesize */
+machdep_sys_getdtablesize ()
+{
+ return OPEN_MAX;
+}
+
+struct stat;
+
+/* ==========================================================================
+ * _fxstat()
+ */
+int _fxstat(int __ver, int fd, struct stat *buf)
+{
+ int ret;
+
+ if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
+ ret = machdep_sys_fstat(fd_table[fd]->fd.i, buf);
+ fd_unlock(fd, FD_READ);
+ }
+ return(ret);
+}
+
+/* ==========================================================================
+ * _lxstat()
+ */
+int _lxstat(int __ver, const char * path, struct stat * buf)
+{
+ int ret;
+
+ if ((ret = machdep_sys_lstat(path, buf)) < OK) {
+ SET_ERRNO(-ret);
+ }
+ return(ret);
+
+}
+
+/* ==========================================================================
+ * _xstat()
+ */
+int _xstat(int __ver, const char * path, struct stat * buf)
+{
+ int ret;
+
+ if ((ret = machdep_sys_stat(path, buf)) < OK) {
+ SET_ERRNO(-ret);
+ }
+ return(ret);
+
+}
+
+/* ==========================================================================
+ * strtol()
+ */
+__strtol_internal(char * a, char ** b, int c)
+{
+ return(strtol(a, b, c));
+}
+
+
diff --git a/mit-pthreads/machdep/engine-i386-linux-1.0.h b/mit-pthreads/machdep/engine-i386-linux-1.0.h
new file mode 100644
index 00000000000..721618a6f19
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-linux-1.0.h
@@ -0,0 +1,98 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ */
+
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+volatile long temp = SEMAPHORE_SET; \
+ \
+__asm__("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-linux-2.0.c b/mit-pthreads/machdep/engine-i386-linux-2.0.c
new file mode 100644
index 00000000000..72c757fe08a
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-linux-2.0.c
@@ -0,0 +1,504 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for Linux-1.0 on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/uio.h>
+#include <sys/types.h>
+#include <sys/param.h> /* for OPEN_MAX */
+#include <sys/socket.h>
+#include <sys/socketcall.h>
+#include <linux/net.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_save_float_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flag)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state->__jmpbuf[JB_PC]= (int) (char *)machdep_pthread_start;
+ /* Fix so that the backtrace * is sensible (mevans) */
+ machdep_pthread->machdep_state->__jmpbuf[JB_BP] = (int) (char *) 0;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state->__jmpbuf[JB_SP]=
+ (int) (char *) machdep_pthread->machdep_stack + stack_size;
+}
+
+
+/* ==========================================================================
+ * Linux Socket calls are a bit different
+ * ==========================================================================
+ * machdep_sys_socket()
+ */
+int machdep_sys_socket(int a, int b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_SOCKET, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_accept()
+ */
+int machdep_sys_accept(int a, struct sockaddr * b, int * c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_ACCEPT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_bind()
+ */
+int machdep_sys_bind(int a, const struct sockaddr * b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_BIND, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_connect()
+ */
+int machdep_sys_connect(int a, const struct sockaddr * b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_CONNECT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_listen()
+ */
+int machdep_sys_listen(int a, const struct sockaddr * b, int c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_LISTEN, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_shutdown()
+ */
+int machdep_sys_shutdown(int a, int b)
+{
+ int array[2];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+
+ return(machdep_sys_socketcall(SYS_SHUTDOWN, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_getsockopt()
+ */
+int machdep_sys_getsockopt(int a, int b, int c, char *d, int *e)
+{
+ int array[5];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+
+ return(machdep_sys_socketcall(SYS_GETSOCKOPT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_setsockopt()
+ */
+int machdep_sys_setsockopt(int a, int b, int c, char *d, int e)
+{
+ int array[5];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+
+ return(machdep_sys_socketcall(SYS_SETSOCKOPT, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_getpeername()
+ */
+int machdep_sys_getpeername(int a, struct sockaddr *b, int *c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_GETPEERNAME, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_send()
+ */
+int machdep_sys_send(int a, char *b, int c, int d)
+{
+ int array[4];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+
+ return(machdep_sys_socketcall(SYS_SEND, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_sendto()
+ */
+int machdep_sys_sendto(int a, char *b, int c, int d,
+ struct sockaddr *e, int f)
+{
+ int array[6];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+ array[5] = (int)f;
+
+ return(machdep_sys_socketcall(SYS_SENDTO, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_recv()
+ */
+int machdep_sys_recv(int a, char *b, int c, int d)
+{
+ int array[4];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+
+ return(machdep_sys_socketcall(SYS_RECV, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_recvfrom()
+ */
+int machdep_sys_recvfrom(int a, char *b, int c, int d,
+ struct sockaddr *e, int *f)
+{
+ int array[6];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+ array[4] = (int)e;
+ array[5] = (int)f;
+
+ return(machdep_sys_socketcall(SYS_RECVFROM, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_socketpair()
+ */
+int machdep_sys_socketpair(int a, int b, int c, int d[2])
+{
+ int array[4];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+ array[3] = (int)d;
+
+ return(machdep_sys_socketcall(SYS_SOCKETPAIR, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_getsockname()
+ */
+int machdep_sys_getsockname(int a, char * b, int * c)
+{
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_GETSOCKNAME, array));
+}
+
+/* ==========================================================================
+ * machdep_sys_sendmsg()
+ */
+int machdep_sys_sendmsg(int a, char * b, int c)
+{
+#ifdef SYS_SENDMSG
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_SENDMSG, array));
+#else
+ return(-ENOSYS);
+#endif
+}
+
+/* ==========================================================================
+ * machdep_sys_recvmsg()
+ */
+int machdep_sys_recvmsg(int a, char * b, int c)
+{
+#ifdef SYS_RECVMSG
+ int array[3];
+
+ array[0] = (int)a;
+ array[1] = (int)b;
+ array[2] = (int)c;
+
+ return(machdep_sys_socketcall(SYS_RECVMSG, array));
+#else
+ return(-ENOSYS);
+#endif
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ int ret;
+
+ if ((ret = machdep_sys_readdir(fd, buf, 1)) > 0) {
+ return(1);
+ }
+ return(ret);
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* getdtablesize */
+machdep_sys_getdtablesize ()
+{
+ return OPEN_MAX;
+}
+
+struct stat;
+
+/* ==========================================================================
+ * _fxstat()
+ */
+int _fxstat(int __ver, int fd, struct stat *buf)
+{
+ int ret;
+
+ if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
+ ret = machdep_sys_fstat(fd_table[fd]->fd.i, buf);
+ fd_unlock(fd, FD_READ);
+ }
+ return(ret);
+}
+
+/* ==========================================================================
+ * _lxstat()
+ */
+int _lxstat(int __ver, const char * path, struct stat * buf)
+{
+ int ret;
+
+ if ((ret = machdep_sys_lstat(path, buf)) < OK) {
+ SET_ERRNO(-ret);
+ }
+ return(ret);
+
+}
+
+/* ==========================================================================
+ * _xstat()
+ */
+int _xstat(int __ver, const char * path, struct stat * buf)
+{
+ int ret;
+
+ if ((ret = machdep_sys_stat(path, buf)) < OK) {
+ SET_ERRNO(-ret);
+ }
+ return(ret);
+
+}
+
+/* ==========================================================================
+ * strtol()
+ */
+__strtol_internal(char * a, char ** b, int c)
+{
+ return(strtol(a, b, c));
+}
+
+
diff --git a/mit-pthreads/machdep/engine-i386-linux-2.0.h b/mit-pthreads/machdep/engine-i386-linux-2.0.h
new file mode 100644
index 00000000000..721618a6f19
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-linux-2.0.h
@@ -0,0 +1,98 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ */
+
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+volatile long temp = SEMAPHORE_SET; \
+ \
+__asm__("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-0.9.c b/mit-pthreads/machdep/engine-i386-netbsd-0.9.c
new file mode 100644
index 00000000000..c42363fdeda
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-netbsd-0.9.c
@@ -0,0 +1,155 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ sig_check_and_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * machdep_pthread_create()
+ */
+void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument, long stack_size,
+ void *stack_start, long nsec)
+{
+ machdep_pthread->machdep_stack = stack_start;
+
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_send()
+ */
+machdep_sys_send(int s, const void *buf, int len, int flags)
+{
+ return(machdep_sys_sendto(s, buf, len, flags, (struct sockaddr*)NULL, 0));
+}
+
+/* ==========================================================================
+ * machdep_sys_recv()
+ */
+machdep_sys_recv(int s, void *buf, int len, int flags)
+{
+ return(machdep_sys_recvfrom(s, buf, len, flags, (struct sockaddr*)NULL, 0));
+}
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-0.9.h b/mit-pthreads/machdep/engine-i386-netbsd-0.9.h
new file mode 100644
index 00000000000..0e8e93bdbfb
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-netbsd-0.9.h
@@ -0,0 +1,83 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.0.c b/mit-pthreads/machdep/engine-i386-netbsd-1.0.c
new file mode 100644
index 00000000000..7f31cb0305d
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-netbsd-1.0.c
@@ -0,0 +1,218 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.0.h b/mit-pthreads/machdep/engine-i386-netbsd-1.0.h
new file mode 100644
index 00000000000..80e17fef368
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-netbsd-1.0.h
@@ -0,0 +1,97 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.3.c b/mit-pthreads/machdep/engine-i386-netbsd-1.3.c
new file mode 100644
index 00000000000..f86a9e5ba56
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-netbsd-1.3.c
@@ -0,0 +1,225 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
diff --git a/mit-pthreads/machdep/engine-i386-netbsd-1.3.h b/mit-pthreads/machdep/engine-i386-netbsd-1.3.h
new file mode 100644
index 00000000000..f399c4b34b6
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-netbsd-1.3.h
@@ -0,0 +1,98 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/signal.h> /* for _NSIG */
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX (_NSIG-1)
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-openbsd-2.0.c b/mit-pthreads/machdep/engine-i386-openbsd-2.0.c
new file mode 100644
index 00000000000..09ff0072fdc
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-openbsd-2.0.c
@@ -0,0 +1,215 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1995 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "engine-i386-freebsd-2.0.c,v 1.1 1995/03/01 01:21:20 proven Exp";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(machdep_sys_setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ machdep_sys_longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ machdep_sys_setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[0] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+machdep_sys_creat(char * path, int mode)
+{
+ return(machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
diff --git a/mit-pthreads/machdep/engine-i386-openbsd-2.0.h b/mit-pthreads/machdep/engine-i386-openbsd-2.0.h
new file mode 100644
index 00000000000..87ef21389ce
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-openbsd-2.0.h
@@ -0,0 +1,97 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-i386-sco-3.2v5.c b/mit-pthreads/machdep/engine-i386-sco-3.2v5.c
new file mode 100755
index 00000000000..95f0d757585
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-sco-3.2v5.c
@@ -0,0 +1,1072 @@
+
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1995 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.
+ *
+ * Description : Machine dependent functions for SCO3.2v5 on i386
+ *
+ * 1.00 96/11/21 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "engine-i386-freebsd-2.0.c,v 1.1 1995/03/01 01:21:20 proven Exp";
+#endif
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/timeb.h>
+#include <sys/stat.h>
+#include <stropts.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <errno.h>
+#include <sys/unistd.h>
+#include <sys/utsname.h>
+#include <sys/sysi86.h>
+
+void machdep_sys_abort(char*fname,int lineno)
+
+{
+ char buf[128];
+
+ sprintf(buf,"panic: %s => %d\n", fname, lineno);
+ machdep_sys_write(1, buf, strlen(buf));
+ abort();
+}
+
+#if 0
+int setitimer(int which, struct itimerval* value, struct itimerval* ovalue)
+
+{
+ register int ret;
+ if ((ret = machdep_sys_setitimer(which,value,ovalue))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+#endif
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = (char *)pthread->machdep_data.machdep_float_state;
+ __asm__ ("fsave %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+int machdep_restore_float_state(void)
+{
+ char * fdata = (char *)pthread_run->machdep_data.machdep_float_state;
+ __asm__ ("frstor %0"::"m" (*fdata));
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (machdep_sys_setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+ int ret;
+
+ if (machdep_pthread) {
+ ret = machdep_sys_setitimer(ITIMER_VIRTUAL, &zeroval,
+ &(machdep_pthread->machdep_timer));
+ } else {
+ ret = machdep_sys_setitimer(ITIMER_VIRTUAL, &zeroval, NULL);
+ }
+
+ if (ret) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[JB_PC] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[JB_SP] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+#if 0
+ return(machdep_sys_wait4(0, b, c, d));
+#else
+ return -ENOSYS;
+#endif
+}
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+machdep_sys_fstat(int f, struct stat* b)
+{
+ return machdep_sys_fxstat(0x33, f, b);
+}
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+machdep_sys_dup2(int a, int b)
+{
+ machdep_sys_close(b);
+ return machdep_sys_fcntl(a, F_DUPFD, b);
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+
+{
+ register int ret;
+ if ((ret = machdep_sys_sysconf(_SC_OPEN_MAX))<0)
+ PANIC();
+ return ret;
+}
+
+/* ==========================================================================
+ * machdep_sys_fchown()
+ */
+machdep_sys_fchown(int fd,uid_t owner,gid_t group)
+
+{
+ return -ENOSYS;
+}
+
+/* ==========================================================================
+ * machdep_sys_fchmod()
+ */
+machdep_sys_fchmod(int fd,mode_t mode)
+
+{
+ return -ENOSYS;
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
+
+/* ==========================================================================
+ * SCO Socket calls are a bit different
+ * ==========================================================================
+ * machdep_sys_socket()
+ */
+int machdep_sys_socket(int domain, int type, int protocol)
+{
+ register int s, fd, ret;
+ struct socksysreq req;
+
+ if ((s = machdep_sys_open("/dev/socksys", 0))<0)
+ return s;
+
+ req.args[0] = SO_SOCKET;
+ req.args[1] = (int)domain;
+ req.args[2] = (int)type;
+ req.args[3] = (int)protocol;
+ if ((fd = machdep_sys_ioctl(s, SIOCSOCKSYS, &req))<0) {
+ machdep_sys_close(s);
+ return fd;
+ }
+
+ if ((ret=machdep_sys_dup2(fd, s))<0) {
+ machdep_sys_close(fd);
+ return ret;
+ }
+
+ machdep_sys_close(fd);
+ return s;
+
+}
+
+/* ==========================================================================
+ * machdep_sys_accept()
+ */
+int machdep_sys_accept(int s, struct sockaddr * b, int * c)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_ACCEPT;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_bind()
+ */
+int machdep_sys_bind(int s, const struct sockaddr * b, int c)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_BIND;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_connect()
+ */
+int machdep_sys_connect(int s, const struct sockaddr * b, int c)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_CONNECT;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_listen()
+ */
+int machdep_sys_listen(int s, int backlog)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_LISTEN;
+ req.args[1] = (int)s;
+ req.args[2] = (int)backlog;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_shutdown()
+ */
+int machdep_sys_shutdown(int s, int b)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_SHUTDOWN;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_getsockopt()
+ */
+int machdep_sys_getsockopt(int s, int b, int c, char *d, int *e)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_GETSOCKOPT;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+ req.args[4] = (int)d;
+ req.args[5] = (int)e;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_setsockopt()
+ */
+int machdep_sys_setsockopt(int s, int b, int c, char *d, int e)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_SETSOCKOPT;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+ req.args[4] = (int)d;
+ req.args[5] = (int)e;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_getpeername()
+ */
+int machdep_sys_getpeername(int s, struct sockaddr *b, int *c)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_GETPEERNAME;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_send()
+ */
+int machdep_sys_send(int s, char *b, int c, int d)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_SEND;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+ req.args[4] = (int)d;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_sendto()
+ */
+int machdep_sys_sendto(int s, char *b, int c, int d,
+ struct sockaddr *e, int f)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_SENDTO;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+ req.args[4] = (int)d;
+ req.args[5] = (int)e;
+ req.args[6] = (int)f;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_recv()
+ */
+int machdep_sys_recv(int s, char *b, int c, int d)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_RECV;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+ req.args[4] = (int)d;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_recvfrom()
+ */
+int machdep_sys_recvfrom(int s, char *buf, int len, int flags,
+ struct sockaddr *from, int *fromlen)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_RECVFROM;
+ req.args[1] = (int)s;
+ req.args[2] = (int)buf;
+ req.args[3] = (int)len;
+ req.args[4] = (int)flags;
+ req.args[5] = (int)from;
+ req.args[6] = (int)fromlen;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+/* ==========================================================================
+ * machdep_sys_socketpair()
+ */
+int machdep_sys_socketpair(int d, int type, int protocol, int sv[2])
+
+{
+ register int s1, s2;
+ register int ret;
+ struct socksysreq req;
+
+ if (d != AF_UNIX)
+ return -EPROTONOSUPPORT;
+ if ((s1=machdep_sys_socket(d,type,protocol))<0) {
+ return s1;
+ }
+ if ((s2=machdep_sys_socket(d,type,protocol))<0) {
+ machdep_sys_close(s1);
+ return s2;
+ }
+ req.args[0] = SO_SOCKPAIR;
+ req.args[1] = s1;
+ req.args[2] = s2;
+ if ((ret=machdep_sys_ioctl(s1,SIOCSOCKSYS,&req))<0) {
+ machdep_sys_close(s1);
+ machdep_sys_close(s2);
+ return ret;
+ }
+ sv[0] = s1;
+ sv[1] = s2;
+ return 0;
+}
+
+/* ==========================================================================
+ * machdep_sys_getsockname()
+ */
+int machdep_sys_getsockname(int s, char * b, int * c)
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_GETSOCKNAME;
+ req.args[1] = (int)s;
+ req.args[2] = (int)b;
+ req.args[3] = (int)c;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+int machdep_sys_sendmsg(int s, const struct msghdr *msg, int flags)
+
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_SENDMSG;
+ req.args[1] = (int)s;
+ req.args[2] = (int)msg;
+ req.args[3] = (int)flags;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+int machdep_sys_recvmsg(int s, struct msghdr *msg, int flags)
+
+{
+ struct socksysreq req;
+
+ req.args[0] = SO_RECVMSG;
+ req.args[1] = (int)s;
+ req.args[2] = (int)msg;
+ req.args[3] = (int)flags;
+
+ return(machdep_sys_ioctl(s, SIOCSOCKSYS, &req));
+}
+
+u_short ntohs(u_short n)
+
+{
+ union {
+ unsigned char u_nc[4];
+ u_short u_ns;
+ } ns;
+ register unsigned char* p = &ns.u_nc[0];
+
+ ns.u_ns = n;
+ return (p[0]<<8)|p[1];
+}
+
+u_short htons(u_short h)
+
+{
+ union {
+ unsigned char u_nc[2];
+ u_short u_ns;
+ } ns;
+ register unsigned char* p = &ns.u_nc[0];
+ p[0] = (h>>8)&0xFF;
+ p[1] = (h&0xFF);
+ return ns.u_ns;
+}
+
+
+u_long ntohl(u_long n)
+
+{
+ union {
+ unsigned char u_nc[4];
+ u_long u_nl;
+ } nl;
+ register unsigned char* p = &nl.u_nc[0];
+
+ nl.u_nl = n;
+ return (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3];
+}
+
+u_long htonl(u_long h)
+
+{
+ union {
+ unsigned char u_nc[4];
+ u_long u_nl;
+ } nl;
+ register unsigned char* p = &nl.u_nc[0];
+ p[0] = (h>>24)&0xFF;
+ p[1] = (h>>16)&0xFF;
+ p[2] = (h>>8)&0xFF;
+ p[3] = (h&0xFF);
+ return nl.u_nl;
+}
+
+int getdomainname(char* domain,int len)
+
+{
+ /* edi = len */
+ struct socksysreq req;
+ register int ret, fd;
+ if (len>MAXHOSTNAMELEN)
+ len = MAXHOSTNAMELEN;
+
+ if ((fd = machdep_sys_open("/dev/socksys", 0)) < 0)
+ return fd;
+
+ req.args[0] = SO_GETIPDOMAIN;
+ req.args[1] = (int)domain;
+ req.args[2] = (int)len;
+ if((ret=machdep_sys_ioctl(fd, SIOCSOCKSYS, &req))<0) {
+ machdep_sys_close(fd);
+ return ret;
+ }
+
+ machdep_sys_close(fd);
+ domain[len-1] = '\0';
+ return 0;
+}
+
+int gethostname(char* name, int namelen)
+
+{
+ struct utsname uts;
+ register int ret, len;
+ char domain[MAXHOSTNAMELEN+1];
+
+ if (name==NULL)
+ return -EFAULT;
+ if ((ret=machdep_sys_uname(&uts))<0)
+ return ret;
+ if (namelen<(len=strlen(uts.nodename)))
+ return -EFAULT;
+ strncpy(name,uts.nodename,len);
+ if (namelen>len)
+ name[len] = '\0';
+ if ((ret=getdomainname(domain, namelen - len))<0)
+ return ret;
+ if (domain[0]=='\0')
+ return 0;
+ if (len + strlen(domain) + 2 > namelen)
+ return -EFAULT;
+ strcat(name, ".");
+ strcat(name, domain);
+ return 0;
+}
+
+int gettimeofday(struct timeval* tp, struct timezone* tz)
+
+{
+ register int ret;
+ if ((ret = machdep_sys_gettimeofday(tp, NULL))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+int kill(pid_t pid, int signo)
+
+{
+ register int ret;
+ if ((ret = machdep_sys_kill(pid,signo))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+typedef void (*signal_t(int signo, void (*func)(int)))(int);
+
+signal_t* _libc_signal = NULL;
+
+void (*signal(int signo, void (*func)(int)))(int)
+
+{
+ int ret;
+ void (*oldfunc)(int);
+ extern void (*machdep_sys_signal(int signo, void (*func)(int),int* r))(int);
+ if (_libc_signal!=NULL)
+ return (*_libc_signal)(signo, func);
+
+ oldfunc = machdep_sys_signal(signo, func, &ret);
+ if (ret!=0) {
+ errno = ret;
+ return SIG_ERR;
+ }
+ else {
+ return oldfunc;
+ }
+}
+
+int (*_libc_sigaction)(int ,const struct sigaction *, struct sigaction *) = NULL;
+int sigaction(int sig,const struct sigaction *act, struct sigaction *oact)
+
+{
+ register int ret;
+ if (_libc_sigaction!=NULL)
+ return (*_libc_sigaction)(sig,act,oact);
+ if ((ret = machdep_sys_sigaction(sig,act,oact))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+int (*_libc_sigprocmask)(int, const sigset_t *, sigset_t *) = NULL;
+
+int sigprocmask(int how, const sigset_t *set, sigset_t * oset)
+
+{
+ register int ret;
+ if (_libc_sigprocmask!=NULL)
+ return (*_libc_sigprocmask)(how,set,oset);
+ if ((ret = machdep_sys_sigprocmask(how,set,oset))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+int (*_libc_sigsuspend)(const sigset_t *) = NULL;
+
+int sigsuspend(const sigset_t *set)
+{
+ register int ret;
+ if (_libc_sigsuspend!=NULL)
+ return (*_libc_sigsuspend)(set);
+ if ((ret = machdep_sys_sigsuspend(set))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else {
+ return 0;
+ }
+}
+
+int _sigrelse(sig)
+int sig;
+
+{
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, sig);
+ return sigprocmask(SIG_UNBLOCK,&mask,NULL);
+}
+
+int _sighold(sig)
+int sig;
+
+{
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, sig);
+ return sigprocmask(SIG_BLOCK,&mask,NULL);
+}
+
+void (*sigset(int sig, void (*func)(int)))(int)
+{
+ return signal(sig, func);
+}
+
+
+int (*_libc_getmsg)(int , struct strbuf *, struct strbuf *, int *) = NULL;
+
+int getmsg(int fd, struct strbuf * ctlptr, struct strbuf * dataptr,
+ int * flags)
+{
+ register int ret;
+ if (_libc_getmsg != NULL)
+ return (*_libc_getmsg)(fd,ctlptr,dataptr,flags);
+ else if ((ret=machdep_sys_getmsg(fd,ctlptr,dataptr,flags))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else
+ return ret;
+}
+
+int (*_libc_putmsg)(int , const struct strbuf *, const struct strbuf *, int) = NULL;
+
+int putmsg(int fd, const struct strbuf * ctlptr, const struct strbuf * dataptr,
+ int flags)
+{
+ register int ret;
+ if (_libc_putmsg != NULL)
+ return (*_libc_putmsg)(fd,ctlptr,dataptr,flags);
+ else if ((ret=machdep_sys_putmsg(fd,ctlptr,dataptr,flags))<0) {
+ errno = -ret;
+ return -1;
+ }
+ else
+ return ret;
+}
+
+int ftime(struct timeb* tp)
+
+{
+ register int ret;
+ if ((ret=machdep_sys_ftime(tp))<0) {
+ errno = -ret;
+ return NOTOK;
+ }
+ return 0;
+}
+
+int getpagesize()
+
+{
+ register int ret;
+#if 0
+ if ((ret = machdep_sys_sysconf(_SC_PAGE_SIZE))<0) {
+ PANIC();
+ SET_ERRNO(-ret);
+ return -1;
+ }
+ else {
+ return 0;
+ }
+#else
+ return PAGESIZE;
+#endif
+}
+
+static pthread_mutex_t machdep_mutex =
+{ MUTEX_TYPE_COUNTING_FAST, PTHREAD_QUEUE_INITIALIZER, \
+ NULL, SEMAPHORE_CLEAR, { NULL }, MUTEX_FLAGS_INITED };
+
+static pthread_mutex_t malloc_mutex =
+{ MUTEX_TYPE_COUNTING_FAST, PTHREAD_QUEUE_INITIALIZER, \
+ NULL, SEMAPHORE_CLEAR, { NULL }, MUTEX_FLAGS_INITED };
+
+struct stdlock {
+ volatile long init;
+ pthread_mutex_t* mutex;
+};
+
+static void machdep_stdinitlock(struct stdlock* lock)
+
+{
+ if (lock==0) PANIC();
+ pthread_mutex_lock(&machdep_mutex);
+ if (!lock->init) {
+ register pthread_mutex_t* mutex;
+ pthread_mutexattr_t attr;
+
+ lock->init = 1;
+ lock->mutex = &machdep_mutex;
+ mutex = (pthread_mutex_t*) malloc(sizeof(pthread_mutex_t));
+ pthread_mutexattr_init (&attr);
+ pthread_mutexattr_settype (&attr, MUTEX_TYPE_COUNTING_FAST);
+ pthread_mutex_init(mutex, &attr);
+ lock->mutex = mutex;
+ }
+ pthread_mutex_unlock(&machdep_mutex);
+}
+
+void machdep_stdlock(struct stdlock* lock)
+
+{
+ if (lock==0) PANIC();
+ if (!lock->init)
+ machdep_stdinitlock(lock);
+ pthread_mutex_lock(lock->mutex);
+}
+
+void machdep_stdunlock(struct stdlock* lock)
+
+{
+ if (lock==0) PANIC();
+ if (!lock->init)
+ machdep_stdinitlock(lock);
+ pthread_mutex_unlock(lock->mutex);
+}
+
+int machdep_stdtrylock(struct stdlock* lock)
+
+{
+ if (lock==0) PANIC();
+ if (!lock->init)
+ machdep_stdinitlock(lock);
+ return pthread_mutex_trylock(lock->mutex);
+}
+
+int machdep_stdtryunlock(struct stdlock* lock)
+
+{
+ if (lock==0) PANIC();
+ if (!lock->init)
+ machdep_stdinitlock(lock);
+ if (pthread_mutex_trylock(lock->mutex))
+ return pthread_mutex_unlock(lock->mutex);
+ return 0;
+}
+
+extern void (*_libc_stdlock)(struct stdlock* lock);
+extern void (*_libc_stdunlock)(struct stdlock* lock);
+extern int (*_libc_stdtrylock)(struct stdlock* lock);
+extern int (*_libc_stdtryunlock)(struct stdlock* lock);
+
+int machdep_sys_init()
+
+{
+ typedef void (*voidfunc_t)();
+ extern voidfunc_t _libc_read;
+ extern voidfunc_t _libc_write;
+ extern voidfunc_t _libc_readv;
+ extern voidfunc_t _libc_writev;
+ extern voidfunc_t _libc_open;
+ extern voidfunc_t _libc_close;
+ extern voidfunc_t _libc_fork;
+ extern voidfunc_t _libc_fcntl;
+ extern voidfunc_t _libc_dup;
+ extern voidfunc_t _libc_pipe;
+ extern voidfunc_t _libc_select;
+ extern voidfunc_t _libc_malloc;
+ extern voidfunc_t _libc_realloc;
+ extern voidfunc_t _libc_free;
+ extern ssize_t pthread_read (int , char*, int );
+ extern ssize_t pthread_write (int , char*, int );
+ extern int pthread_close (int);
+ extern int pthread_dup (int);
+ extern int pthread_fork ();
+ extern int pthread_pipe (int*);
+ extern int pthread_fcntl(int, int, ...);
+ extern int pthread_open(const char *, int, ...);
+ extern ssize_t pthread_readv (int , const struct iovec *, int );
+ extern ssize_t pthread_writev (int , const struct iovec *, int );
+ extern int pthread_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+ extern int pthread_getmsg(int , struct strbuf *, struct strbuf *,int*);
+ extern int pthread_putmsg(int , const struct strbuf *, const struct strbuf *,int);
+ extern void (*pthread_signal(int , void (*)(int)))(int);
+ extern int pthread_sigaction(int,const struct sigaction *, struct sigaction *);
+ extern int pthread_sigprocmask(int, const sigset_t *, sigset_t *);
+ extern int pthread_sigsuspend(const sigset_t *);
+
+
+ static struct {
+ voidfunc_t *p;
+ voidfunc_t f;
+ } maptable[] = {
+ {(voidfunc_t*)&_libc_read, (voidfunc_t) pthread_read},
+ {(voidfunc_t*)&_libc_write, (voidfunc_t) pthread_write},
+ {(voidfunc_t*)&_libc_readv, (voidfunc_t) pthread_readv},
+ {(voidfunc_t*)&_libc_writev, (voidfunc_t) pthread_writev},
+ {(voidfunc_t*)&_libc_open, (voidfunc_t) pthread_open},
+ {(voidfunc_t*)&_libc_close, (voidfunc_t) pthread_close},
+ {(voidfunc_t*)&_libc_fork, (voidfunc_t) pthread_fork},
+ {(voidfunc_t*)&_libc_fcntl, (voidfunc_t) pthread_fcntl},
+ {(voidfunc_t*)&_libc_dup, (voidfunc_t) pthread_dup},
+ {(voidfunc_t*)&_libc_pipe, (voidfunc_t) pthread_pipe},
+ {(voidfunc_t*)&_libc_select, (voidfunc_t) pthread_select},
+ {(voidfunc_t*)&_libc_getmsg, (voidfunc_t) pthread_getmsg},
+ {(voidfunc_t*)&_libc_putmsg, (voidfunc_t) pthread_putmsg},
+ {(voidfunc_t*)&_libc_signal, (voidfunc_t) pthread_signal},
+ {(voidfunc_t*)&_libc_sigaction, (voidfunc_t) pthread_sigaction},
+ {(voidfunc_t*)&_libc_sigprocmask, (voidfunc_t) pthread_sigprocmask},
+ {(voidfunc_t*)&_libc_sigsuspend, (voidfunc_t) pthread_sigsuspend},
+ {(voidfunc_t*) 0, (voidfunc_t) 0}
+ };
+ register int i;
+
+ for (i=0; maptable[i].p; i++)
+ *maptable[i].p = maptable[i].f;
+
+ _libc_stdlock = machdep_stdlock;
+ _libc_stdunlock = machdep_stdunlock;
+ _libc_stdtrylock = machdep_stdtrylock;
+ _libc_stdtryunlock = machdep_stdtryunlock;
+ return 0;
+}
+
+#if 0
+extern end;
+char* nd = (char*) &end;
+char* brk(const char* endds)
+
+{
+ register int ret;
+
+ if ((ret = machdep_sys_brk((char*)endds))<0) {
+ SET_ERRNO(-ret);
+ return (char*) -1;
+ }
+ else {
+ nd = (char*) endds;
+ return 0;
+ }
+}
+
+char *sbrk(int incr)
+
+{
+ register char* ret;
+ if (incr!=0 && (ret=brk(nd + incr))!=0)
+ return ret;
+ else
+ return nd - incr;
+}
+#endif
+
+sigset_t sigmask(int sig)
+
+{
+ sigset_t oset;
+ sigemptyset(&oset);
+ sigaddset(&oset, sig);
+ return oset;
+}
+
+sigset_t sigsetmask(sigset_t set)
+
+{
+ sigset_t oset;
+ sigprocmask(SIG_SETMASK,&set,&oset);
+ return oset;
+}
+
+sigset_t sigblock(sigset_t set)
+
+{
+ sigset_t oset;
+ sigprocmask(SIG_BLOCK,&set,&oset);
+ return oset;
+}
diff --git a/mit-pthreads/machdep/engine-i386-sco-3.2v5.h b/mit-pthreads/machdep/engine-i386-sco-3.2v5.h
new file mode 100644
index 00000000000..8b2aa362f06
--- /dev/null
+++ b/mit-pthreads/machdep/engine-i386-sco-3.2v5.h
@@ -0,0 +1,104 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * engine-i386-freebsd-2.0.h,v 1.1.4.1 1995/12/13 05:41:52 proven Exp
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+long temp = SEMAPHORE_SET; \
+ \
+__asm__ volatile ("xchgl %0,(%2)" \
+ :"=r" (temp) \
+ :"0" (temp),"r" (lock)); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+#define JB_BP 3
+#define JB_SP 4
+#define JB_PC 5
+ char machdep_float_state[108];
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 2048
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-ip22-irix-5.2.c b/mit-pthreads/machdep/engine-ip22-irix-5.2.c
new file mode 100644
index 00000000000..d205d05f316
--- /dev/null
+++ b/mit-pthreads/machdep/engine-ip22-irix-5.2.c
@@ -0,0 +1,225 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1995 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for IRIX-5.2 on the IP22
+ *
+ * 1.00 95/04/26 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ int i;
+
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ if (setjmp(machdep_pthread->machdep_state)) {
+ machdep_pthread_start();
+ }
+
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+
+ /* IP22 stack starts high and builds down. */
+ machdep_pthread->machdep_state[JB_SP] =
+ (int)machdep_pthread->machdep_stack + stack_size - 1024;
+ machdep_pthread->machdep_state[JB_SP] &= ~7;
+
+ memcpy((void *)machdep_pthread->machdep_state[JB_SP],
+ (char *)(((int)&i) - 24), 32);
+
+}
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+machdep_sys_dup2(int a, int b)
+{
+ machdep_sys_close(b);
+ machdep_sys_fcntl(a, F_DUPFD, b);
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_waitsys(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_waitsys(a, b, c, NULL));
+}
+
+struct stat;
+
+/* ==========================================================================
+ * _fxstat()
+ */
+int _fxstat(int __ver, int fd, struct stat *buf)
+{
+ int ret;
+
+ if ((ret = fd_lock(fd, FD_READ, NULL)) == OK) {
+ if ((ret = machdep_sys_fstat(fd_table[fd]->fd.i, buf)) < OK) {
+ SET_ERRNO(-ret);
+ }
+ fd_unlock(fd, FD_READ);
+ }
+ return(ret);
+}
+
+/* ==========================================================================
+ * _lxstat()
+ */
+int _lxstat(int __ver, const char * path, struct stat * buf)
+{
+ int ret;
+
+ if ((ret = machdep_sys_lstat(path, buf)) < OK) {
+ SET_ERRNO(-ret);
+ }
+ return(ret);
+
+}
+
+/* ==========================================================================
+ * _xstat()
+ */
+int _xstat(int __ver, const char * path, struct stat * buf)
+{
+ int ret;
+
+ if ((ret = machdep_sys_stat(path, buf)) < OK) {
+ SET_ERRNO(-ret);
+ }
+ return(ret);
+
+}
+
+/* ==========================================================================
+ * getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ int i;
+
+ i = machdep_sys_getdents(fd, buf, len);
+ return i;
+}
diff --git a/mit-pthreads/machdep/engine-ip22-irix-5.2.h b/mit-pthreads/machdep/engine-ip22-irix-5.2.h
new file mode 100644
index 00000000000..94dd386608e
--- /dev/null
+++ b/mit-pthreads/machdep/engine-ip22-irix-5.2.h
@@ -0,0 +1,108 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 0xff
+
+/*
+ * More machine dependent macros
+ */
+#ifdef PTHREAD_KERNEL
+
+#define machdep_save_float_state(x)
+#define machdep_restore_float_state()
+
+#endif
+
+/*
+ * New types
+ */
+typedef char semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIGMAX 32
+#define SIG_ANY(sig) \
+({ \
+ sigset_t *sig_addr = (sigset_t *)&sig; \
+ int ret = 0; \
+ int i; \
+ \
+ for (i = 1; i <= SIGMAX; i++) { \
+ if (sigismember(sig_addr, i)) { \
+ ret = 1; \
+ break; \
+ } \
+ } \
+ ret; \
+})
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-m68000-netbsd.c b/mit-pthreads/machdep/engine-m68000-netbsd.c
new file mode 100644
index 00000000000..6346c36ca7c
--- /dev/null
+++ b/mit-pthreads/machdep/engine-m68000-netbsd.c
@@ -0,0 +1,256 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ *
+ * m68k work from David Leonard <david.leonard@it.uq.edu.au>.
+ * updated and NetBSD/m68k work from Andy Finnell <andyf@vei.net>.
+ *
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include "pthread.h"
+#include <sys/syscall.h>
+#include <sys/stat.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return( _setjmp(pthread_run->machdep_data.machdep_state) );
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+void machdep_save_float_state(struct pthread * pthread)
+{
+ char * fdata = pthread->machdep_data.machdep_fstate;
+
+ __asm__ ( "fmovem fp0-fp7,%0"::"m" (*fdata) );
+ __asm__ ( "fmovem fpcr/fpsr/fpi,%0"::"m" (fdata[80]) );
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+void machdep_restore_float_state(void)
+{
+ char * fdata = pthread_run->machdep_data.machdep_fstate;
+
+ __asm__ ( "fmovem %0,fp0-fp7"::"m" (*fdata) );
+ __asm__ ( "fmovem %0,fpcr/fpsr/fpi"::"m" (fdata[80]) );
+
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0 } };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return((void*)malloc(size));
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current thread's start routine with argument */
+ pthread_exit(
+ pthread_run->machdep_data.start_routine(
+ pthread_run->machdep_data.start_argument
+ )
+ );
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stack frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ *
+ * state is the set_jmp structure, which for m68k is:
+ * long onstack_flag; // [0]
+ * long sigmask; // [1]
+ * long sp; // [2]
+ * long fp; // [3]
+ * long ap; // [4]
+ * long pc; // [5]
+ * long ps; // [6]
+ * long regs[10]; // non scratch registers
+ */
+ machdep_pthread->machdep_state[5] = (long)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ return(machdep_sys_wait4(a, b, c, NULL));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+off_t machdep_sys_lseek(int fd, off_t offset, int whence)
+{
+ extern off_t __syscall();
+
+ return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
+}
+
+int machdep_sys_ftruncate( int fd, off_t length)
+{
+ quad_t q;
+ int rv;
+
+ q = __syscall((quad_t)SYS_ftruncate, fd,0, length);
+ if( /* LINTED constant */ sizeof( quad_t ) == sizeof( register_t ) ||
+ /* LINTED constant */ BYTE_ORDER == LITTLE_ENDIAN )
+ rv = (int)q;
+ else
+ rv = (int)((u_quad_t)q >> 32);
+
+ return rv;
+}
+
+int machdep_sys_fstat( int f, struct stat* st )
+{
+ return __fstat13(f,st);
+}
diff --git a/mit-pthreads/machdep/engine-m68000-netbsd.h b/mit-pthreads/machdep/engine-m68000-netbsd.h
new file mode 100644
index 00000000000..ec3c6a01bce
--- /dev/null
+++ b/mit-pthreads/machdep/engine-m68000-netbsd.h
@@ -0,0 +1,107 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * m68k work by Andy Finnell <andyf@vei.net> based off work by
+ * David Leonard and Chris Provenzano.
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 0x80;
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+ volatile long temp = SEMAPHORE_CLEAR; \
+ __asm__ volatile( \
+ "tas %2; bpl 0f; movl #1,%0; 0:" \
+ :"=r" (temp) \
+ :"0" (temp),"m" (*lock)); \
+ temp; \
+})
+
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef char semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+ char machdep_fstate[92];
+};
+
+/*
+ * Min pthread stacksize
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+
+#ifndef __machdep_stack_get
+#define __machdep_stack_get(x) (x)->machdep_stack
+#endif
+#ifndef __machdep_stack_set
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#endif
+#ifndef __machdep_stack_repl
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+#endif
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-r2000-ultrix-4.2.c b/mit-pthreads/machdep/engine-r2000-ultrix-4.2.c
new file mode 100644
index 00000000000..45c8cc73f24
--- /dev/null
+++ b/mit-pthreads/machdep/engine-r2000-ultrix-4.2.c
@@ -0,0 +1,209 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for decstation with r2000/r3000
+ *
+ * 1.00 93/07/21 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <stdlib.h>
+#include <errno.h>
+
+/*
+ * The r2000/r3000 processors do not have a test and set instruction, so
+ * the semaphore TEST_AND_SET macro is linked very closely to the interrupt
+ * handelling of the pthreads package.
+ */
+
+/* ==========================================================================
+ * semaphore_test_and_set()
+ *
+ * SEMAPHORE_TEST_AND_SET prevents interrupts, tests the lock and then
+ * turns interrupts back on, checking to see if any interrupts have occured
+ * between the prevent and resume.
+ */
+int semaphore_test_and_set(semaphore *lock)
+{
+ int rval;
+
+/* None of this should be necessary
+ sig_prevent();
+ if (!(rval = (*lock))) {
+ *lock = SEMAPHORE_SET;
+ }
+ sig_check_and_resume();
+ return(rval);
+*/
+}
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_save_float_state()
+ */
+void machdep_save_float_state(struct pthread * pthread)
+{
+ return;
+}
+
+/* ==========================================================================
+ * fake_longjmp()
+ */
+void fake_longjmp(jmp_buf env)
+{
+ asm("li $5,1; sw $5, 20($4); li $2,103; syscall");
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ *
+ * When I redo machdep_save_state, I'll put the asm in machdep_save_state()
+ * and machdep_restore_state() and I won't have to do an additional function
+ * call.
+ */
+void machdep_restore_state(void)
+{
+ fake_longjmp(pthread_run->machdep_data.machdep_state);
+ /* longjmp(pthread_run->machdep_data.machdep_state, 1); */
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+void machdep_restore_float_state(void)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[JB_RA] = (int)machdep_pthread_start;
+ machdep_pthread->machdep_state[JB_PC] = (int)machdep_pthread_start;
+
+ /* Stack starts high and builds down. */
+ machdep_pthread->machdep_state[JB_SP] =
+ (int)machdep_pthread->machdep_stack + stack_size;
+
+ /* This is the real global pointer */
+ /* machdep_pthread->machdep_state[JB_GP] = 0; */
+}
+
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ * This isn't a real implementation; we can make the assumption that the
+ * pthreads library is not using oset, and that it is always blocking or
+ * unblocking all signals at once.
+ */
+int machdep_sys_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
+{
+ switch(how) {
+ case SIG_BLOCK:
+ sigblock(*set);
+ break;
+ case SIG_UNBLOCK:
+ sigsetmask(~*set);
+ break;
+ case SIG_SETMASK:
+ sigsetmask(*set);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return(OK);
+}
+
diff --git a/mit-pthreads/machdep/engine-r2000-ultrix-4.2.h b/mit-pthreads/machdep/engine-r2000-ultrix-4.2.h
new file mode 100644
index 00000000000..8e2d70f8feb
--- /dev/null
+++ b/mit-pthreads/machdep/engine-r2000-ultrix-4.2.h
@@ -0,0 +1,107 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Machine dependent header for decstation with r2000/r3000
+ * running Ultrix-4.2
+ *
+ * 1.00 93/07/21 proven
+ * -Started coding this file.
+ */
+
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 1
+
+#define SEMAPHORE_TEST_AND_SET(lock) semaphore_test_and_set(lock)
+#define SEMAPHORE_RESET(lock) *lock = SEMAPHORE_CLEAR
+
+/*
+ * New types
+ */
+typedef long semaphore;
+
+#if !defined(_POSIX_SOURCE)
+
+/* typedef int ssize_t; */
+
+#if !defined(__GNUC__)
+
+/*
+ * sigset_t macros
+ */
+typedef int sigset_t;
+#define sigaddset(set, num) ((*set) |= (1 << (num - 1)))
+#define sigemptyset(set) (*set = 0)
+
+#endif
+#endif
+
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Structures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+
+/*
+ * Min stacksize, arch dependent
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int semaphore_test_and_set __P_((semaphore *));
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-romp-bsd.c b/mit-pthreads/machdep/engine-romp-bsd.c
new file mode 100644
index 00000000000..dd1a1096ece
--- /dev/null
+++ b/mit-pthreads/machdep/engine-romp-bsd.c
@@ -0,0 +1,99 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for NetBSD on i386
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ return(_pthread_save(pthread_run->machdep_data.machdep_state, 0, 0));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ _pthread_restore(pthread_run->machdep_data.machdep_state);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ sig_check_and_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * machdep_pthread_create()
+ */
+void machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument, long stack_size,
+ void *stack_start, long nsec)
+{
+ machdep_pthread->machdep_stack = stack_start;
+
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ _pthread_save(machdep_pthread->machdep_state,
+ (void *)((int)machdep_pthread->machdep_stack + stack_size),
+ machdep_pthread_start);
+}
+
diff --git a/mit-pthreads/machdep/engine-romp-bsd.h b/mit-pthreads/machdep/engine-romp-bsd.h
new file mode 100644
index 00000000000..28c59d35e70
--- /dev/null
+++ b/mit-pthreads/machdep/engine-romp-bsd.h
@@ -0,0 +1,100 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1993 John F. Carr, jfc@athena.mit.edu
+ *
+ * Description : Machine dependent header for IBM/RT
+ *
+ * 1.00 93/09/xx jfc
+ * -Coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
+/*
+ * Stuff for compiling
+ */
+#if defined(__GNUC__)
+#if defined(__cplusplus)
+#define __BEGIN_DECLS extern "C" {
+#define __END_DECLS };
+#else
+#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 __BEGIN_DECLS
+#define __END_DECLS
+#define const
+#define inline
+#define signed
+#define volatile
+#endif
+
+#define SEMAPHORE_CLEAR 0x0000
+#define SEMAPHORE_SET 0xff00
+#define SEMAPHORE_TEST_AND_SET(lock) _tsh(lock)
+#define SEMAPHORE_RESET(lock) *(lock) = SEMAPHORE_CLEAR
+extern unsigned short _tsh(volatile unsigned short *);
+
+typedef unsigned short semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Min pthread stacksize
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK O_NONBLOCK
+
+#if defined(PTHREAD_KERNEL)
+
+int machdep_save_state __P_((void));
+
+/* save(jmp_buf, stack pointer, restart proc) */
+extern int _pthread_save(jmp_buf, void *, void (*)());
+extern void _pthread_restore(jmp_buf);
+
+typedef int ssize_t;
+typedef unsigned int sigset_t;
+#define sigemptyset(sp) *(sp) = 0
+#define sigprocmask(op, nssp, ossp) if (ossp) *(int *)ossp = sigsetmask(*nssp); else sigsetmask(*nssp)
+#define sigdelset(sp, i) *(sp) &= ~(1 << (i))
+#define sigaddset(sp, i) *(sp) |= (1 << (i))
+#define sigismember(sp, i) (*(sp) & (1 << (i)))
+#endif
diff --git a/mit-pthreads/machdep/engine-sparc-netbsd-1.3.c b/mit-pthreads/machdep/engine-sparc-netbsd-1.3.c
new file mode 100644
index 00000000000..8e0520cfba5
--- /dev/null
+++ b/mit-pthreads/machdep/engine-sparc-netbsd-1.3.c
@@ -0,0 +1,232 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for SunOS-4.1.3 on sparc
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ *
+ * 98/10/22 bad
+ * -update for fat sigset_t in NetBSD 1.3H
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include "config.h"
+#include <pthread.h>
+#include <stdlib.h>
+#include <errno.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ /* Save register windows onto stackframe */
+ __asm__ ("ta 3");
+
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+/* ==========================================================================
+ * machdep_save_float_state()
+ */
+void machdep_save_float_state(struct pthread * pthread)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+void machdep_restore_float_state(void)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume ();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ /* Save register windows onto stackframe */
+ __asm__ ("ta 3");
+
+ setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[3] = (int)machdep_pthread_start;
+ machdep_pthread->machdep_state[4] = (int)machdep_pthread_start;
+
+ /* Sparc stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size - 1024;
+ machdep_pthread->machdep_state[2] &= ~7;
+
+}
+
+#if defined(HAVE_SYSCALL_GETDENTS)
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ *
+ * Always use getdents in place of getdirentries if possible --proven
+ */
+int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
+#endif
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int pid, int * statusp, int options)
+{
+ if (pid == -1)
+ pid = 0;
+ else if (pid == 0)
+ pid = - getpgrp ();
+ return machdep_sys_wait4 (pid, statusp, options, NULL);
+}
+
+#if !defined(HAVE_SYSCALL_SIGPROCMASK)
+#if 0
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ * This isn't a real implementation; we can make the assumption that the
+ * pthreads library is not using oset, and that it is always blocking or
+ * unblocking all signals at once.
+ */
+int machdep_sys_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
+{
+ switch(how) {
+ case SIG_BLOCK:
+ sigblock(*set);
+ break;
+ case SIG_UNBLOCK:
+ sigsetmask(~*set);
+ break;
+ case SIG_SETMASK:
+ sigsetmask(*set);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return(OK);
+}
+
+/* ==========================================================================
+ * sigaction()
+ *
+ * Temporary until I do machdep_sys_sigaction()
+ */
+int sigaction(int sig, const struct sigaction *act, struct sigaction *oldact)
+{
+ return(sigvec(sig, (struct sigvec *)act, (struct sigvec *)oldact));
+}
+#endif
+#endif
+
+#if !defined(HAVE_SYSCALL_GETDTABLESIZE)
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+#endif
diff --git a/mit-pthreads/machdep/engine-sparc-netbsd-1.3.h b/mit-pthreads/machdep/engine-sparc-netbsd-1.3.h
new file mode 100644
index 00000000000..a187d3dace8
--- /dev/null
+++ b/mit-pthreads/machdep/engine-sparc-netbsd-1.3.h
@@ -0,0 +1,106 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * engine-sparc-sunos-4.1.3.h,v 1.52.4.1 1995/12/13 05:42:33 proven Exp
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+#include <sys/signal.h> /* for _NSIG */
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 0xff
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+char *p = lock; \
+long temp; \
+ \
+__asm__ volatile("ldstub %1,%0" \
+ :"=r" (temp) \
+ :"m" (*p) \
+ :"memory"); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) \
+{ \
+__asm__ volatile("stb %1, %0" \
+ :"=m" (*lock) \
+ :"r" (SEMAPHORE_CLEAR) \
+ :"memory"); \
+}
+
+/*
+ * New types
+ */
+typedef char semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX (_NSIG-1)
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c b/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c
new file mode 100644
index 00000000000..6916c3610cd
--- /dev/null
+++ b/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.c
@@ -0,0 +1,227 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for SunOS-4.1.3 on sparc
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include "config.h"
+#include <pthread.h>
+#include <stdlib.h>
+#include <errno.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ /* Save register windows onto stackframe */
+ __asm__ ("ta 3");
+
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+/* ==========================================================================
+ * machdep_save_float_state()
+ */
+void machdep_save_float_state(struct pthread * pthread)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_restore_float_state()
+ */
+void machdep_restore_float_state(void)
+{
+ return;
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume ();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * __machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ /* Save register windows onto stackframe */
+ __asm__ ("ta 3");
+
+ setjmp(machdep_pthread->machdep_state);
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+ machdep_pthread->machdep_state[3] = (int)machdep_pthread_start;
+ machdep_pthread->machdep_state[4] = (int)machdep_pthread_start;
+
+ /* Sparc stack starts high and builds down. */
+ machdep_pthread->machdep_state[2] =
+ (int)machdep_pthread->machdep_stack + stack_size - 1024;
+ machdep_pthread->machdep_state[2] &= ~7;
+
+}
+
+#if defined(HAVE_SYSCALL_GETDENTS)
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ *
+ * Always use getdents in place of getdirentries if possible --proven
+ */
+int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
+#endif
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(machdep_sys_wait4(0, b, c, d));
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int pid, int * statusp, int options)
+{
+ if (pid == -1)
+ pid = 0;
+ else if (pid == 0)
+ pid = - getpgrp ();
+ return machdep_sys_wait4 (pid, statusp, options, NULL);
+}
+
+#if !defined(HAVE_SYSCALL_SIGPROCMASK)
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ * This isn't a real implementation; we can make the assumption that the
+ * pthreads library is not using oset, and that it is always blocking or
+ * unblocking all signals at once.
+ */
+int machdep_sys_sigprocmask(int how, const sigset_t *set, sigset_t *oset)
+{
+ switch(how) {
+ case SIG_BLOCK:
+ sigblock(*set);
+ break;
+ case SIG_UNBLOCK:
+ sigsetmask(~*set);
+ break;
+ case SIG_SETMASK:
+ sigsetmask(*set);
+ break;
+ default:
+ return -EINVAL;
+ }
+ return(OK);
+}
+
+/* ==========================================================================
+ * sigaction()
+ *
+ * Temporary until I do machdep_sys_sigaction()
+ */
+int sigaction(int sig, const struct sigaction *act, struct sigaction *oldact)
+{
+ return(sigvec(sig, (struct sigvec *)act, (struct sigvec *)oldact));
+}
+#endif
+
+#if !defined(HAVE_SYSCALL_GETDTABLESIZE)
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+#endif
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h b/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h
new file mode 100644
index 00000000000..1a4a8768ad0
--- /dev/null
+++ b/mit-pthreads/machdep/engine-sparc-sunos-4.1.3.h
@@ -0,0 +1,105 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 0xff
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+char *p = lock; \
+long temp; \
+ \
+__asm__ volatile("ldstub %1,%0" \
+ :"=r" (temp) \
+ :"m" (*p) \
+ :"memory"); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) \
+{ \
+__asm__ volatile("stb %1, %0" \
+ :"=m" (*lock) \
+ :"r" (SEMAPHORE_CLEAR) \
+ :"memory"); \
+}
+
+/*
+ * New types
+ */
+typedef char semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIG_ANY(sig) (sig)
+#define SIGMAX 31
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-5.3.c b/mit-pthreads/machdep/engine-sparc-sunos-5.3.c
new file mode 100644
index 00000000000..a228a408da3
--- /dev/null
+++ b/mit-pthreads/machdep/engine-sparc-sunos-5.3.c
@@ -0,0 +1,308 @@
+/* ==== machdep.c ============================================================
+ * Copyright (c) 1993, 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Machine dependent functions for SunOS-4.1.3 on sparc
+ *
+ * 1.00 93/08/04 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#include <pthread.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/procset.h>
+#include <sys/systeminfo.h>
+#include <poll.h>
+
+/* ==========================================================================
+ * machdep_save_state()
+ */
+int machdep_save_state(void)
+{
+ /* Save register windows onto stackframe */
+ __asm__ ("ta 3");
+
+ return(setjmp(pthread_run->machdep_data.machdep_state));
+}
+
+/* ==========================================================================
+ * machdep_restore_state()
+ */
+void machdep_restore_state(void)
+{
+ longjmp(pthread_run->machdep_data.machdep_state, 1);
+}
+
+/* ==========================================================================
+ * machdep_set_thread_timer()
+ */
+void machdep_set_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ if (setitimer(ITIMER_VIRTUAL, &(machdep_pthread->machdep_timer), NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_unset_thread_timer()
+ */
+void machdep_unset_thread_timer(struct machdep_pthread *machdep_pthread)
+{
+ struct itimerval zeroval = { { 0, 0 }, { 0, 0} };
+
+ if (setitimer(ITIMER_VIRTUAL, &zeroval, NULL)) {
+ PANIC();
+ }
+}
+
+/* ==========================================================================
+ * machdep_pthread_cleanup()
+ */
+void *machdep_pthread_cleanup(struct machdep_pthread *machdep_pthread)
+{
+ return(machdep_pthread->machdep_stack);
+}
+
+/* ==========================================================================
+ * machdep_pthread_start()
+ */
+void machdep_pthread_start(void)
+{
+ context_switch_done();
+ pthread_sched_resume();
+
+ /* Run current threads start routine with argument */
+ pthread_exit(pthread_run->machdep_data.start_routine
+ (pthread_run->machdep_data.start_argument));
+
+ /* should never reach here */
+ PANIC();
+}
+
+/* ==========================================================================
+ * __machdep_stack_free()
+ */
+void __machdep_stack_free(void * stack)
+{
+ free(stack);
+}
+
+/* ==========================================================================
+ * __machdep_stack_alloc()
+ */
+void * __machdep_stack_alloc(size_t size)
+{
+ void * stack;
+
+ return(malloc(size));
+}
+
+/* ==========================================================================
+ * machdep_pthread_create()
+ */
+void __machdep_pthread_create(struct machdep_pthread *machdep_pthread,
+ void *(* start_routine)(), void *start_argument,
+ long stack_size, long nsec, long flags)
+{
+ machdep_pthread->start_routine = start_routine;
+ machdep_pthread->start_argument = start_argument;
+
+ machdep_pthread->machdep_timer.it_value.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_sec = 0;
+ machdep_pthread->machdep_timer.it_interval.tv_usec = 0;
+ machdep_pthread->machdep_timer.it_value.tv_usec = nsec / 1000;
+
+ /* Save register windows onto stackframe */
+ __asm__ ("ta 3");
+
+ if (setjmp(machdep_pthread->machdep_state)) {
+ machdep_pthread_start();
+ }
+
+ /*
+ * Set up new stact frame so that it looks like it
+ * returned from a longjmp() to the beginning of
+ * machdep_pthread_start().
+ */
+
+ /* Sparc stack starts high and builds down. */
+ machdep_pthread->machdep_state[1] =
+ (int)machdep_pthread->machdep_stack + stack_size - 1024;
+ machdep_pthread->machdep_state[1] &= ~7;
+
+}
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+int machdep_sys_getdirentries(int fd, char * buf, int len, int * seek)
+{
+ return(machdep_sys_getdents(fd, buf, len));
+}
+
+/* ==========================================================================
+ * machdep_sys_wait3()
+ */
+machdep_sys_wait3(int * b, int c, int * d)
+{
+ return(-ENOSYS);
+ /* return(machdep_sys_wait4(0, b, c, d)); */
+}
+
+/* ==========================================================================
+ * machdep_sys_waitpid()
+ */
+machdep_sys_waitpid(int a, int * b, int c)
+{
+ idtype_t id;
+
+ switch (a) {
+ case -1:
+ id = P_ALL;
+ break;
+ case 0:
+ a = machdep_sys_pgrpsys(0);
+ id = P_PGID;
+ break;
+ default:
+ if (a < 0) {
+ id = P_PGID;
+ a = -a;
+ } else {
+ id = P_PID;
+ }
+ break;
+ }
+
+ return(machdep_sys_waitsys(id, a, b, c));
+}
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+machdep_sys_dup2(int a, int b)
+{
+ machdep_sys_close(b);
+ machdep_sys_fcntl(a, F_DUPFD, b);
+}
+
+/* ==========================================================================
+ * machdep_sys_ftruncate()
+ */
+machdep_sys_ftruncate(int a, off_t b)
+{
+ flock_t c;
+
+ c.l_len = 0;
+ c.l_start = b;
+ c.l_whence = 0;
+ return(machdep_sys_fcntl(a, F_FREESP, c));
+}
+
+/* ==========================================================================
+ * machdep_sys_select()
+ * Recoded to be quicker by Monty
+ */
+static fd_set bogus_fds; /* Always zero, never changed */
+
+machdep_sys_select(int nfds, fd_set *readfds, fd_set *writefds,
+ fd_set *exceptfds, struct timeval *timeout)
+{
+ struct pollfd fds[64],*ptr;
+ int i, fds_count, time_out, found;
+
+ /* Make sure each arg has a valid pointer */
+ if ((readfds == NULL) || (writefds == NULL) || (exceptfds == NULL)) {
+ if (exceptfds == NULL) {
+ exceptfds = &bogus_fds;
+ }
+ if (writefds == NULL) {
+ writefds = &bogus_fds;
+ }
+ if (readfds == NULL) {
+ readfds = &bogus_fds;
+ }
+ }
+
+ ptr=fds;
+ for (i = 0 ; i < nfds; i++)
+ {
+ if (FD_ISSET(i, readfds))
+ {
+ if (FD_ISSET(i, writefds))
+ ptr->events= POLLIN | POLLOUT;
+ else
+ ptr->events= POLLIN;
+ (ptr++)->fd=i;
+ }
+ else if (FD_ISSET(i, writefds))
+ {
+ ptr->events=POLLOUT;
+ (ptr++)->fd=i;
+ }
+ }
+ FD_ZERO(readfds);
+ FD_ZERO(writefds);
+ FD_ZERO(exceptfds);
+ time_out = timeout->tv_usec / 1000 + timeout->tv_sec * 1000;
+ fds_count=(int) (ptr-fds);
+ while ((found = machdep_sys_poll(fds, fds_count, time_out)) <= 0)
+ {
+ if (found != -ERESTART) /* Try again if restartable */
+ return(found); /* Usually 0 ; Cant read or write */
+ }
+
+ while (ptr-- != fds)
+ {
+ if (ptr->revents & POLLIN)
+ FD_SET(ptr->fd, readfds);
+ if (ptr->revents & POLLOUT)
+ FD_SET(ptr->fd,writefds);
+ }
+ return(found);
+}
+
+/* ==========================================================================
+ * machdep_sys_getdtablesize()
+ */
+machdep_sys_getdtablesize()
+{
+ return(sysconf(_SC_OPEN_MAX));
+}
+
+/* ==========================================================================
+ * getpagesize()
+ */
+getpagesize()
+{
+ return(sysconf(_SC_PAGESIZE));
+}
+
+/* ==========================================================================
+ * gethostname()
+ */
+int gethostname(char * name, int namelen)
+{
+ if (sysinfo(SI_HOSTNAME, name, namelen) == NOTOK) {
+ return(NOTOK);
+ } else {
+ return(OK);
+ }
+}
+
+/* ==========================================================================
+ * machdep_sys_sigaction()
+ *
+ * This is VERY temporary.
+ */
+int machdep_sys_sigaction(int a, void * b, void * c)
+{
+ return(sigaction(a, b, c));
+}
diff --git a/mit-pthreads/machdep/engine-sparc-sunos-5.3.h b/mit-pthreads/machdep/engine-sparc-sunos-5.3.h
new file mode 100644
index 00000000000..365ecd799eb
--- /dev/null
+++ b/mit-pthreads/machdep/engine-sparc-sunos-5.3.h
@@ -0,0 +1,129 @@
+/* ==== machdep.h ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ */
+
+#include <unistd.h>
+#include <setjmp.h>
+#include <sys/time.h>
+#include <sys/cdefs.h>
+
+/*
+ * The first machine dependent functions are the SEMAPHORES
+ * needing the test and set instruction.
+ */
+#define SEMAPHORE_CLEAR 0
+#define SEMAPHORE_SET 0xff
+
+#define SEMAPHORE_TEST_AND_SET(lock) \
+({ \
+char *p = lock; \
+long temp; \
+ \
+__asm__ volatile("ldstub %1,%0" \
+ :"=r" (temp) \
+ :"m" (*p) \
+ :"memory"); \
+temp; \
+})
+
+#define SEMAPHORE_RESET(lock) \
+{ \
+__asm__ volatile("stb %1, %0" \
+ :"=m" (*lock) \
+ :"r" (SEMAPHORE_CLEAR) \
+ :"memory"); \
+}
+
+/*
+ * More machine dependent macros
+ */
+#ifdef PTHREAD_KERNEL
+
+#define machdep_save_float_state(x)
+#define machdep_restore_float_state()
+
+#endif
+
+/*
+ * New types
+ */
+typedef char semaphore;
+
+/*
+ * sigset_t macros
+ */
+#define SIGMAX 31
+#define SIG_ANY(sig) \
+({ \
+ sigset_t *sig_addr = (sigset_t *)&sig; \
+ int ret = 0; \
+ int i; \
+ \
+ for (i = 1; i <= SIGMAX; i++) { \
+ if (sigismember(sig_addr, i)) { \
+ ret = 1; \
+ break; \
+ } \
+ } \
+ ret; \
+})
+
+/*
+ * New Strutures
+ */
+struct machdep_pthread {
+ void *(*start_routine)(void *);
+ void *start_argument;
+ void *machdep_stack;
+ struct itimerval machdep_timer;
+ jmp_buf machdep_state;
+};
+
+/*
+ * Static machdep_pthread initialization values.
+ * For initial thread only.
+ */
+#define MACHDEP_PTHREAD_INIT \
+{ NULL, NULL, NULL, { { 0, 0 }, { 0, 100000 } }, 0 }
+
+/*
+ * Minimum stack size
+ */
+#undef PTHREAD_STACK_MIN /* Defined in limits.h */
+#define PTHREAD_STACK_MIN 1024
+
+/*
+ * Some fd flag defines that are necessary to distinguish between posix
+ * behavior and bsd4.3 behavior.
+ */
+#define __FD_NONBLOCK (O_NONBLOCK | O_NDELAY)
+
+/*
+ * New functions
+ */
+
+__BEGIN_DECLS
+
+#if defined(PTHREAD_KERNEL)
+
+#define __machdep_stack_get(x) (x)->machdep_stack
+#define __machdep_stack_set(x, y) (x)->machdep_stack = y
+#define __machdep_stack_repl(x, y) \
+{ \
+ if (stack = __machdep_stack_get(x)) { \
+ __machdep_stack_free(stack); \
+ } \
+ __machdep_stack_set(x, y); \
+}
+
+void * __machdep_stack_alloc __P_((size_t));
+void __machdep_stack_free __P_((void *));
+
+int machdep_save_state __P_((void));
+
+#endif
+
+__END_DECLS
diff --git a/mit-pthreads/machdep/freebsd-1.1/compat.h b/mit-pthreads/machdep/freebsd-1.1/compat.h
new file mode 100755
index 00000000000..e7de318aa88
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-1.1/compat.h
@@ -0,0 +1,43 @@
+/* ==== 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 : COmpat header to make socket code compile.
+ *
+ * 1.00 94/08/01 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#endif
diff --git a/mit-pthreads/machdep/freebsd-1.1/dirent.h b/mit-pthreads/machdep/freebsd-1.1/dirent.h
new file mode 100755
index 00000000000..5226443f86b
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-1.1/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/freebsd-1.1/socket.h b/mit-pthreads/machdep/freebsd-1.1/socket.h
new file mode 100755
index 00000000000..f13d01e7fe5
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-1.1/socket.h
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 1982,1985,1986,1988 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: @(#)socket.h 7.13 (Berkeley) 4/20/91
+ * $Id$
+ */
+
+#ifndef _SYS_SOCKET_H_
+#define _SYS_SOCKET_H_ 1
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Types
+ */
+#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 */
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+/*
+ * 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_ISO 7 /* ISO protocols */
+#define AF_OSI AF_ISO
+#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 /* DEC Direct data link interface */
+#define AF_LAT 14 /* LAT */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_APPLETALK 16 /* Apple Talk */
+#define AF_ROUTE 17 /* Internal Routing Protocol */
+#define AF_LINK 18 /* Link layer interface */
+#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+#define AF_RMP 20 /* HP's Remote Maint Protocol */
+#define AF_MAX 21
+
+/*
+ * Structure used by kernel to store most
+ * addresses.
+ */
+struct sockaddr {
+ u_char sa_len; /* total length */
+ u_char sa_family; /* address family */
+ char sa_data[14]; /* actually longer; address value */
+};
+
+/*
+ * Structure used by kernel to pass protocol
+ * information in raw sockets.
+ */
+struct sockproto {
+ u_short sp_family; /* address family */
+ u_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_ISO AF_ISO
+#define PF_OSI AF_ISO
+#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_ROUTE AF_ROUTE
+#define PF_LINK AF_LINK
+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
+#define PF_RMP AF_RMP
+
+#define PF_MAX AF_MAX
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ * Used value-result for recvmsg, value only for sendmsg.
+ */
+struct msghdr {
+ caddr_t msg_name; /* optional address */
+ u_int msg_namelen; /* size of address */
+ struct iovec *msg_iov; /* scatter/gather array */
+ u_int msg_iovlen; /* # elements in msg_iov */
+ caddr_t msg_control; /* ancillary data, see below */
+ u_int msg_controllen; /* ancillary data buffer len */
+ int msg_flags; /* flags on received message */
+};
+
+#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_EOR 0x8 /* data completes record */
+#define MSG_TRUNC 0x10 /* data discarded before delivery */
+#define MSG_CTRUNC 0x20 /* control data lost before delivery */
+#define MSG_WAITALL 0x40 /* wait for full request or error */
+
+/*
+ * Header for ancillary data objects in msg_control buffer.
+ * Used for additional information with/about a datagram
+ * not expressible by flags. The format is a sequence
+ * of message elements headed by cmsghdr structures.
+ */
+struct cmsghdr {
+ u_int cmsg_len; /* data byte count, including hdr */
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+/* followed by u_char cmsg_data[]; */
+};
+
+/* given pointer to struct adatahdr, return pointer to data */
+#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
+
+/* given pointer to struct adatahdr, return pointer to next adatahdr */
+#define CMSG_NXTHDR(mhdr, cmsg) \
+ (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
+ (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
+ (struct cmsghdr *)NULL : \
+ (struct cmsghdr *)((caddr_t)(cmsg) + ALIGN((cmsg)->cmsg_len)))
+
+#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
+
+/* "Socket"-level control message types: */
+#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+
+/*
+ * 4.3 compat sockaddr, move to compat file later
+ */
+struct osockaddr {
+ u_short sa_family; /* address family */
+ char sa_data[14]; /* up to 14 bytes of direct address */
+};
+
+/*
+ * 4.3-compat message header (move to compat file later).
+ */
+struct omsghdr {
+ 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;
+};
+
+#ifndef KERNEL
+
+#include <sys/cdefs.h>
+
+__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 getpeername __P_((int, struct sockaddr *, int *));
+int getsockname __P_((int, struct sockaddr *, int *));
+int getsockopt __P_((int, int, int, void *, int *));
+int listen __P_((int, int));
+ssize_t recv __P_((int, void *, size_t, int));
+ssize_t recvfrom __P_((int, void *, size_t, int,
+ struct sockaddr *, int *));
+int recvmsg __P_((int, struct msghdr *, int));
+ssize_t send __P_((int, const void *, size_t, int));
+ssize_t sendto __P_((int, const void *, size_t, int,
+ const struct sockaddr *, int));
+int sendmsg __P_((int, const struct msghdr *, int));
+int setsockopt __P_((int, int, int, const void *, int));
+int shutdown __P_((int, int));
+int socket __P_((int, int, int));
+int socketpair __P_((int, int, int, int *));
+__END_DECLS
+
+#endif /* !KERNEL */
+#endif /* _SYS_SOCKET_H_ */
diff --git a/mit-pthreads/machdep/freebsd-1.1/timers.h b/mit-pthreads/machdep/freebsd-1.1/timers.h
new file mode 100755
index 00000000000..3c4d057976a
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-1.1/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/freebsd-2.0/__math.h b/mit-pthreads/machdep/freebsd-2.0/__math.h
new file mode 100755
index 00000000000..27ed0f2575d
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__math.h
@@ -0,0 +1,6 @@
+/*
+ * ANSI/POSIX
+ */
+extern char __infinity[];
+#define HUGE_VAL (*(double *) __infinity)
+
diff --git a/mit-pthreads/machdep/freebsd-2.0/__path.h b/mit-pthreads/machdep/freebsd-2.0/__path.h
new file mode 100755
index 00000000000..432494daafa
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__path.h
@@ -0,0 +1,14 @@
+/*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/share/zoneinfo"
+#define _PATH_TZFILE "/etc/localtime"
+
+#endif /* !_SYS__PATH_H_ */
+
diff --git a/mit-pthreads/machdep/freebsd-2.0/__signal.h b/mit-pthreads/machdep/freebsd-2.0/__signal.h
new file mode 100755
index 00000000000..918955c9948
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__signal.h
@@ -0,0 +1,8 @@
+#include <sys/signal.h>
+
+#define __SIGEMPTYSET 0
+#define __SIGFILLSET 0xffffffff
+#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
+#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
+#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
+
diff --git a/mit-pthreads/machdep/freebsd-2.0/__stdio.h b/mit-pthreads/machdep/freebsd-2.0/__stdio.h
new file mode 100755
index 00000000000..d60b9df7a54
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__stdio.h
@@ -0,0 +1,8 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/freebsd-2.0/__stdlib.h b/mit-pthreads/machdep/freebsd-2.0/__stdlib.h
new file mode 100755
index 00000000000..5ee2b8ed3d9
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__stdlib.h
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#ifdef _BSD_WCHAR_T_
+typedef _BSD_WCHAR_T_ wchar_t;
+#ifdef _BSD_RUNE_T_
+typedef _BSD_RUNE_T_ rune_t;
+#undef _BSD_RUNE_T_
+#else
+typedef _BSD_WCHAR_T_ rune_t;
+#endif
+#undef _BSD_WCHAR_T_
+#endif
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/freebsd-2.0/__string.h b/mit-pthreads/machdep/freebsd-2.0/__string.h
new file mode 100755
index 00000000000..93d4fcf9dd2
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__string.h
@@ -0,0 +1,21 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+/* Non-standard NetBSD 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 *));
+void strmode __P_((int, char *));
+char *strsep __P_((char **, const char *));
+__END_DECLS
+#endif
+
diff --git a/mit-pthreads/machdep/freebsd-2.0/__time.h b/mit-pthreads/machdep/freebsd-2.0/__time.h
new file mode 100755
index 00000000000..5c4b722bc3c
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__time.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__TIME_H_
+#define _SYS__TIME_H_
+
+#include <machine/ansi.h>
+#include <machine/limits.h>
+
+#ifdef _BSD_CLOCK_T_
+typedef _BSD_CLOCK_T_ clock_t;
+#undef _BSD_CLOCK_T_
+#endif
+
+#ifdef _BSD_TIME_T_
+typedef _BSD_TIME_T_ time_t;
+#undef _BSD_TIME_T_
+#endif
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#define CLOCKS_PER_SEC 100
+
+#if !defined(CLK_TCK)
+#define CLK_TCK 100
+#endif /* not CLK_TCK */
+
+#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/freebsd-2.0/__unistd.h b/mit-pthreads/machdep/freebsd-2.0/__unistd.h
new file mode 100755
index 00000000000..ed5b0657727
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/__unistd.h
@@ -0,0 +1,113 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define ioctl_request_type unsigned long /* For fd.c */
+
+/* compile-time symbolic constants */
+#define _POSIX_JOB_CONTROL /* implementation supports job control */
+
+#ifdef _NOT_AVAILABLE
+#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
+#endif
+
+#ifndef _POSIX_VERSION
+#define _POSIX_VERSION 198808L
+#endif
+#ifndef _POSIX2_VERSION
+#define _POSIX2_VERSION 199212L
+#endif
+
+/* execution-time symbolic constants */
+ /* chown requires appropriate privileges */
+#define _POSIX_CHOWN_RESTRICTED 1
+ /* too-long path components generate errors */
+#define _POSIX_NO_TRUNC 1
+ /* may disable terminal special characters */
+#define _POSIX_VDISABLE 0xff
+
+/* configurable pathname variables */
+#define _PC_LINK_MAX 1
+#define _PC_MAX_CANON 2
+#define _PC_MAX_INPUT 3
+#define _PC_NAME_MAX 4
+#define _PC_PATH_MAX 5
+#define _PC_PIPE_BUF 6
+#define _PC_CHOWN_RESTRICTED 7
+#define _PC_NO_TRUNC 8
+#define _PC_VDISABLE 9
+
+/* configurable system variables */
+#define _SC_ARG_MAX 1
+#define _SC_CHILD_MAX 2
+#define _SC_CLK_TCK 3
+#define _SC_NGROUPS_MAX 4
+#define _SC_OPEN_MAX 5
+#define _SC_JOB_CONTROL 6
+#define _SC_SAVED_IDS 7
+#define _SC_VERSION 8
+#define _SC_BC_BASE_MAX 9
+#define _SC_BC_DIM_MAX 10
+#define _SC_BC_SCALE_MAX 11
+#define _SC_BC_STRING_MAX 12
+#define _SC_COLL_WEIGHTS_MAX 13
+#define _SC_EXPR_NEST_MAX 14
+#define _SC_LINE_MAX 15
+#define _SC_RE_DUP_MAX 16
+#define _SC_2_VERSION 17
+#define _SC_2_C_BIND 18
+#define _SC_2_C_DEV 19
+#define _SC_2_CHAR_TERM 20
+#define _SC_2_FORT_DEV 21
+#define _SC_2_FORT_RUN 22
+#define _SC_2_LOCALEDEF 23
+#define _SC_2_SW_DEV 24
+#define _SC_2_UPE 25
+#define _SC_STREAM_MAX 26
+#define _SC_TZNAME_MAX 27
+
+/* configurable system strings */
+#define _CS_PATH 1
+
+#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/compat.h b/mit-pthreads/machdep/freebsd-2.0/compat.h
new file mode 100755
index 00000000000..e7de318aa88
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/compat.h
@@ -0,0 +1,43 @@
+/* ==== 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 : COmpat header to make socket code compile.
+ *
+ * 1.00 94/08/01 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/dirent.h b/mit-pthreads/machdep/freebsd-2.0/dirent.h
new file mode 100755
index 00000000000..5226443f86b
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/freebsd-2.0/errno.h b/mit-pthreads/machdep/freebsd-2.0/errno.h
new file mode 100755
index 00000000000..3da61d692a3
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/errno.h
@@ -0,0 +1,160 @@
+/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#endif
+#define EBUSY 16 /* Device busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define ETXTBSY 26 /* Text file busy */
+#endif
+#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 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define EAGAIN 35 /* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define EWOULDBLOCK EAGAIN /* 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 */
+#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 */
+
+/* ipc/network software -- 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 /* Operation timed out */
+#define ECONNREFUSED 61 /* Connection refused */
+
+#define ELOOP 62 /* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define ENAMETOOLONG 63 /* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+#endif /* _POSIX_SOURCE */
+#define ENOTEMPTY 66 /* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#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 */
+#define EBADRPC 72 /* RPC struct is bad */
+#define ERPCMISMATCH 73 /* RPC version wrong */
+#define EPROGUNAVAIL 74 /* RPC prog. not avail */
+#define EPROGMISMATCH 75 /* Program version wrong */
+#define EPROCUNAVAIL 76 /* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define ENOLCK 77 /* No locks available */
+#define ENOSYS 78 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define EFTYPE 79 /* Inappropriate file type or format */
+#define EAUTH 80 /* Authentication error */
+#define ENEEDAUTH 81 /* Need authenticator */
+#define ELAST 81 /* Must be equal largest errno */
+#endif /* _POSIX_SOURCE */
+
+#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/timers.h b/mit-pthreads/machdep/freebsd-2.0/timers.h
new file mode 100755
index 00000000000..f9768c68c8f
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/timers.h
@@ -0,0 +1,45 @@
+/* ==== 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/time.h>
+
+#endif
diff --git a/mit-pthreads/machdep/freebsd-2.0/wait.h b/mit-pthreads/machdep/freebsd-2.0/wait.h
new file mode 100755
index 00000000000..7861e3fa180
--- /dev/null
+++ b/mit-pthreads/machdep/freebsd-2.0/wait.h
@@ -0,0 +1,162 @@
+/*
+ * 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.
+ *
+ * @(#)wait.h 8.1 (Berkeley) 6/2/93
+ * $Id$
+ */
+
+#ifndef _SYS_WAIT_H_
+#define _SYS_WAIT_H_
+
+/*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+/*
+ * Macros to test the exit status returned by wait
+ * and extract the relevant values.
+ */
+#ifdef _POSIX_SOURCE
+#define _W_INT(i) (i)
+#else
+#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
+#define WCOREFLAG 0200
+#endif
+
+#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
+
+/*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#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 */
+
+#include <machine/endian.h>
+
+/*
+ * Deprecated:
+ * Structure of the information in the status word returned by wait4.
+ * If w_stopval==WSTOPPED, then the second structure describes
+ * the information returned, else the first.
+ */
+union wait {
+ int w_status; /* used in syscall */
+ /*
+ * Terminated process status.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Termsig:7, /* termination signal */
+ w_Coredump:1, /* core dump indicator */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Coredump:1, /* core dump indicator */
+ w_Termsig:7; /* termination signal */
+#endif
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Stopval:8; /* == W_STOPPED if stopped */
+#endif
+ } w_S;
+};
+#define w_termsig w_T.w_Termsig
+#define w_coredump w_T.w_Coredump
+#define w_retcode w_T.w_Retcode
+#define w_stopval w_S.w_Stopval
+#define w_stopsig w_S.w_Stopsig
+
+#define WSTOPPED _WSTOPPED
+#endif /* _POSIX_SOURCE */
+
+#ifndef KERNEL
+#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 *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+__END_DECLS
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/hpux-10.20/__math.h b/mit-pthreads/machdep/hpux-10.20/__math.h
new file mode 100755
index 00000000000..8066bd60713
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/__math.h
@@ -0,0 +1,3 @@
+#define HUGE_VAL 1.7976931348623157e+308
+
+
diff --git a/mit-pthreads/machdep/hpux-10.20/__signal.h b/mit-pthreads/machdep/hpux-10.20/__signal.h
new file mode 100755
index 00000000000..fbb1d6ce2b1
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/__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-10.20/__stdio.h b/mit-pthreads/machdep/hpux-10.20/__stdio.h
new file mode 100755
index 00000000000..b8f1a07d9d6
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/__stdio.h
@@ -0,0 +1,11 @@
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+#include <sys/types.h>
+/*
+typedef pthread_fpos_t fpos_t;
+*/
+
diff --git a/mit-pthreads/machdep/hpux-10.20/__stdlib.h b/mit-pthreads/machdep/hpux-10.20/__stdlib.h
new file mode 100755
index 00000000000..37a14a960d5
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/__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-10.20/__string.h b/mit-pthreads/machdep/hpux-10.20/__string.h
new file mode 100755
index 00000000000..1badf6d660c
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/__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-10.20/__time.h b/mit-pthreads/machdep/hpux-10.20/__time.h
new file mode 100755
index 00000000000..ae958dcc3cf
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/__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-10.20/__unistd.h b/mit-pthreads/machdep/hpux-10.20/__unistd.h
new file mode 100755
index 00000000000..218e13d14ec
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/__unistd.h
@@ -0,0 +1,68 @@
+/* /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
+
+#define ioctl_request_type int /* For fd.c */
+
+/* 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-10.20/cdefs.h b/mit-pthreads/machdep/hpux-10.20/cdefs.h
new file mode 100755
index 00000000000..643089e6df6
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/cdefs.h
@@ -0,0 +1,67 @@
+/* ==== 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_
+
+#include <sys/_inttypes.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-10.20/compat.h b/mit-pthreads/machdep/hpux-10.20/compat.h
new file mode 100755
index 00000000000..5a59434417c
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/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-10.20/dirent.h b/mit-pthreads/machdep/hpux-10.20/dirent.h
new file mode 100755
index 00000000000..5f17af345db
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/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-10.20/socket.h b/mit-pthreads/machdep/hpux-10.20/socket.h
new file mode 100755
index 00000000000..c7a37706940
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/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-10.20/stdtypes.h b/mit-pthreads/machdep/hpux-10.20/stdtypes.h
new file mode 100755
index 00000000000..2b22abbf818
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/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-10.20/time.h b/mit-pthreads/machdep/hpux-10.20/time.h
new file mode 100755
index 00000000000..544905b0749
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/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-10.20/timers.h b/mit-pthreads/machdep/hpux-10.20/timers.h
new file mode 100755
index 00000000000..5a76a295400
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/timers.h
@@ -0,0 +1,71 @@
+/* ==== 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/signal.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-10.20/uio.h b/mit-pthreads/machdep/hpux-10.20/uio.h
new file mode 100755
index 00000000000..d1ec4c94f22
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/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-10.20/wait.h b/mit-pthreads/machdep/hpux-10.20/wait.h
new file mode 100755
index 00000000000..bca70d9f1ec
--- /dev/null
+++ b/mit-pthreads/machdep/hpux-10.20/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
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
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/__math.h b/mit-pthreads/machdep/i386-sco-3.2v5/__math.h
new file mode 100755
index 00000000000..4852683fcbf
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/__math.h
@@ -0,0 +1,219 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/__math.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/__math.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/__math.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/__math.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/__math.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___MATH_H
+#define ___MATH_H
+
+#pragma comment(exestr, "xpg4plus @(#) math.h 20.1 94/12/04 ")
+
+#pragma pack(4)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern double acos(double);
+extern double asin(double);
+extern double atan(double);
+extern double atan2(double, double);
+extern double cos(double);
+extern double sin(double);
+extern double tan(double);
+
+extern double cosh(double);
+extern double sinh(double);
+extern double tanh(double);
+
+extern double exp(double);
+extern double frexp(double, int *);
+extern double ldexp(double, int);
+extern double log(double);
+extern double log10(double);
+extern double modf(double, double *);
+
+extern double pow(double, double);
+extern double sqrt(double);
+
+extern double ceil(double);
+extern double fabs(double);
+extern double floor(double);
+extern double fmod(double, double);
+
+#ifndef HUGE_VAL
+extern const double __huge_val;
+#define HUGE_VAL (+__huge_val)
+#endif
+
+
+extern double erf(double);
+extern double erfc(double);
+extern double gamma(double);
+extern double hypot(double, double);
+extern double j0(double);
+extern double j1(double);
+extern double jn(int, double);
+extern double y0(double);
+extern double y1(double);
+extern double yn(int, double);
+extern double lgamma(double);
+extern int isnan(double);
+
+#define MAXFLOAT ((float)3.40282346638528860e+38)
+
+
+
+#define HUGE MAXFLOAT
+
+/*
+ * The following are all legal as XPG4 external functions but must only
+ * be declared in the non standards environments as they conflict with
+ * the user name space
+ */
+
+extern long double frexpl(long double, int *);
+extern long double ldexpl(long double, int);
+extern long double modfl(long double, long double *);
+
+extern float acosf(float);
+extern float asinf(float);
+extern float atanf(float);
+extern float atan2f(float, float);
+extern float cosf(float);
+extern float sinf(float);
+extern float tanf(float);
+
+extern float coshf(float);
+extern float sinhf(float);
+extern float tanhf(float);
+
+extern float expf(float);
+extern float logf(float);
+extern float log10f(float);
+
+extern float powf(float, float);
+extern float sqrtf(float);
+
+extern float ceilf(float);
+extern float fabsf(float);
+extern float floorf(float);
+extern float fmodf(float, float);
+extern float modff(float, float *);
+
+/* These are all extensions from XPG4 */
+
+extern double atof(const char *);
+extern double scalb(double, double);
+extern double logb(double);
+extern double log1p(double);
+extern double nextafter(double, double);
+extern double acosh(double);
+extern double asinh(double);
+extern double atanh(double);
+extern double cbrt(double);
+extern double copysign(double, double);
+extern double expm1(double);
+extern int ilogb(double);
+extern double remainder(double, double);
+extern double rint(double);
+extern int unordered(double, double);
+extern int finite(double);
+
+extern long double scalbl(long double, long double);
+extern long double logbl(long double);
+extern long double nextafterl(long double, long double);
+extern int unorderedl(long double, long double);
+extern int finitel(long double);
+
+
+
+
+extern int signgam;
+
+#define M_E 2.7182818284590452354
+#define M_LOG2E 1.4426950408889634074
+#define M_LOG10E 0.43429448190325182765
+#define M_LN2 0.69314718055994530942
+#define M_LN10 2.30258509299404568402
+#define M_PI 3.14159265358979323846
+#define M_PI_2 1.57079632679489661923
+#define M_PI_4 0.78539816339744830962
+#define M_1_PI 0.31830988618379067154
+#define M_2_PI 0.63661977236758134308
+#define M_2_SQRTPI 1.12837916709551257390
+#define M_SQRT2 1.41421356237309504880
+#define M_SQRT1_2 0.70710678118654752440
+
+
+
+#define _ABS(x) ((x) < 0 ? -(x) : (x))
+
+#define _REDUCE(TYPE, X, XN, C1, C2) { \
+ double x1 = (double)(TYPE)X, x2 = X - x1; \
+ X = x1 - (XN) * (C1); X += x2; X -= (XN) * (C2); }
+
+#define DOMAIN 1
+#define SING 2
+#define OVERFLOW 3
+#define UNDERFLOW 4
+#define TLOSS 5
+#define PLOSS 6
+
+#define _POLY1(x, c) ((c)[0] * (x) + (c)[1])
+#define _POLY2(x, c) (_POLY1((x), (c)) * (x) + (c)[2])
+#define _POLY3(x, c) (_POLY2((x), (c)) * (x) + (c)[3])
+#define _POLY4(x, c) (_POLY3((x), (c)) * (x) + (c)[4])
+#define _POLY5(x, c) (_POLY4((x), (c)) * (x) + (c)[5])
+#define _POLY6(x, c) (_POLY5((x), (c)) * (x) + (c)[6])
+#define _POLY7(x, c) (_POLY6((x), (c)) * (x) + (c)[7])
+#define _POLY8(x, c) (_POLY7((x), (c)) * (x) + (c)[8])
+#define _POLY9(x, c) (_POLY8((x), (c)) * (x) + (c)[9])
+
+
+#ifdef __cplusplus
+}
+inline int sqr(int i) {return(i*i);}
+inline double sqr(double i) {return(i*i);}
+
+#endif /* __cplusplus */
+
+#pragma pack()
+
+#if __cplusplus && !defined(PI)
+#define PI M_PI
+#endif /* __cplusplus */
+
+#endif /* _MATH_H */
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/__signal.h b/mit-pthreads/machdep/i386-sco-3.2v5/__signal.h
new file mode 100755
index 00000000000..6a33d37a261
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/__signal.h
@@ -0,0 +1,109 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <sys/oldstyle/signal.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/signal.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <sys/posix/__signal.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <sys/ansi/signal.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <sys/ods_30_compat/signal.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___SIGNAL_H
+#define ___SIGNAL_H
+
+#pragma comment(exestr, "xpg4plus @(#) signal.h 20.3 94/12/19 ")
+
+#ifndef _SIG_ATOMIC_T
+#define _SIG_ATOMIC_T
+ /* atomic entity for signal handling */
+typedef int sig_atomic_t;
+#endif
+
+extern const char * const _sys_siglist[];
+extern const int _sys_nsig;
+
+#ifndef _SYS_SIGNAL_H
+#include <sys/signal.h>
+#endif
+
+#define SignalBad ((SignalHandler)-1)
+#define SignalDefault ((SignalHandler)0)
+#define SignalIgnore ((SignalHandler)1)
+
+#define __sigmask(sig) (1 << ((sig) - 1))
+#define __SIGEMPTYSET (~SIGALL)
+#define __SIGFILLSET SIGALL
+#define __SIGADDSET(s,n) ((*s) |= (__sigmask(n)))
+#define __SIGDELSET(s,n) ((*s) &= ~(__sigmask(n)))
+#define __SIGISMEMBER(s,n) ((*s) & (__sigmask(n)))
+
+#if !defined(_SYS_TYPES_H)
+#include <sys/types.h>
+#endif
+
+
+#if __cplusplus
+extern "C" {
+#endif
+
+extern void (*signal(int, void(*)(int)))(int);
+extern int raise(int);
+
+extern void (*bsd_signal(int, void(*)(int)))(int);
+extern int ( *ssignal( int, int(*)(int) ) )(int);
+extern void ( *sigset( int, void(*)(int) ) )(int);
+extern int killpg(pid_t, int);
+#ifdef SS_ONSTACK /* Not defined on old versions of the OS */
+extern int sigaltstack(const stack_t *, stack_t *);
+extern int sigstack(struct sigstack *, struct sigstack *);
+#endif
+extern int sighold(int);
+extern int sigignore(int);
+extern int siginterrupt(int, int);
+extern int sigpause(int);
+extern int sigrelse(int);
+
+extern int (sigfillset)(sigset_t *);
+extern int (sigemptyset)(sigset_t *);
+extern int (sigaddset)(sigset_t *, int);
+extern int (sigdelset)(sigset_t *, int);
+extern int (sigismember)(const sigset_t *, int);
+extern int sigpending(sigset_t *);
+extern int sigsuspend(const sigset_t *);
+extern int sigprocmask(int, const sigset_t *, sigset_t *);
+extern int kill(pid_t, int);
+extern int sigaction(int, const struct sigaction *, struct sigaction *);
+
+#if __cplusplus
+};
+#endif
+
+
+#endif /* ___SIGNAL_H */
+
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/__stdio.h b/mit-pthreads/machdep/i386-sco-3.2v5/__stdio.h
new file mode 100755
index 00000000000..f19672980ec
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/__stdio.h
@@ -0,0 +1,113 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/__stdio.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/__stdio.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/__stdio.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/__stdio.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/__stdio.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1984-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___STDIO_H
+#define ___STDIO_H
+
+#pragma comment(exestr, "xpg4plus @(#) stdio.h 20.1 94/12/04 ")
+
+#pragma pack(4)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#ifndef _FPOS_T
+#define _FPOS_T
+typedef long fpos_t;
+#endif
+
+#ifndef _WCHAR_T
+#define _WCHAR_T
+typedef long wchar_t;
+#endif
+
+#ifndef _WINT_T
+#define _WINT_T
+typedef long wint_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+#ifndef EOF
+#define EOF (-1)
+#endif
+
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+
+#ifndef TMP_MAX
+#define TMP_MAX 17576 /* 26 * 26 * 26 */
+#endif
+
+#define BUFSIZ 1024 /* default buffer size */
+
+
+#define _IOEOF 0020 /* EOF reached on read */
+#define _IOERR 0040 /* I/O error from system */
+
+#define _IOREAD 0001 /* currently reading */
+#define _IOWRT 0002 /* currently writing */
+#define _IORW 0200 /* opened for reading and writing */
+#define _IOMYBUF 0010 /* stdio malloc()'d buffer */
+
+#define _SBFSIZ 8
+
+#define L_cuserid 9
+
+/* Non name space polluting version of above */
+#define _P_tmpdir "/usr/tmp/"
+
+#ifndef _VA_LIST
+#define _VA_LIST char *
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack()
+
+#endif /* ___STDIO_H */
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/__stdlib.h b/mit-pthreads/machdep/i386-sco-3.2v5/__stdlib.h
new file mode 100755
index 00000000000..db6a8a56151
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/__stdlib.h
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 1984-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___STDLIB_H
+#define ___STDLIB_H
+
+#pragma comment(exestr, "posix @(#) stdlib.h 20.1 94/12/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(4)
+
+#ifndef _DIV_T
+#define _DIV_T
+typedef struct
+{
+ int quot;
+ int rem;
+} div_t;
+#endif
+
+#ifndef _LDIV_T
+#define _LDIV_T
+typedef struct
+{
+ long quot;
+ long rem;
+} ldiv_t;
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#if !defined(_SSIZE_T)
+#define _SSIZE_T
+typedef int ssize_t;
+#endif
+
+#ifndef _WCHAR_T
+#define _WCHAR_T
+typedef long wchar_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+#define RAND_MAX 077777
+
+
+
+extern unsigned char __ctype[];
+
+#define MB_CUR_MAX ((int)__ctype[520])
+
+extern double atof(const char *);
+extern int atoi(const char *);
+extern long atol(const char *);
+extern double strtod(const char *, char **);
+extern float strtof(const char *, char **);
+extern long strtol(const char *, char **, int);
+extern unsigned long strtoul(const char *, char **, int);
+
+extern int rand(void);
+extern void srand(unsigned int);
+
+extern void *calloc(size_t, size_t);
+extern void free(void *);
+extern void *malloc(size_t);
+extern void *realloc(void *, size_t);
+
+extern void abort(void);
+extern void exit(int);
+extern char *getenv(const char *);
+extern int system(const char *);
+
+extern void *bsearch(const void *, const void *, size_t, size_t,
+ int (*)(const void *, const void *));
+extern void qsort(void *, size_t, size_t,
+ int (*)(const void *, const void *));
+
+#ifdef __cplusplus
+#ifndef _ABS_INL
+#define _ABS_INL
+inline int (abs)(int i) {return (i > 0) ? i : -i;}
+#endif
+#else
+extern int (abs)(int); /* Protect from macro definitions */
+#endif
+
+extern div_t div(int, int);
+extern long labs(long);
+extern ldiv_t ldiv(long, long);
+
+extern int mbtowc(wchar_t *, const char *, size_t);
+extern int mblen(const char *, size_t);
+extern int wctomb(char *, wchar_t);
+
+extern size_t mbstowcs(wchar_t *, const char *, size_t);
+extern size_t wcstombs(char *, const wchar_t *, size_t);
+
+
+
+
+#define mblen(s, n) mbtowc((wchar_t *)0, s, n)
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack()
+
+#endif /* ___STDLIB_H */
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/__string.h b/mit-pthreads/machdep/i386-sco-3.2v5/__string.h
new file mode 100755
index 00000000000..e4bb93afe5a
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/__string.h
@@ -0,0 +1,125 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/string.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/string.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/string.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/string.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/string.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___STRING_H
+#define ___STRING_H
+
+#pragma comment(exestr, "xpg4plus @(#) string.h 20.1 94/12/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+
+
+extern void *memchr(const void *, int, size_t);
+extern void *memcpy(void *, const void *, size_t);
+extern void *memccpy(void *, const void *, int, size_t);
+extern void *memmove(void *, const void *, size_t);
+extern void *memset(void *, int, size_t);
+
+extern char *strchr(const char *, int);
+extern char *strcpy(char *, const char *);
+extern char *strncpy(char *, const char *, size_t);
+extern char *strcat(char *, const char *);
+extern char *strncat(char *, const char *, size_t);
+extern char *strpbrk(const char *, const char *);
+extern char *strrchr(const char *, int);
+extern char *strstr(const char *, const char *);
+extern char *strtok(char *, const char *);
+extern char *strtok_r(char *, const char *, char **);
+extern char *strerror(int);
+extern char *strlist(char *, const char *, ...);
+
+extern int memcmp(const void *, const void *, size_t);
+extern int strcmp(const char *, const char *);
+extern int strcoll(const char *, const char *);
+extern int strncmp(const char *, const char *, size_t);
+
+extern void perror(const char *);
+extern char *strdup(const char *);
+extern int strncoll(const char *, const char *, int);
+extern size_t strnxfrm(char *, const char *, size_t , int);
+
+extern size_t strxfrm(char *, const char *, size_t);
+extern size_t strcspn(const char *, const char *);
+extern size_t strspn(const char *, const char *);
+extern size_t strlen(const char *);
+
+#ifdef __USLC__
+#pragma int_to_unsigned strcspn
+#pragma int_to_unsigned strspn
+#pragma int_to_unsigned strlen
+#endif
+
+#if !defined(__cplusplus) && defined(__USLC__)
+/* Use intrinsic ??? */
+#ifndef strlen
+#define strlen __std_hdr_strlen
+#endif
+#ifndef strcpy
+#define strcpy __std_hdr_strcpy
+#endif
+#ifndef strncpy
+#define strncpy __std_hdr_strncpy
+#endif
+#endif
+
+
+extern int ffs(int);
+/*
+ * The following two functions were withdrawn in XPG3,
+ * but are provided for backwards compatibility.
+ */
+extern int nl_strcmp(char *, char *);
+extern int nl_strncmp(char *, char *, int n);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ___STRING_H */
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/__time.h b/mit-pthreads/machdep/i386-sco-3.2v5/__time.h
new file mode 100755
index 00000000000..4aeee737601
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/__time.h
@@ -0,0 +1,141 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/time.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/time.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/time.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/time.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/time.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___TIME_H
+#define ___TIME_H
+
+#pragma comment(exestr, "xpg4plus @(#) time.h 20.2 95/01/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef long clock_t;
+#endif
+#ifndef _TIME_T
+#define _TIME_T
+typedef long time_t;
+#endif
+
+#ifdef _POSIXTIMERS
+#include <sys/sudstime.h>
+#endif
+
+#define CLOCKS_PER_SEC 1000000 /* As required by XPG4 and friends */
+
+#pragma pack(4)
+
+#ifndef _STRUCT_TM
+#define _STRUCT_TM
+struct tm
+{
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+#define LTZNMAX 50
+ long tm_tzadj;
+ char tm_name[LTZNMAX]; /* name of timezone */
+};
+
+#pragma pack()
+#endif /* _STRUCT_TM */
+
+
+extern clock_t clock(void);
+extern double difftime(time_t, time_t);
+extern time_t mktime(struct tm *);
+extern time_t time(time_t *);
+extern char *asctime(const struct tm *);
+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 *);
+
+
+extern void tzset(void);
+extern char *tzname[];
+
+#ifndef CLK_TCK
+#define CLK_TCK _sysconf(2) /* 2 is _SC_CLK_TCK */
+#endif
+
+extern long timezone;
+extern int daylight;
+extern char *strptime(const char *, const char *, struct tm *);
+
+
+
+
+#include <sys/timeb.h>
+extern int ftime ( struct timeb * );
+extern char * nl_cxtime( long *, char * );
+extern char * nl_ascxtime( struct tm *, char * );
+extern int cftime(char *, const char *, const time_t *);
+extern int ascftime(char *, const char *, const struct tm *);
+extern long altzone;
+extern struct tm *getdate(const char *);
+extern int getdate_err;
+extern char *asctime_r(const struct tm *, char *,int);
+extern char *ctime_r(const time_t *, char *,int);
+extern struct tm *localtime_r(const time_t *, struct tm *);
+extern struct tm *gmtime_r(const time_t *, struct tm *);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef difftime
+#define difftime(t1, t0) ((double)((t1) - (t0)))
+#endif
+
+#endif /* ___TIME_H */
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/__unistd.h b/mit-pthreads/machdep/i386-sco-3.2v5/__unistd.h
new file mode 100755
index 00000000000..408886301f5
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/__unistd.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __unistd.h,v 1.1 1995/01/03 12:54:54 proven Exp
+ */
+
+#ifndef ___UNISTD_H_
+#define ___UNISTD_H_
+
+#include <sys/types.h>
+#include <stddef.h>
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+#endif
+
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/compat.h b/mit-pthreads/machdep/i386-sco-3.2v5/compat.h
new file mode 100755
index 00000000000..3befbffa68d
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/compat.h
@@ -0,0 +1,46 @@
+/* ==== 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.
+ *
+ * compat.h,v 1.52 1995/10/20 09:32:56 proven Exp
+ *
+ * Description : Basic timers header.
+ *
+ * 1.00 94/06/13 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#include <sys/types.h>
+
+#define omsghdr msghdr
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/dirent.h b/mit-pthreads/machdep/i386-sco-3.2v5/dirent.h
new file mode 100755
index 00000000000..6f6804590bb
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/dirent.h
@@ -0,0 +1,145 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/dirent.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/dirent.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/dirent.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/dirent.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef _DIRENT_H
+#define _DIRENT_H
+
+#pragma comment(exestr, "xpg4plus @(#) dirent.h 20.1 94/12/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(4)
+
+#define MAXNAMLEN 512 /* maximum filename length */
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+#undef DIRBLKSIZ
+#define DIRBLKSIZ 1048 /* buffer size for fs-indep. dirs */
+
+#ifndef _SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+#ifdef __STDC__
+#pragma comment(exestr, "@(#) dirent.h 25.8 94/09/22 ")
+#else
+#ident "@(#) dirent.h 25.8 94/09/22 "
+#endif
+/*
+ * Copyright (C) 1988-1994 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+/* Copyright (c) 1984, 1986, 1987, 1988 AT&T */
+/* 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. */
+
+/* #ident "@)#(head.sys:dirent.h 1.3" */
+
+/*
+ * The following structure defines the file
+ * system independent directory entry.
+ *
+ */
+
+#include <sys/types.h>
+
+#ifdef _M_I386
+#pragma pack(4)
+#else
+#pragma pack(2)
+#endif
+
+#ifdef _INKERNEL
+/*
+ * dirent used by the kernel
+ */
+struct dirent {
+ ino32_t d_ino; /* inode number of entry */
+ off_t d_off; /* offset of disk directory entry */
+ unsigned short d_reclen; /* length of this record */
+ char d_name[MAXNAMLEN+1]; /* name of file */
+};
+
+#else /* !_INKERNEL */
+/*
+ * dirent as used by application code
+ * For now leave the declaration as is. When the new development system
+ * is implemented, ino_t may be ushort or ulong. If ino_t is ulong, there
+ * will be no d_pad field.
+ */
+struct dirent /* data from readdir() */
+ {
+#if defined(_IBCS2)
+ long d_ino;
+#else /* !_IBCS2 */
+ ino_t d_ino; /* inode number of entry */
+#if defined(_INO_16_T)
+ short d_pad; /* because ino_t is ushort */
+#endif /* defined(_INO_16_T) */
+#endif /* defined(_IBCS2) */
+ off_t d_off; /* offset of disk directory entry */
+ unsigned short d_reclen; /* length of this record */
+ char d_name[MAXNAMLEN+1]; /* name of file */
+ };
+#endif /* _INKERNEL */
+
+typedef struct dirent dirent_t;
+
+#pragma pack()
+#endif /* _SYS_DIRENT_H */
+
+#define d_fileno d_ino
+#define d_namlen d_reclen
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack()
+
+#endif /* _DIRENT_H */
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/posix/__signal.h b/mit-pthreads/machdep/i386-sco-3.2v5/posix/__signal.h
new file mode 100755
index 00000000000..5680fc1491a
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/posix/__signal.h
@@ -0,0 +1,69 @@
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___SIGNAL_H
+#define ___SIGNAL_H
+
+#pragma comment(exestr, "posix @(#) signal.h 20.3 94/12/19 ")
+
+#ifndef _SIG_ATOMIC_T
+#define _SIG_ATOMIC_T
+ /* atomic entity for signal handling */
+typedef int sig_atomic_t;
+#endif
+
+
+#ifndef _SYS_SIGNAL_H
+#include <sys/signal.h>
+#endif
+
+#if !defined(_SYS_TYPES_H)
+#include <sys/types.h>
+#endif
+
+
+#if __cplusplus
+extern "C" {
+#endif
+
+extern void (*signal(int, void(*)(int)))(int);
+extern int raise(int);
+
+
+
+extern int (sigfillset)(sigset_t *);
+extern int (sigemptyset)(sigset_t *);
+extern int (sigaddset)(sigset_t *, int);
+extern int (sigdelset)(sigset_t *, int);
+extern int (sigismember)(const sigset_t *, int);
+extern int sigpending(sigset_t *);
+extern int sigsuspend(const sigset_t *);
+extern int sigprocmask(int, const sigset_t *, sigset_t *);
+extern int kill(pid_t, int);
+extern int sigaction(int, const struct sigaction *, struct sigaction *);
+
+#if __cplusplus
+};
+#endif
+
+
+#endif /* ___SIGNAL_H */
+
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/socket.h b/mit-pthreads/machdep/i386-sco-3.2v5/socket.h
new file mode 100755
index 00000000000..4a53c7176f9
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/socket.h
@@ -0,0 +1,490 @@
+/* @(#)socket.h 6.23 7/18/94 - STREAMware TCP/IP source */
+/*
+ * Copyrighted as an unpublished work.
+ * (c) Copyright 1987-1994 Legent Corporation
+ * All rights reserved.
+ *
+ * RESTRICTED RIGHTS
+ *
+ * These programs are supplied under a license. They may be used,
+ * disclosed, and/or copied only as permitted under such license
+ * agreement. Any copy must contain the above copyright notice and
+ * this restricted rights notice. Use, copying, and/or disclosure
+ * of the programs is strictly prohibited unless otherwise provided
+ * in the license agreement.
+ *
+ */
+/* SCCS IDENTIFICATION */
+/*
+ * Copyright (c) 1985 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.
+ */
+
+#ifndef __sys_socket_h
+#define __sys_socket_h
+
+#if !defined(FD_SETSIZE)
+/* Pick up select stuff from standard system include */
+#include <sys/types.h>
+#endif
+
+/* socket.h 6.1 83/07/29 */
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Types
+ */
+#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 */
+#define SO_ORDREL 0x0200 /* give use orderly release */
+#define SO_IMASOCKET 0x0400 /* use socket semantics (affects bind) */
+#define SO_MGMT 0x0800 /* => it is used for mgmt. purposes */
+#define SO_REUSEPORT 0x1000 /* allow local port reuse */
+
+/*
+ * 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_PROTOTYPE 0x1009 /* get/set protocol type */
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+/*
+ * Level number for (get/set)sockopt() to apply to socket itself.
+ */
+#define SOL_SOCKET 0xffff /* options for socket level */
+
+/*
+ * An option specification consists of an opthdr, followed by the value of
+ * the option. An options buffer contains one or more options. The len
+ * field of opthdr specifies the length of the option value in bytes. This
+ * length must be a multiple of sizeof(long) (use OPTLEN macro).
+ */
+
+struct opthdr {
+ long level; /* protocol level affected */
+ long name; /* option to modify */
+ long len; /* length of option value */
+};
+
+#define OPTLEN(x) ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
+#define OPTVAL(opt) ((char *)(opt + 1))
+
+#if defined(INKERNEL) || defined(_KERNEL) || defined(_INKERNEL)
+/*
+ * the optdefault structure is used for internal tables of option default
+ * values.
+ */
+struct optdefault {
+ int optname;/* the option */
+ char *val; /* ptr to default value */
+ int len; /* length of value */
+};
+
+/*
+ * the opproc structure is used to build tables of options processing
+ * functions for in_dooptions().
+ */
+struct opproc {
+ int level; /* options level this function handles */
+ int (*func) (); /* the function */
+};
+#endif
+
+/*
+ * 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_ISO 7 /* ISO protocols */
+#define AF_OSI AF_ISO
+#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_ROUTE 17 /* Internal Routing Protocol */
+#define AF_LINK 18 /* Link layer interface */
+#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+
+#define AF_MAX 20
+
+/*
+ * Structure used by kernel to store most addresses.
+ */
+struct sockaddr {
+ u_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_ROUTE AF_ROUTE
+#define PF_LINK AF_LINK
+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
+
+#define PF_MAX AF_MAX
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ * Used value-result for recmvsg, value only for sendmsg.
+ */
+struct msghdr {
+ caddr_t msg_name; /* optional address */
+ u_int msg_namelen; /* size of address */
+ struct iovec *msg_iov; /* scatter/gather array */
+ u_int msg_iovlen; /* # elements msg_iov */
+ caddr_t msg_control; /* ancillary data, see below */
+ u_int msg_controllen; /* ancillary data buffer len */
+ int msg_flags; /* flags on received message */
+};
+#define msg_accrights msg_control
+#define msg_accrightslen msg_controllen
+
+#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_EOR 0x8 /* data completes record */ /*notused*/
+#define MSG_TRUNC 0x10 /* data discarded before delivery */
+#define MSG_CTRUNC 0x20 /* control data lost before delivery */
+#define MSG_WAITALL 0x40 /* wait for full request or error */ /*notused*/
+
+#define MSG_MAXIOVLEN 16
+
+/*
+ * Header for ancillary data objects in msg_control buffer.
+ * Used for additional information with/about a datagram
+ * not expressible by flags. The format is a sequence
+ * of message elements headed by cmsghdr structures.
+ * In STREAMware, we shuffle the fields around a little from what
+ * they were in net-2, so that they line up the same as an opthdr
+ * which simplifies our socket implementation amazingly.
+ *
+ * Unfortunately, the opthdrs don't include their own length, which the
+ * cmsghdrs do. What this means is that TLI programmers will not be
+ * able to take something returned using these macros and immediately give
+ * it back to the stack. The size of the struct cmsghdr will have to be
+ * subtracted out.
+ * There doesn't seem to be a way to avoid this, since several applications
+ * look into the cmsg_len field and won't work if it doesn't include the size
+ * of the struct cmsghdr.
+ */
+struct cmsghdr {
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+ u_int cmsg_len; /* data byte count, including hdr */
+/* followed by u_char cmsg_data[]; */
+};
+
+/* given pointer to struct adatahdr, return pointer to data */
+#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
+
+/* given pointer to struct adatahdr, return pointer to next adatahdr */
+#define CMSG_NXTHDR(mhdr, cmsg) \
+ (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
+ (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
+ (struct cmsghdr *)NULL : \
+ (struct cmsghdr *)((caddr_t)(cmsg) + OPTLEN((cmsg)->cmsg_len)))
+
+#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
+
+/* "Socket"-level control message types: */
+#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+
+/*
+ * This ioctl code uses BSD style ioctls to avoid copyin/out problems.
+ * Ioctls 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 128 bytes.
+ */
+#define IOCPARM_MASK 0x7f /* parameters must be < 128 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 ioctls from old */
+#define _IOS(x,y) (IOC_VOID|(x<<8)|y)
+#define _IOSR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+#define _IOSW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+/* this should be _IOSRW, but stdio got there first */
+#define _IOSWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+
+/*
+ * Socket ioctl commands
+ */
+
+#define SIOCSHIWAT _IOSW('S', 1, int) /* set high watermark */
+#define SIOCGHIWAT _IOSR('S', 2, int) /* get high watermark */
+#define SIOCSLOWAT _IOSW('S', 3, int) /* set low watermark */
+#define SIOCGLOWAT _IOSR('S', 4, int) /* get low watermark */
+#define SIOCATMARK _IOSR('S', 5, int) /* at oob mark? */
+#define SIOCSPGRP _IOSW('S', 6, int) /* set process group */
+#define SIOCGPGRP _IOSR('S', 7, int) /* get process group */
+#define FIONREAD _IOSR('S', 8, int) /* BSD compatibilty */
+#define FIONBIO _IOSW('S', 9, int) /* BSD compatibilty */
+#define FIOASYNC _IOSW('S', 10, int) /* BSD compatibilty */
+#define SIOCPROTO _IOSW('S', 11, struct socknewproto) /* link proto */
+#define SIOCGETNAME _IOSR('S', 12, struct sockaddr) /* getsockname */
+#define SIOCGETPEER _IOSR('S', 13, struct sockaddr) /* getpeername */
+#define IF_UNITSEL _IOSW('S', 14, int) /* set unit number */
+#define SIOCXPROTO _IOS('S', 15) /* empty proto table */
+#define SIOCSHRDTYPE _IOSW('S', 16, int) /* set hardware type */
+
+#define SIOCADDRT _IOSW('R', 9, struct ortentry) /* add route */
+#define SIOCDELRT _IOSW('R', 10, struct ortentry) /* delete route */
+
+#define SIOCSIFADDR _IOSW('I', 11, struct ifreq) /* set ifnet address */
+#define SIOCGIFADDR _IOSWR('I', 12, struct ifreq) /* get ifnet address */
+#define SIOCSIFDSTADDR _IOSW('I', 13, struct ifreq) /* set p-p address */
+#define SIOCGIFDSTADDR _IOSWR('I', 14, struct ifreq) /* get p-p address */
+#define SIOCSIFFLAGS _IOSW('I', 15, struct ifreq) /* set ifnet flags */
+#define SIOCGIFFLAGS _IOSWR('I', 16, struct ifreq) /* get ifnet flags */
+#define SIOCGIFCONF _IOSWR('I', 17, struct ifconf) /* get ifnet list */
+
+#define SIOCSIFMTU _IOSW('I', 21, struct ifreq) /* get if_mtu */
+#define SIOCGIFMTU _IOSWR('I', 22, struct ifreq) /* set if_mtu */
+
+
+#define SIOCGIFBRDADDR _IOSWR('I', 32, struct ifreq) /* get broadcast addr */
+#define SIOCSIFBRDADDR _IOSW('I', 33, struct ifreq) /* set broadcast addr */
+#define SIOCGIFNETMASK _IOSWR('I', 34, struct ifreq) /* get net addr mask */
+#define SIOCSIFNETMASK _IOSW('I', 35, struct ifreq) /* set net addr mask */
+#define SIOCGIFMETRIC _IOSWR('I', 36, struct ifreq) /* get IF metric */
+#define SIOCSIFMETRIC _IOSW('I', 37, struct ifreq) /* set IF metric */
+
+#define SIOCSARP _IOSW('I', 38, struct arpreq) /* set arp entry */
+#define SIOCGARP _IOSWR('I', 39, struct arpreq) /* get arp entry */
+#define SIOCDARP _IOSW('I', 40, struct arpreq) /* delete arp entry */
+
+#define SIOCSIFNAME _IOSW('I', 41, struct ifreq) /* set interface name */
+#define SIOCGIFONEP _IOSWR('I', 42, struct ifreq) /* get one-packet params */
+#define SIOCSIFONEP _IOSW('I', 43, struct ifreq) /* set one-packet params */
+#define SIOCDIFADDR _IOSW('I', 44, struct ifreq) /* delete IF addr */
+#define SIOCAIFADDR _IOSW('I', 45, struct ifaliasreq) /*add/change IF alias*/
+#define SIOCADDMULTI _IOSW('I', 49, struct ifreq) /* add m'cast addr */
+#define SIOCDELMULTI _IOSW('I', 50, struct ifreq) /* del m'cast addr */
+#define SIOCGIFALIAS _IOSWR('I', 51, struct ifaliasreq) /* get IF alias */
+
+
+#define SIOCSOCKSYS _IOSW('I', 66, struct socksysreq) /* Pseudo socket syscall */
+
+/* these use ifr_metric to pass the information */
+#define SIOCSIFDEBUG _IOSW('I', 67, struct ifreq) /* set if debug level */
+#define SIOCGIFDEBUG _IOSWR('I', 68, struct ifreq) /* get if debug level */
+
+#define SIOCSIFTYPE _IOSW('I', 69, struct ifreq) /* set if MIB type */
+#define SIOCGIFTYPE _IOSWR('I', 70, struct ifreq) /* get if MIB type */
+
+#define SIOCGIFNUM _IOSR('I', 71, int) /* get number of ifs */
+/*
+ * This returns the number of ifreqs that SIOCGIFCONF would return, including
+ * aliases. This is the preferred way of sizing a buffer big enough to hold
+ * all interfaces.
+ */
+#define SIOCGIFANUM _IOSR('I', 72, int) /* get number of ifreqs */
+/*
+ * Interface specific performance tuning
+ */
+#define SIOCGIFPERF _IOSR('I', 73, struct ifreq) /* get perf info */
+#define SIOCSIFPERF _IOSR('I', 74, struct ifreq) /* get perf info */
+
+/*
+ * This structure is used to encode pseudo system calls
+ */
+struct socksysreq {
+ /* When porting, make this the widest thing it can be */
+ int args[7];
+};
+
+/*
+ * This structure is used for adding new protocols to the list supported by
+ * sockets.
+ */
+struct socknewproto {
+ int family; /* address family (AF_INET, etc.) */
+ int type; /* protocol type (SOCK_STREAM, etc.) */
+ int proto; /* per family proto number */
+ dev_t dev; /* major/minor to use (must be a clone) */
+ int flags; /* protosw flags */
+};
+
+/*
+ * utility definitions.
+ */
+
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(x,y) ((x) < (y) ? (x) : (y))
+#ifndef MAX
+#define MAX(x,y) ((x) > (y) ? (x) : (y))
+#endif
+
+#define MAXHOSTNAMELEN 256
+
+#define NBBY 8 /* number of bits in a byte */
+
+
+/* defines for user/kernel interface */
+
+#define MAX_MINOR (makedev(1,0) - 1) /* could be non-portable */
+
+#define SOCKETSYS 140 /* SCO 3.2v5 */
+
+#define SO_ACCEPT 1
+#define SO_BIND 2
+#define SO_CONNECT 3
+#define SO_GETPEERNAME 4
+#define SO_GETSOCKNAME 5
+#define SO_GETSOCKOPT 6
+#define SO_LISTEN 7
+#define SO_RECV 8
+#define SO_RECVFROM 9
+#define SO_SEND 10
+#define SO_SENDTO 11
+#define SO_SETSOCKOPT 12
+#define SO_SHUTDOWN 13
+#define SO_SOCKET 14
+#define SO_SELECT 15
+#define SO_GETIPDOMAIN 16
+#define SO_SETIPDOMAIN 17
+#define SO_ADJTIME 18
+#define SO_SETREUID 19
+#define SO_SETREGID 20
+#define SO_GETTIME 21
+#define SO_SETTIME 22
+#define SO_GETITIMER 23
+#define SO_SETITIMER 24
+#define SO_RECVMSG 25
+#define SO_SENDMSG 26
+#define SO_SOCKPAIR 27
+
+/*
+ * message flags
+ */
+#define M_BCAST 0x80000000
+
+/* Definitions and structures used for extracting */
+/* the size and/or the contents of kernel tables */
+
+/* Copyin/out values */
+#define GIARG 0x1
+#define CONTI 0x2
+#define GITAB 0x4
+
+struct gi_arg {
+ caddr_t gi_where;
+ unsigned gi_size;
+};
+
+#if !defined(_KERNEL) && !defined(INKERNEL) && !defined(_INKERNEL)
+
+#include <sys/cdefs.h>
+
+__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 getpeername __P_((int, struct sockaddr *, int *));
+int getsockname __P_((int, struct sockaddr *, int *));
+int getsockopt __P_((int, int, int, void *, int *));
+int setsockopt __P_((int, int, int, const void *, int));
+int listen __P_((int, int));
+ssize_t recv __P_((int, void *, size_t, int));
+ssize_t recvfrom __P_((int, void *, size_t, int, struct sockaddr *, int *));
+int recvmsg __P_((int, struct msghdr *, int));
+ssize_t send __P_((int, const void *, size_t, int));
+int sendmsg __P_((int, const struct msghdr *, int));
+ssize_t sendto __P_((int, const void *, size_t, int, const struct sockaddr *, int));
+int shutdown __P_((int, int));
+int socket __P_((int, int, int));
+int socketpair __P_((int, int, int, int[2]));
+__END_DECLS
+
+#endif /* !INKERNEL */
+#endif /* __sys_socket_h */
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/syscall.h b/mit-pthreads/machdep/i386-sco-3.2v5/syscall.h
new file mode 100755
index 00000000000..f49fba81b6e
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/syscall.h
@@ -0,0 +1,175 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/syscall.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/syscall.h>
+#else /* Normal, default environment */
+/*
+/ Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+
+#ident "xpg4plus @(#) sys.i386 20.1 94/12/04 "
+/* #ident "xpg4plus @(#)head:sys.i386 1.2" */
+
+/*
+/* Definitions of Kernel Entry Call Gates
+*/
+
+#ifndef _SYSCALL_H_
+#define _SYSCALL_H_
+
+/*#define SYSCALL $0x7,$0*/
+/*#define SIGCALL $0xF,$0*/
+
+/*
+/* Definitions of System Call Entry Point Numbers
+*/
+
+#define SYS_access 33
+#define SYS_acct 51
+#define SYS_advfs 70
+#define SYS_alarm 27
+#define SYS_break 17
+#define SYS_brk 17
+#define SYS_chdir 12
+#define SYS_chmod 15
+#define SYS_chown 16
+#define SYS_chroot 61
+#define SYS_close 6
+#define SYS_creat 8
+#define SYS_dup 41
+#define SYS_exec 11
+#define SYS_execve 59
+#define SYS_exit 1
+#define SYS_fcntl 62
+#define SYS_fork 2
+#define SYS_fstat 28
+#define SYS_fstatfs 38
+#define SYS_fxstat 125
+#define SYS_getdents 81
+#define SYS_getgid 47
+#define SYS_getmsg 85
+#define SYS_getpid 20
+#define SYS_gettimeofday 171
+#define SYS_getuid 24
+#define SYS_gtty 32
+#define SYS_ioctl 54
+#define SYS_kill 37
+#define SYS_link 9
+#define SYS_lock 45
+#define SYS_lseek 19
+#define SYS_lstat 91
+#define SYS_lxstat 124
+#define SYS_mkdir 80
+#define SYS_mknod 14
+#define SYS_mount 21
+#define SYS_msgsys 49
+#define SYS_nice 34
+#define SYS_open 5
+#define SYS_pause 29
+#define SYS_pipe 42
+#define SYS_plock 45
+#define SYS_poll 87
+#define SYS_prof 44
+#define SYS_ptrace 26
+#define SYS_putmsg 86
+#define SYS_rdebug 76
+#define SYS_read 3
+#define SYS_readlink 92
+#define SYS_readv 121
+#define SYS_rfstart 74
+#define SYS_rfstop 77
+#define SYS_rfsys 78
+#define SYS_rmdir 79
+#define SYS_rmount 72
+#define SYS_rumount 73
+#define SYS_seek 19
+#define SYS_semsys 53
+#define SYS_setgid 46
+#define SYS_setpgrp 39
+#define SYS_settimeofday 172
+#define SYS_setuid 23
+#define SYS_shmsys 52
+#define SYS_signal 48
+#define SYS_stat 18
+#define SYS_statfs 35
+#define SYS_stime 25
+#define SYS_stty 31
+#define SYS_symlink 90
+#define SYS_sync 36
+#define SYS_sys3b 50
+#define SYS_sysi86 50
+#define SYS_sysacct 51
+#define SYS_sysfs 84
+#define SYS_time 13
+#define SYS_times 43
+#define SYS_uadmin 55
+#define SYS_ulimit 63
+#define SYS_umask 60
+#define SYS_umount 22
+#define SYS_unadvfs 71
+#define SYS_unlink 10
+#define SYS_utime 30
+#define SYS_utssys 57
+#define SYS_wait 7
+#define SYS_write 4
+#define SYS_writev 122
+#define SYS_xstat 123
+#define SYS_ftruncate 192
+
+/* cxenix numbers are created by the formula
+ * (table index << 8) + CXENIX
+ */
+
+#define CXENIX 0x28 /* Decimal 40 */
+
+#define XLOCKING 0x0128
+#define CREATSEM 0x0228
+#define OPENSEM 0x0328
+#define SIGSEM 0x0428
+#define WAITSEM 0x0528
+#define NBWAITSEM 0x0628
+#define RDCHK 0x0728
+#define CHSIZE 0x0a28
+#define SYS_ftime 0x0b28
+#define NAP 0x0c28
+#define SDGET 0x0d28
+#define SDFREE 0x0e28
+#define SDENTER 0x0f28
+#define SDLEAVE 0x1028
+#define SDGETV 0x1128
+#define SDWAITV 0x1228
+#define PROCTL 0x2028
+#define EXECSEG 0x2128
+#define UNEXECSEG 0x2228
+#define SYS_select 0x2428
+#define SYS_eaccess 0x2528
+#define SYS_paccess 0x2628
+#define SYS_sigaction 0x2728
+#define SYS_sigprocmask 0x2828
+#define SYS_sigpending 0x2928
+#define SYS_sigsuspend 0x2a28
+#define SYS_getgroups 0x2b28
+#define SYS_setgroups 0x2c28
+#define SYS_sysconf 0x2d28
+#define SYS_pathconf 0x2e28
+#define SYS_fpathconf 0x2f28
+#define SYS_rename 0x3028
+#define SYS_setitimer 0x3828
+
+#define CLOCAL 127
+#endif
+#endif
diff --git a/mit-pthreads/machdep/i386-sco-3.2v5/timers.h b/mit-pthreads/machdep/i386-sco-3.2v5/timers.h
new file mode 100755
index 00000000000..cbc48ccc8d8
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/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.
+ *
+ * timers.h,v 1.50.8.1 1996/03/05 08:28:36 proven Exp
+ *
+ * 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 {
+ long 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/i386-sco-3.2v5/trash.can b/mit-pthreads/machdep/i386-sco-3.2v5/trash.can
new file mode 100755
index 00000000000..33edf65aab6
--- /dev/null
+++ b/mit-pthreads/machdep/i386-sco-3.2v5/trash.can
@@ -0,0 +1 @@
+make: *** No targets specified and no makefile found. Stop.
diff --git a/mit-pthreads/machdep/irix-5.2/__math.h b/mit-pthreads/machdep/irix-5.2/__math.h
new file mode 100755
index 00000000000..229d5121524
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/__math.h
@@ -0,0 +1,4 @@
+
+extern char __infinity[];
+#define HUGE_VAL (*(double *) __infinity)
+
diff --git a/mit-pthreads/machdep/irix-5.2/__signal.h b/mit-pthreads/machdep/irix-5.2/__signal.h
new file mode 100755
index 00000000000..87797da3198
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/__signal.h
@@ -0,0 +1,15 @@
+#include <sys/signal.h>
+
+typedef int sig_atomic_t;
+
+#ifndef sigmask
+#define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1)))
+#endif
+#define sigword(n) (((unsigned int)((n) - 1))>>5)
+
+#define __SIGEMPTYSET { 0, 0, 0, 0 };
+#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff };
+#define __SIGADDSET(s, n) ((s)->sigbits[sigword(n)] |= sigmask(n))
+#define __SIGDELSET(s, n) ((s)->sigbits[sigword(n)] &= ~sigmask(n))
+#define __SIGISMEMBER(s, n) (sigmask(n) & (s)->sigbits[sigword(n)])
+
diff --git a/mit-pthreads/machdep/irix-5.2/__stdio.h b/mit-pthreads/machdep/irix-5.2/__stdio.h
new file mode 100755
index 00000000000..bb4c14b32c6
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/__stdio.h
@@ -0,0 +1,6 @@
+#if !defined(_SIZE_T) && !defined(_SIZE_T_)
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+typedef pthread_fpos_t fpos_t;
diff --git a/mit-pthreads/machdep/irix-5.2/__stdlib.h b/mit-pthreads/machdep/irix-5.2/__stdlib.h
new file mode 100755
index 00000000000..2bec122c5f1
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/__stdlib.h
@@ -0,0 +1,30 @@
+#include <sgidefs.h>
+
+#if !defined(_SIZE_T) && !defined(_SIZE_T_)
+#define _SIZE_T
+#if (_MIPS_SZLONG == 32)
+typedef unsigned int size_t;
+#endif
+#if (_MIPS_SZLONG == 64)
+typedef unsigned long size_t;
+#endif
+#endif
+
+#ifndef _WCHAR_T
+#define _WCHAR_T
+#if (_MIPS_SZLONG == 32)
+typedef long wchar_t;
+#endif
+#if (_MIPS_SZLONG == 64)
+typedef __int32_t wchar_t;
+#endif
+#endif
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
diff --git a/mit-pthreads/machdep/irix-5.2/__string.h b/mit-pthreads/machdep/irix-5.2/__string.h
new file mode 100755
index 00000000000..50261e73cfc
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/__string.h
@@ -0,0 +1,5 @@
+#if !defined(_SIZE_T) && !defined(_SIZE_T_)
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
diff --git a/mit-pthreads/machdep/irix-5.2/__time.h b/mit-pthreads/machdep/irix-5.2/__time.h
new file mode 100755
index 00000000000..51fb993b38d
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/__time.h
@@ -0,0 +1,21 @@
+#if !defined(_SIZE_T) && !defined(_SIZE_T_)
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef pthread_clock_t clock_t;
+#endif
+
+#ifndef _TIME_T
+#define _TIME_T
+typedef pthread_time_t time_t;
+#endif /* !_TIME_T */
+
+#define CLOCKS_PER_SEC 1000000
+
+#ifndef CLK_TCK
+#define CLK_TCK sysconf(3) /* clock ticks per second */
+ /* 3 is _SC_CLK_TCK */
+#endif
diff --git a/mit-pthreads/machdep/irix-5.2/__unistd.h b/mit-pthreads/machdep/irix-5.2/__unistd.h
new file mode 100755
index 00000000000..0d71d631a5b
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/__unistd.h
@@ -0,0 +1,8 @@
+#include <sys/types.h>
+#include <sys/unistd.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define ioctl_request_type int /* For fd.c */
diff --git a/mit-pthreads/machdep/irix-5.2/compat.h b/mit-pthreads/machdep/irix-5.2/compat.h
new file mode 100755
index 00000000000..8fd504e504f
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/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 :
+ *
+ * 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/irix-5.2/dirent.h b/mit-pthreads/machdep/irix-5.2/dirent.h
new file mode 100755
index 00000000000..79fe486951d
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/dirent.h
@@ -0,0 +1,21 @@
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+
+#if !defined(_POSIX_SOURCE)
+#define MAXNAMLEN 255 /* maximum filename length */
+#define DIRBUF 4096 /* buffer size for fs-indep. dirs */
+#endif /* !defined(_POSIX_SOURCE) */
+
+#include <sys/types.h>
+
+struct dirent { /* data from readdir() */
+ ino_t d_ino; /* inode number of entry */
+ off_t d_off; /* offset of disk direntory entry */
+ unsigned short d_reclen; /* length of this record */
+ char d_name[MAXNAMLEN+1];/* name of file */
+};
+
+#define d_namlen d_reclen
+#define d_fileno d_ino
+
+#endif /* _SYS_DIRENT_H */
diff --git a/mit-pthreads/machdep/irix-5.2/socket.h b/mit-pthreads/machdep/irix-5.2/socket.h
new file mode 100755
index 00000000000..b08d3939802
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/socket.h
@@ -0,0 +1,304 @@
+#ifndef __SYS_TPI_SOCKET_H__
+#ifndef __SYS_SOCKET_H__
+#define __SYS_SOCKET_H__
+/*
+ * Copyright (c) 1982,1985, 1986 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * @(#)socket.h 7.1 (Berkeley) 6/4/86
+ */
+#include <sys/cdefs.h>
+#include <sys/bsd_types.h>
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Types
+ */
+#ifdef _STYPES_LATER /* old ABI */
+#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 */
+#else /* !_STYPES_LATER, new ABI */
+
+#ifndef NC_TPI_CLTS
+#define NC_TPI_CLTS 1 /* must agree with netconfig.h */
+#define NC_TPI_COTS 2 /* must agree with netconfig.h */
+#define NC_TPI_COTS_ORD 3 /* must agree with netconfig.h */
+#define NC_TPI_RAW 4 /* must agree with netconfig.h */
+#endif /* !NC_TPI_CLTS */
+
+#define SOCK_DGRAM NC_TPI_CLTS /* datagram socket */
+#define SOCK_STREAM NC_TPI_COTS /* stream socket */
+#define SOCK_RAW NC_TPI_RAW /* raw-protocol interface */
+#define SOCK_RDM 5 /* reliably-delivered message */
+#define SOCK_SEQPACKET 6 /* sequenced packet stream */
+
+#ifdef _KERNEL
+#define IRIX4_SOCK_STREAM 1 /* stream socket */
+#define IRIX4_SOCK_DGRAM 2 /* datagram socket */
+#define IRIX4_SOCK_RAW 3 /* raw-protocol interface */
+#define IRIX4_SOCK_RDM 4 /* reliably-delivered message */
+#define IRIX4_SOCK_SEQPACKET 5 /* sequenced packet stream */
+#endif /* _KERNEL */
+#endif /* _STYPES_LATER */
+
+/*
+ * 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 */
+#define SO_REUSEPORT 0x0200 /* allow local address,port reuse */
+#define SO_ORDREL 0x0200 /* MIPS ABI - unimplemented */
+#define SO_IMASOCKET 0x0400 /* use libsocket (not TLI) semantics */
+#define SO_CHAMELEON 0x1000 /* (cipso) set label to 1st req rcvd */
+
+/*
+ * 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_PROTOTYPE 0x1009 /* get protocol type (libsocket) */
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+/*
+ * Level number for (get/set)sockopt() to apply to socket itself.
+ */
+#define SOL_SOCKET 0xffff /* options for socket level */
+
+/*
+ * Address families.
+ * XTP really is not an address family, but is included here to take
+ * up space, because other AF_ entries are numerically equal to their
+ * PF_ counterparts.
+ */
+#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_ISO 7 /* ISO 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 /* DEC Direct data link interface */
+#define AF_LAT 14 /* LAT */
+#define AF_HYLINK 15 /* NSC Hyperchannel */
+#define AF_APPLETALK 16 /* Apple Talk */
+#define AF_ROUTE 17 /* Internal Routing Protocol */
+#ifdef __sgi
+#define AF_RAW 18 /* Raw link layer interface */
+#else
+#define AF_LINK 18 /* Link layer interface */
+#endif
+#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+
+/* MIPS ABI VALUES - unimplemented */
+#define AF_NIT 17 /* Network Interface Tap */
+#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
+#define AF_OSI 19 /* umbrella for all families used */
+#define AF_X25 20 /* CCITT X.25 in particular */
+#define AF_OSINET 21 /* AFI = 47, IDI = 4 */
+#define AF_GOSIP 22 /* U.S. Government OSI */
+
+
+#define AF_SDL 23 /* SGI Data Link for DLPI */
+
+#define AF_MAX (AF_SDL+1)
+
+/*
+ * Structure used by kernel to store most
+ * addresses.
+ */
+struct sockaddr {
+ u_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 {
+ u_short sp_family; /* address family */
+ u_short sp_protocol; /* protocol */
+};
+
+/*
+ * An option specification consists of an opthdr, followed by the value of
+ * the option. An options buffer contains one or more options. The len
+ * field of opthdr specifies the length of the option value in bytes. This
+ * length must be a multiple of sizeof(long) (use OPTLEN macro).
+ */
+
+struct opthdr {
+ long level; /* protocol level affected */
+ long name; /* option to modify */
+ long len; /* length of option value */
+};
+
+#define OPTLEN(x) ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
+#define OPTVAL(opt) ((char *)(opt + 1))
+
+/*
+ * the optdefault structure is used for internal tables of option default
+ * values.
+ */
+struct optdefault {
+ int optname; /* the option */
+ char *val; /* ptr to default value */
+ int len; /* length of value */
+};
+
+struct tpisocket;
+struct T_optmgmt_req;
+struct msgb;
+
+/*
+ * the opproc structure is used to build tables of options processing
+ * functions for dooptions().
+ */
+struct opproc {
+ int level; /* options level this function handles */
+ int (*func)(struct tpisocket *, struct T_optmgmt_req *,
+ struct opthdr *, struct msgb *);
+ /* the function */
+};
+
+/*
+ * This structure is used to encode pseudo system calls
+ */
+struct socksysreq {
+ int args[7];
+};
+
+/*
+ * This structure is used for adding new protocols to the list supported by
+ * sockets.
+ */
+
+struct socknewproto {
+ int family; /* address family (AF_INET, etc.) */
+ int type; /* protocol type (SOCK_STREAM, etc.) */
+ int proto; /* per family proto number */
+ dev_t dev; /* major/minor to use (must be a clone) */
+ int flags; /* protosw flags */
+};
+
+/*
+ * 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_ISO AF_ISO
+#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_ROUTE AF_ROUTE
+#define PF_LINK AF_LINK
+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
+#ifdef __sgi
+#define PF_RAW AF_RAW
+#endif
+
+/* MIPS ABI VALUES - unimplemented */
+#define PF_NIT AF_NIT /* Network Interface Tap */
+#define PF_802 AF_802 /* IEEE 802.2, also ISO 8802 */
+#define PF_OSI AF_OSI /* umbrella for all families used */
+#define PF_X25 AF_X25 /* CCITT X.25 in particular */
+#define PF_OSINET AF_OSINET /* AFI = 47, IDI = 4 */
+#define PF_GOSIP AF_GOSIP /* U.S. Government OSI */
+
+#define PF_MAX AF_MAX
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * 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_EOR 0x8 /* data completes record (OSI only) */
+#ifdef XTP
+#define MSG_BTAG 0x40 /* XTP packet with BTAG field */
+#define MSG_ETAG 0x80 /* XTP packet with ETAG field */
+#endif
+
+#define MSG_MAXIOVLEN 16
+
+__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 getpeername __P_((int, struct sockaddr *, int *));
+int getsockname __P_((int, struct sockaddr *, int *));
+int getsockopt __P_((int, int, int, void *, int *));
+int listen __P_((int, int));
+ssize_t recv __P_((int, void *, size_t, int));
+ssize_t recvfrom __P_((int, void *, size_t, int, struct sockaddr *, int *));
+int recvmsg __P_((int, struct msghdr *, int));
+ssize_t send __P_((int, const void *, size_t, int));
+ssize_t sendto __P_((int, const void *, size_t, int,
+ const struct sockaddr *, int));
+int sendmsg __P_((int, const struct msghdr *, int));
+int setsockopt __P_((int, int, int, const void *, int));
+int shutdown __P_((int, int));
+int socket __P_((int, int, int));
+int socketpair __P_((int, int, int, int *));
+__END_DECLS
+
+#endif /* !__SYS_SOCKET_H__ */
+#endif /* !__SYS_TPI_SOCKET_H__ */
diff --git a/mit-pthreads/machdep/irix-5.2/timers.h b/mit-pthreads/machdep/irix-5.2/timers.h
new file mode 100755
index 00000000000..ffa24dc9a15
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/timers.h
@@ -0,0 +1,18 @@
+#ifndef __SYS_TIMERS_H__
+#define __SYS_TIMERS_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; \
+}
+
+#endif /* !__SYS_TIMERS_H__ */
diff --git a/mit-pthreads/machdep/irix-5.2/wait.h b/mit-pthreads/machdep/irix-5.2/wait.h
new file mode 100755
index 00000000000..c0a7e7113d8
--- /dev/null
+++ b/mit-pthreads/machdep/irix-5.2/wait.h
@@ -0,0 +1,104 @@
+/*
+ * 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.
+ *
+ * @(#)wait.h 7.4 (Berkeley) 1/27/88
+ */
+#ifndef __SYS_WAIT_H__
+#define __SYS_WAIT_H__
+
+#ifdef _POSIX_SOURCE
+#define _W_INT(i) (i)
+#else
+#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
+#define WCOREFLAG 0200
+#endif
+
+#define WSTOPFLG 0177
+#define WIFSTOPPED(stat) ((_W_INT(stat)&0377)==_WSTOPPED&&((_W_INT(stat)>>8)&0377)!=0)
+#define WSTOPSIG(stat) ((_W_INT(stat)>>8)&0377)
+#define WIFSIGNALED(stat) ((_W_INT(stat)&0377)>0&&((_W_INT(stat)>>8)&0377)==0)
+#define WTERMSIG(stat) (_W_INT(stat)&0177)
+#define WIFEXITED(stat) ((_W_INT(stat)&0377)==0)
+#define WEXITSTATUS(stat) ((_W_INT(stat)>>8)&0377)
+#define WCOREDUMP(stat) (_W_INT(stat) & WCOREFLAG)
+
+/*
+ * Option bits for the second argument of wait3. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#define WNOHANG 0100
+#define WUNTRACED 0004 /* for POSIX */
+
+#if !defined(_POSIX_SOURCE)
+
+/*
+ * Structure of the information in the first word returned by both
+ * wait and wait3. If w_stopval==_WSTOPPED, then the second structure
+ * describes the information returned, else the first. See WUNTRACED below.
+ */
+typedef union wait {
+ int w_status; /* used in syscall */
+ /*
+ * Terminated process status.
+ */
+ struct {
+#ifdef _MIPSEL
+ unsigned int w_Termsig:7, /* termination signal */
+ w_Coredump:1, /* core dump indicator */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Filler:16; /* upper bits filler */
+#endif
+#ifdef _MIPSEB
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Coredump:1, /* core dump indicator */
+ w_Termsig:7; /* termination signal */
+#endif
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+#ifdef _MIPSEL
+ unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Filler:16; /* upper bits filler */
+#endif
+#ifdef _MIPSEB
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Stopval:8; /* == W_STOPPED if stopped */
+#endif
+ } w_S;
+} wait_t;
+#define w_termsig w_T.w_Termsig
+#define w_coredump w_T.w_Coredump
+#define w_retcode w_T.w_Retcode
+#define w_stopval w_S.w_Stopval
+#define w_stopsig w_S.w_Stopsig
+
+
+
+#define WSTOPPED 0004 /* wait for processes stopped by signals */
+#endif /* !defined(_POSIX_SOURCE) */
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+__BEGIN_DECLS
+pid_t wait __P_((int *));
+pid_t waitpid __P_((pid_t, int *, int));
+#ifndef _POSIX_SOURCE
+pid_t wait3 __P_((int *, int, void *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+
+#endif /* __SYS_WAIT_H__ */
diff --git a/mit-pthreads/machdep/linux-1.0/__math.h b/mit-pthreads/machdep/linux-1.0/__math.h
new file mode 100755
index 00000000000..05c65d58321
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__math.h
@@ -0,0 +1,4 @@
+#ifndef HUGE_VAL
+#define HUGE_VAL DBL_MAX
+#endif
+
diff --git a/mit-pthreads/machdep/linux-1.0/__path.h b/mit-pthreads/machdep/linux-1.0/__path.h
new file mode 100755
index 00000000000..9caeb7d3016
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__path.h
@@ -0,0 +1,14 @@
+/*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/lib/zoneinfo"
+#define _PATH_TZFILE "/usr/lib/zoneinfo/localtime"
+
+#endif /* !_SYS__PATH_H_ */
+
diff --git a/mit-pthreads/machdep/linux-1.0/__signal.h b/mit-pthreads/machdep/linux-1.0/__signal.h
new file mode 100755
index 00000000000..4cd671f155c
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__signal.h
@@ -0,0 +1,24 @@
+#include <features.h>
+#include <linux/signal.h>
+
+#ifndef SIGCLD
+#define SIGCLD SIGCHLD
+#endif
+
+typedef int sig_atomic_t;
+
+typedef __sighandler_t SignalHandler;
+
+#define SignalBad ((SignalHandler)-1)
+#define SignalDefault ((SignalHandler)0)
+#define SignalIgnore ((SignalHandler)1)
+
+#define __sigmask(sig) (1 << ((sig) - 1))
+#define sigmask __sigmask
+
+#define __SIGFILLSET 0xffffffff
+#define __SIGEMPTYSET 0
+#define __SIGADDSET(s,n) ((*s) |= (__sigmask(n)))
+#define __SIGDELSET(s,n) ((*s) &= ~(__sigmask(n)))
+#define __SIGISMEMBER(s,n) ((*s) & (__sigmask(n)))
+
diff --git a/mit-pthreads/machdep/linux-1.0/__stdio.h b/mit-pthreads/machdep/linux-1.0/__stdio.h
new file mode 100755
index 00000000000..eb7e904c34d
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__stdio.h
@@ -0,0 +1,7 @@
+
+#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/linux-1.0/__stdlib.h b/mit-pthreads/machdep/linux-1.0/__stdlib.h
new file mode 100755
index 00000000000..eaa0bb988ee
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__stdlib.h
@@ -0,0 +1,20 @@
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <features.h>
+
+/* Get size_t, wchar_t and NULL from <stddef.h>. */
+#define __need_size_t
+#define __need_wchar_t
+#define __need_NULL
+#include <stddef.h>
+
+#define __need_Emath
+#include <errno.h>
+
+/* Get HUGE_VAL (returned by strtod on overflow) from <float.h>. */
+#define __need_HUGE_VAL
+#include <float.h>
+
+#endif
diff --git a/mit-pthreads/machdep/linux-1.0/__string.h b/mit-pthreads/machdep/linux-1.0/__string.h
new file mode 100755
index 00000000000..8a5e09608e0
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__string.h
@@ -0,0 +1,18 @@
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+/* Non-standard Linux 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 *));
+char *strsep __P_((char **, const char *));
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/linux-1.0/__time.h b/mit-pthreads/machdep/linux-1.0/__time.h
new file mode 100755
index 00000000000..a088268286e
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__time.h
@@ -0,0 +1,72 @@
+/* ==== __time.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 : System specific time header.
+ *
+ * 1.00 94/11/07 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS___TIME_H_
+#define _SYS___TIME_H_
+
+#include <features.h>
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef long clock_t;
+#endif
+#ifndef _TIME_T
+#define _TIME_T
+typedef long time_t;
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *) 0)
+#endif
+#endif
+#endif
+
+#define CLOCKS_PER_SEC 100
+#define CLK_TCK 100
+
+extern long int timezone;
+extern int daylight;
+
+#endif
diff --git a/mit-pthreads/machdep/linux-1.0/__unistd.h b/mit-pthreads/machdep/linux-1.0/__unistd.h
new file mode 100755
index 00000000000..0f15b7c4883
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/__unistd.h
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <features.h>
+
+/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
+#define _POSIX_VERSION 199009L
+#define _POSIX2_C_BIND 1
+#define _POSIX2_C_DEV 1
+#define _POSIX2_SW_DEV 1
+
+#define __need_size_t
+#define ioctl_request_type int /* For fd.c */
+
+#include <posix_opt.h>
+#include <sys/types.h>
+#include <stddef.h>
+
+#endif
+
diff --git a/mit-pthreads/machdep/linux-1.0/cdefs.h b/mit-pthreads/machdep/linux-1.0/cdefs.h
new file mode 100755
index 00000000000..f9d5668cfe6
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/cdefs.h
@@ -0,0 +1,23 @@
+/* This is intended to eventually find /usr/include/sys/cdefs.h
+ * if it's inside the ifdef then it won't work if this file is
+ * found in the include files path more than once.
+ *
+ * include_next is a GNU C extension, we might eventually want
+ * to have our own cdefs in here simply to avoid GNU C dependencies
+ * (though there are already enough in the asm stuff anyways)
+ * [gsstark:19950419.0307EST]
+ */
+#include_next <sys/cdefs.h>
+
+#ifndef _PTHREAD_SYS_CDEFS_H_
+#define _PTHREAD_SYS_CDEFS_H_
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif /* __NORETURN not defined. */
+
+#if !defined(__cplusplus)
+#define __CAN_DO_EXTERN_INLINE
+#endif
+
+#endif /* _PTHREAD_SYS_CDEFS_H_ */
diff --git a/mit-pthreads/machdep/linux-1.0/compat.h b/mit-pthreads/machdep/linux-1.0/compat.h
new file mode 100755
index 00000000000..6edb992ac3d
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/compat.h
@@ -0,0 +1,47 @@
+/* ==== 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 : Basic timers header.
+ *
+ * 1.00 94/06/13 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#include <sys/types.h>
+
+#define omsghdr msghdr
+
+#endif
diff --git a/mit-pthreads/machdep/linux-1.0/dirent.h b/mit-pthreads/machdep/linux-1.0/dirent.h
new file mode 100755
index 00000000000..7f783a198e0
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/dirent.h
@@ -0,0 +1,27 @@
+
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+
+#include <sys/types.h>
+#include <linux/limits.h>
+
+struct dirent {
+ long d_ino;
+ off_t d_off;
+ unsigned short d_reclen;
+ char d_name[NAME_MAX+1];
+};
+
+#ifndef d_fileno
+#define d_fileno d_ino
+#endif
+
+#ifndef d_namlen
+#define d_namlen d_reclen
+#endif
+
+#ifndef MAXNAMLEN
+#define MAXNAMLEN NAME_MAX
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/linux-1.0/errno.h b/mit-pthreads/machdep/linux-1.0/errno.h
new file mode 100755
index 00000000000..a94a56b0437
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/errno.h
@@ -0,0 +1,12 @@
+/* ==== errno.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Errno is already broken up into data/prototyes.
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#include <linux/errno.h>
+
+#endif
diff --git a/mit-pthreads/machdep/linux-1.0/socket.h b/mit-pthreads/machdep/linux-1.0/socket.h
new file mode 100755
index 00000000000..cc4c0fd262e
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/socket.h
@@ -0,0 +1,193 @@
+/* ==== socket.h.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Correct Linux header file.
+ */
+
+#ifndef _PTHREAD_SOCKET_H_
+#define _PTHREAD_SOCKET_H_
+
+/* #include <linux/socket.h> */
+#ifndef _LINUX_SOCKET_H
+#define _LINUX_SOCKET_H
+
+/* IP options */
+#define IP_TOS 1
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IP_TTL 2
+#ifndef IP_HDRINCL
+#define IP_HDRINCL 3
+#endif
+#ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF
+#define IP_OPTIONS 4
+#endif
+
+#endif
+
+/* #include <asm/socket.h> arch-dependent defines */
+#include <linux/sockios.h> /* the SIOCxxx I/O controls */
+#include <pthread/posix.h>
+
+struct sockaddr {
+ unsigned short sa_family; /* address family, AF_xxx */
+ char sa_data[14]; /* 14 bytes of protocol address */
+};
+
+struct linger {
+ int l_onoff; /* Linger active */
+ int l_linger; /* How long to linger for */
+};
+
+struct msghdr
+{
+ void * msg_name; /* Socket name */
+ int msg_namelen; /* Length of name */
+ struct iovec * msg_iov; /* Data blocks */
+ int msg_iovlen; /* Number of blocks */
+ void * msg_accrights; /* Per protocol magic (eg BSD file descriptor passing) */
+ int msg_accrightslen;/* Length of rights list */
+};
+
+/* Socket types. */
+#define SOCK_STREAM 1 /* stream (connection) socket */
+#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
+#define SOCK_RAW 3 /* raw socket */
+#define SOCK_RDM 4 /* reliably-delivered message */
+#define SOCK_SEQPACKET 5 /* sequential packet socket */
+#define SOCK_PACKET 10 /* linux specific way of */
+ /* getting packets at the dev */
+ /* level. For writing rarp and */
+ /* other similar things on the */
+ /* user level. */
+
+/* Supported address families. */
+#define AF_UNSPEC 0
+#define AF_UNIX 1 /* Unix domain sockets */
+#define AF_INET 2 /* Internet IP Protocol */
+#define AF_AX25 3 /* Amateur Radio AX.25 */
+#define AF_IPX 4 /* Novell IPX */
+#define AF_APPLETALK 5 /* Appletalk DDP */
+#define AF_NETROM 6 /* Amateur radio NetROM */
+#define AF_BRIDGE 7 /* Multiprotocol bridge */
+#define AF_AAL5 8 /* Reserved for Werner's ATM */
+#define AF_X25 9 /* Reserved for X.25 project */
+#define AF_INET6 10 /* IP version 6 */
+#define AF_MAX 12 /* For now.. */
+
+/* Protocol families, same as address families. */
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_INET AF_INET
+#define PF_AX25 AF_AX25
+#define PF_IPX AF_IPX
+#define PF_APPLETALK AF_APPLETALK
+#define PF_NETROM AF_NETROM
+#define PF_BRIDGE AF_BRIDGE
+#define PF_AAL5 AF_AAL5
+#define PF_X25 AF_X25
+#define PF_INET6 AF_INET6
+
+#define PF_MAX AF_MAX
+
+/* Maximum queue length specificable by listen. */
+#define SOMAXCONN 128
+
+/* Flags we can use with send/ and recv. */
+#define MSG_OOB 1
+#define MSG_PEEK 2
+#define MSG_DONTROUTE 4
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
+#define SOL_SOCKET 1
+#define SOL_IP 0
+#define SOL_IPX 256
+#define SOL_AX25 257
+#define SOL_ATALK 258
+#define SOL_NETROM 259
+#define SOL_TCP 6
+#define SOL_UDP 17
+
+/* For setsockoptions(2) */
+#define SO_DEBUG 1
+#define SO_REUSEADDR 2
+#define SO_TYPE 3
+#define SO_ERROR 4
+#define SO_DONTROUTE 5
+#define SO_BROADCAST 6
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_KEEPALIVE 9
+#define SO_OOBINLINE 10
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_LINGER 13
+/* To add :#define SO_REUSEPORT 14 */
+
+
+#define IP_MULTICAST_IF 32
+#define IP_MULTICAST_TTL 33
+#define IP_MULTICAST_LOOP 34
+#define IP_ADD_MEMBERSHIP 35
+#define IP_DROP_MEMBERSHIP 36
+
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+/* IPX options */
+#define IPX_TYPE 1
+
+/* TCP options - this way around because someone left a set in the c library includes */
+#define TCP_NODELAY 1
+#define TCP_MAXSEG 2
+
+/* The various priorities. */
+#define SOPRI_INTERACTIVE 0
+#define SOPRI_NORMAL 1
+#define SOPRI_BACKGROUND 2
+
+/*
+ * 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));
+
+int getsockopt __P_((int __s, int __level, int __optname,
+ void *__optval, int *__optlen));
+int setsockopt __P_((int __s, int __level, int __optname,
+ __const void *__optval, int optlen));
+int getsockname __P_((int __sockfd, struct sockaddr *__addr,
+ int *__paddrlen));
+int getpeername __P_((int __sockfd, struct sockaddr *__peer,
+ int *__paddrlen));
+ssize_t send __P_((int __sockfd, __const void *__buff, size_t __len, int __flags));
+ssize_t recv __P_((int __sockfd, void *__buff, size_t __len, int __flags));
+ssize_t sendto __P_((int __sockfd, __const void *__buff, size_t __len,
+ int __flags, __const struct sockaddr *__to,
+ int __tolen));
+ssize_t recvfrom __P_((int __sockfd, void *__buff, size_t __len,
+ int __flags, struct sockaddr *__from,
+ int *__fromlen));
+extern ssize_t sendmsg __P_((int __fd, __const struct msghdr *__message,
+ int __flags));
+extern ssize_t recvmsg __P_((int __fd, struct msghdr *__message,
+ int __flags));
+int shutdown __P_((int __sockfd, int __how));
+
+__END_DECLS
+
+#endif
+
+
+
+
diff --git a/mit-pthreads/machdep/linux-1.0/timers.h b/mit-pthreads/machdep/linux-1.0/timers.h
new file mode 100755
index 00000000000..110cb27378c
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/timers.h
@@ -0,0 +1,71 @@
+/* ==== 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 <pthread/config.h>
+#include <sys/types.h>
+#include <time.h>
+
+#ifndef _OS_HAS_TIMESPEC
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+#endif
+
+#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/linux-1.0/uio.h b/mit-pthreads/machdep/linux-1.0/uio.h
new file mode 100755
index 00000000000..67af5bf76e0
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/uio.h
@@ -0,0 +1,15 @@
+/* ==== uio.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Correct Linux header file.
+ */
+
+#ifndef _PTHREAD_UIO_H_
+#define _PTHREAD_UIO_H_
+
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+
+#endif
diff --git a/mit-pthreads/machdep/linux-1.0/wait.h b/mit-pthreads/machdep/linux-1.0/wait.h
new file mode 100755
index 00000000000..bcc28c5ef58
--- /dev/null
+++ b/mit-pthreads/machdep/linux-1.0/wait.h
@@ -0,0 +1,98 @@
+/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
+
+/*
+ * 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.
+ *
+ * @(#)wait.h 8.1 (Berkeley) 6/2/93
+ */
+
+/*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+/*
+ * Macros to test the exit status returned by wait and extract the
+ * relevant values. Union wait is no supported with pthreads.
+ */
+#define __W_INT(i) (i)
+#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
+
+/*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#define WNOHANG 1 /* dont hang in wait */
+#define WUNTRACED 2 /* tell about stopped, untraced children */
+
+#ifndef _POSIX_SOURCE
+
+/* 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>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+__BEGIN_DECLS
+pid_t wait __P_((int *));
+pid_t waitpid __P_((pid_t, int *, int));
+#ifndef _POSIX_SOURCE
+pid_t wait3 __P_((int *, int, void *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+__END_DECLS
diff --git a/mit-pthreads/machdep/linux-2.0/__math.h b/mit-pthreads/machdep/linux-2.0/__math.h
new file mode 100755
index 00000000000..05c65d58321
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__math.h
@@ -0,0 +1,4 @@
+#ifndef HUGE_VAL
+#define HUGE_VAL DBL_MAX
+#endif
+
diff --git a/mit-pthreads/machdep/linux-2.0/__path.h b/mit-pthreads/machdep/linux-2.0/__path.h
new file mode 100755
index 00000000000..9caeb7d3016
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__path.h
@@ -0,0 +1,14 @@
+/*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/lib/zoneinfo"
+#define _PATH_TZFILE "/usr/lib/zoneinfo/localtime"
+
+#endif /* !_SYS__PATH_H_ */
+
diff --git a/mit-pthreads/machdep/linux-2.0/__signal.h b/mit-pthreads/machdep/linux-2.0/__signal.h
new file mode 100755
index 00000000000..4cd671f155c
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__signal.h
@@ -0,0 +1,24 @@
+#include <features.h>
+#include <linux/signal.h>
+
+#ifndef SIGCLD
+#define SIGCLD SIGCHLD
+#endif
+
+typedef int sig_atomic_t;
+
+typedef __sighandler_t SignalHandler;
+
+#define SignalBad ((SignalHandler)-1)
+#define SignalDefault ((SignalHandler)0)
+#define SignalIgnore ((SignalHandler)1)
+
+#define __sigmask(sig) (1 << ((sig) - 1))
+#define sigmask __sigmask
+
+#define __SIGFILLSET 0xffffffff
+#define __SIGEMPTYSET 0
+#define __SIGADDSET(s,n) ((*s) |= (__sigmask(n)))
+#define __SIGDELSET(s,n) ((*s) &= ~(__sigmask(n)))
+#define __SIGISMEMBER(s,n) ((*s) & (__sigmask(n)))
+
diff --git a/mit-pthreads/machdep/linux-2.0/__stdio.h b/mit-pthreads/machdep/linux-2.0/__stdio.h
new file mode 100755
index 00000000000..eb7e904c34d
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__stdio.h
@@ -0,0 +1,7 @@
+
+#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/linux-2.0/__stdlib.h b/mit-pthreads/machdep/linux-2.0/__stdlib.h
new file mode 100755
index 00000000000..eaa0bb988ee
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__stdlib.h
@@ -0,0 +1,20 @@
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <features.h>
+
+/* Get size_t, wchar_t and NULL from <stddef.h>. */
+#define __need_size_t
+#define __need_wchar_t
+#define __need_NULL
+#include <stddef.h>
+
+#define __need_Emath
+#include <errno.h>
+
+/* Get HUGE_VAL (returned by strtod on overflow) from <float.h>. */
+#define __need_HUGE_VAL
+#include <float.h>
+
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/__string.h b/mit-pthreads/machdep/linux-2.0/__string.h
new file mode 100755
index 00000000000..8a5e09608e0
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__string.h
@@ -0,0 +1,18 @@
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+/* Non-standard Linux 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 *));
+char *strsep __P_((char **, const char *));
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/__time.h b/mit-pthreads/machdep/linux-2.0/__time.h
new file mode 100755
index 00000000000..b86c153543a
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__time.h
@@ -0,0 +1,78 @@
+/* ==== __time.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 : System specific time header.
+ *
+ * 1.00 94/11/07 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS___TIME_H_
+#define _SYS___TIME_H_
+
+#include <features.h>
+
+struct timespec
+ {
+ long int tv_sec; /* Seconds. */
+ long int tv_nsec; /* Nanoseconds. */
+ };
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef long clock_t;
+#endif
+#ifndef _TIME_T
+#define _TIME_T
+typedef long time_t;
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *) 0)
+#endif
+#endif
+#endif
+
+#define CLOCKS_PER_SEC 100
+#define CLK_TCK 100
+
+extern long int timezone;
+extern int daylight;
+
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/__unistd.h b/mit-pthreads/machdep/linux-2.0/__unistd.h
new file mode 100755
index 00000000000..444f070659a
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/__unistd.h
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <features.h>
+
+/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
+#define _POSIX_VERSION 199009L
+#define _POSIX2_C_BIND 1
+#define _POSIX2_C_DEV 1
+#define _POSIX2_SW_DEV 1
+
+#define __need_size_t
+
+#include <sys/types.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+int chroot(const char *);
+int gethostname(char *, int);
+#ifdef __cplusplus
+}
+#endif
+#endif
+
diff --git a/mit-pthreads/machdep/linux-2.0/cdefs.h b/mit-pthreads/machdep/linux-2.0/cdefs.h
new file mode 100755
index 00000000000..04f93a138c9
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/cdefs.h
@@ -0,0 +1,36 @@
+/* This is intended to eventually find /usr/include/sys/cdefs.h
+ * if it's inside the ifdef then it won't work if this file is
+ * found in the include files path more than once.
+ *
+ * include_next is a GNU C extension, we might eventually want
+ * to have our own cdefs in here simply to avoid GNU C dependencies
+ * (though there are already enough in the asm stuff anyways)
+ * [gsstark:19950419.0307EST]
+ */
+
+/* We are almost always included from features.h. */
+
+#ifndef _FEATURES_H
+#include <features.h>
+#endif
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+#endif
+
+#define __need_timespec
+
+#include_next <sys/cdefs.h>
+
+#ifndef _PTHREAD_SYS_CDEFS_H_
+#define _PTHREAD_SYS_CDEFS_H_
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif /* __NORETURN not defined. */
+
+#if !defined(__cplusplus)
+#define __CAN_DO_EXTERN_INLINE
+#endif
+
+#endif /* _PTHREAD_SYS_CDEFS_H_ */
diff --git a/mit-pthreads/machdep/linux-2.0/compat.h b/mit-pthreads/machdep/linux-2.0/compat.h
new file mode 100755
index 00000000000..6edb992ac3d
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/compat.h
@@ -0,0 +1,47 @@
+/* ==== 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 : Basic timers header.
+ *
+ * 1.00 94/06/13 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#include <sys/types.h>
+
+#define omsghdr msghdr
+
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/dirent.h b/mit-pthreads/machdep/linux-2.0/dirent.h
new file mode 100755
index 00000000000..7f783a198e0
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/dirent.h
@@ -0,0 +1,27 @@
+
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+
+#include <sys/types.h>
+#include <linux/limits.h>
+
+struct dirent {
+ long d_ino;
+ off_t d_off;
+ unsigned short d_reclen;
+ char d_name[NAME_MAX+1];
+};
+
+#ifndef d_fileno
+#define d_fileno d_ino
+#endif
+
+#ifndef d_namlen
+#define d_namlen d_reclen
+#endif
+
+#ifndef MAXNAMLEN
+#define MAXNAMLEN NAME_MAX
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/errno.h b/mit-pthreads/machdep/linux-2.0/errno.h
new file mode 100755
index 00000000000..a94a56b0437
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/errno.h
@@ -0,0 +1,12 @@
+/* ==== errno.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Errno is already broken up into data/prototyes.
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#include <linux/errno.h>
+
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h b/mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h
new file mode 100644
index 00000000000..1a319ccdfd4
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/extra/bits/local_lim.h
@@ -0,0 +1,15 @@
+/* Minimum guaranteed maximum values for system limits. Linux version.
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol.
+ Remove this after including the header if necessary. */
+
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+
+#include <linux/limits.h>
+
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/extra/bits/socket.h b/mit-pthreads/machdep/linux-2.0/extra/bits/socket.h
new file mode 100755
index 00000000000..cc4c0fd262e
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/extra/bits/socket.h
@@ -0,0 +1,193 @@
+/* ==== socket.h.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Correct Linux header file.
+ */
+
+#ifndef _PTHREAD_SOCKET_H_
+#define _PTHREAD_SOCKET_H_
+
+/* #include <linux/socket.h> */
+#ifndef _LINUX_SOCKET_H
+#define _LINUX_SOCKET_H
+
+/* IP options */
+#define IP_TOS 1
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IP_TTL 2
+#ifndef IP_HDRINCL
+#define IP_HDRINCL 3
+#endif
+#ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF
+#define IP_OPTIONS 4
+#endif
+
+#endif
+
+/* #include <asm/socket.h> arch-dependent defines */
+#include <linux/sockios.h> /* the SIOCxxx I/O controls */
+#include <pthread/posix.h>
+
+struct sockaddr {
+ unsigned short sa_family; /* address family, AF_xxx */
+ char sa_data[14]; /* 14 bytes of protocol address */
+};
+
+struct linger {
+ int l_onoff; /* Linger active */
+ int l_linger; /* How long to linger for */
+};
+
+struct msghdr
+{
+ void * msg_name; /* Socket name */
+ int msg_namelen; /* Length of name */
+ struct iovec * msg_iov; /* Data blocks */
+ int msg_iovlen; /* Number of blocks */
+ void * msg_accrights; /* Per protocol magic (eg BSD file descriptor passing) */
+ int msg_accrightslen;/* Length of rights list */
+};
+
+/* Socket types. */
+#define SOCK_STREAM 1 /* stream (connection) socket */
+#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
+#define SOCK_RAW 3 /* raw socket */
+#define SOCK_RDM 4 /* reliably-delivered message */
+#define SOCK_SEQPACKET 5 /* sequential packet socket */
+#define SOCK_PACKET 10 /* linux specific way of */
+ /* getting packets at the dev */
+ /* level. For writing rarp and */
+ /* other similar things on the */
+ /* user level. */
+
+/* Supported address families. */
+#define AF_UNSPEC 0
+#define AF_UNIX 1 /* Unix domain sockets */
+#define AF_INET 2 /* Internet IP Protocol */
+#define AF_AX25 3 /* Amateur Radio AX.25 */
+#define AF_IPX 4 /* Novell IPX */
+#define AF_APPLETALK 5 /* Appletalk DDP */
+#define AF_NETROM 6 /* Amateur radio NetROM */
+#define AF_BRIDGE 7 /* Multiprotocol bridge */
+#define AF_AAL5 8 /* Reserved for Werner's ATM */
+#define AF_X25 9 /* Reserved for X.25 project */
+#define AF_INET6 10 /* IP version 6 */
+#define AF_MAX 12 /* For now.. */
+
+/* Protocol families, same as address families. */
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_INET AF_INET
+#define PF_AX25 AF_AX25
+#define PF_IPX AF_IPX
+#define PF_APPLETALK AF_APPLETALK
+#define PF_NETROM AF_NETROM
+#define PF_BRIDGE AF_BRIDGE
+#define PF_AAL5 AF_AAL5
+#define PF_X25 AF_X25
+#define PF_INET6 AF_INET6
+
+#define PF_MAX AF_MAX
+
+/* Maximum queue length specificable by listen. */
+#define SOMAXCONN 128
+
+/* Flags we can use with send/ and recv. */
+#define MSG_OOB 1
+#define MSG_PEEK 2
+#define MSG_DONTROUTE 4
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
+#define SOL_SOCKET 1
+#define SOL_IP 0
+#define SOL_IPX 256
+#define SOL_AX25 257
+#define SOL_ATALK 258
+#define SOL_NETROM 259
+#define SOL_TCP 6
+#define SOL_UDP 17
+
+/* For setsockoptions(2) */
+#define SO_DEBUG 1
+#define SO_REUSEADDR 2
+#define SO_TYPE 3
+#define SO_ERROR 4
+#define SO_DONTROUTE 5
+#define SO_BROADCAST 6
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_KEEPALIVE 9
+#define SO_OOBINLINE 10
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_LINGER 13
+/* To add :#define SO_REUSEPORT 14 */
+
+
+#define IP_MULTICAST_IF 32
+#define IP_MULTICAST_TTL 33
+#define IP_MULTICAST_LOOP 34
+#define IP_ADD_MEMBERSHIP 35
+#define IP_DROP_MEMBERSHIP 36
+
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+/* IPX options */
+#define IPX_TYPE 1
+
+/* TCP options - this way around because someone left a set in the c library includes */
+#define TCP_NODELAY 1
+#define TCP_MAXSEG 2
+
+/* The various priorities. */
+#define SOPRI_INTERACTIVE 0
+#define SOPRI_NORMAL 1
+#define SOPRI_BACKGROUND 2
+
+/*
+ * 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));
+
+int getsockopt __P_((int __s, int __level, int __optname,
+ void *__optval, int *__optlen));
+int setsockopt __P_((int __s, int __level, int __optname,
+ __const void *__optval, int optlen));
+int getsockname __P_((int __sockfd, struct sockaddr *__addr,
+ int *__paddrlen));
+int getpeername __P_((int __sockfd, struct sockaddr *__peer,
+ int *__paddrlen));
+ssize_t send __P_((int __sockfd, __const void *__buff, size_t __len, int __flags));
+ssize_t recv __P_((int __sockfd, void *__buff, size_t __len, int __flags));
+ssize_t sendto __P_((int __sockfd, __const void *__buff, size_t __len,
+ int __flags, __const struct sockaddr *__to,
+ int __tolen));
+ssize_t recvfrom __P_((int __sockfd, void *__buff, size_t __len,
+ int __flags, struct sockaddr *__from,
+ int *__fromlen));
+extern ssize_t sendmsg __P_((int __fd, __const struct msghdr *__message,
+ int __flags));
+extern ssize_t recvmsg __P_((int __fd, struct msghdr *__message,
+ int __flags));
+int shutdown __P_((int __sockfd, int __how));
+
+__END_DECLS
+
+#endif
+
+
+
+
diff --git a/mit-pthreads/machdep/linux-2.0/socket.h b/mit-pthreads/machdep/linux-2.0/socket.h
new file mode 100755
index 00000000000..fb43c394e10
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/socket.h
@@ -0,0 +1,196 @@
+/* ==== socket.h.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Correct Linux header file.
+ */
+
+#ifndef _PTHREAD_SOCKET_H_
+#define _PTHREAD_SOCKET_H_
+
+/* #include <linux/socket.h> */
+#ifndef _LINUX_SOCKET_H
+#define _LINUX_SOCKET_H
+
+/* IP options */
+#define IP_TOS 1
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IP_TTL 2
+#ifndef IP_HDRINCL
+#define IP_HDRINCL 3
+#endif
+#ifdef V1_3_WILL_DO_THIS_FUNKY_STUFF
+#define IP_OPTIONS 4
+#endif
+
+#endif
+
+/* Type for length arguments in socket calls. */
+typedef unsigned int socklen_t;
+
+/* #include <asm/socket.h> arch-dependent defines */
+#include <linux/sockios.h> /* the SIOCxxx I/O controls */
+#include <pthread/posix.h>
+
+struct sockaddr {
+ unsigned short sa_family; /* address family, AF_xxx */
+ char sa_data[14]; /* 14 bytes of protocol address */
+};
+
+struct linger {
+ int l_onoff; /* Linger active */
+ int l_linger; /* How long to linger for */
+};
+
+struct msghdr
+{
+ void * msg_name; /* Socket name */
+ int msg_namelen; /* Length of name */
+ struct iovec * msg_iov; /* Data blocks */
+ int msg_iovlen; /* Number of blocks */
+ void * msg_accrights; /* Per protocol magic (eg BSD file descriptor passing) */
+ int msg_accrightslen;/* Length of rights list */
+};
+
+/* Socket types. */
+#define SOCK_STREAM 1 /* stream (connection) socket */
+#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
+#define SOCK_RAW 3 /* raw socket */
+#define SOCK_RDM 4 /* reliably-delivered message */
+#define SOCK_SEQPACKET 5 /* sequential packet socket */
+#define SOCK_PACKET 10 /* linux specific way of */
+ /* getting packets at the dev */
+ /* level. For writing rarp and */
+ /* other similar things on the */
+ /* user level. */
+
+/* Supported address families. */
+#define AF_UNSPEC 0
+#define AF_UNIX 1 /* Unix domain sockets */
+#define AF_INET 2 /* Internet IP Protocol */
+#define AF_AX25 3 /* Amateur Radio AX.25 */
+#define AF_IPX 4 /* Novell IPX */
+#define AF_APPLETALK 5 /* Appletalk DDP */
+#define AF_NETROM 6 /* Amateur radio NetROM */
+#define AF_BRIDGE 7 /* Multiprotocol bridge */
+#define AF_AAL5 8 /* Reserved for Werner's ATM */
+#define AF_X25 9 /* Reserved for X.25 project */
+#define AF_INET6 10 /* IP version 6 */
+#define AF_MAX 12 /* For now.. */
+
+/* Protocol families, same as address families. */
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_INET AF_INET
+#define PF_AX25 AF_AX25
+#define PF_IPX AF_IPX
+#define PF_APPLETALK AF_APPLETALK
+#define PF_NETROM AF_NETROM
+#define PF_BRIDGE AF_BRIDGE
+#define PF_AAL5 AF_AAL5
+#define PF_X25 AF_X25
+#define PF_INET6 AF_INET6
+
+#define PF_MAX AF_MAX
+
+/* Maximum queue length specificable by listen. */
+#define SOMAXCONN 128
+
+/* Flags we can use with send/ and recv. */
+#define MSG_OOB 1
+#define MSG_PEEK 2
+#define MSG_DONTROUTE 4
+
+/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
+#define SOL_SOCKET 1
+#define SOL_IP 0
+#define SOL_IPX 256
+#define SOL_AX25 257
+#define SOL_ATALK 258
+#define SOL_NETROM 259
+#define SOL_TCP 6
+#define SOL_UDP 17
+
+/* For setsockoptions(2) */
+#define SO_DEBUG 1
+#define SO_REUSEADDR 2
+#define SO_TYPE 3
+#define SO_ERROR 4
+#define SO_DONTROUTE 5
+#define SO_BROADCAST 6
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_KEEPALIVE 9
+#define SO_OOBINLINE 10
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_LINGER 13
+/* To add :#define SO_REUSEPORT 14 */
+
+
+#define IP_MULTICAST_IF 32
+#define IP_MULTICAST_TTL 33
+#define IP_MULTICAST_LOOP 34
+#define IP_ADD_MEMBERSHIP 35
+#define IP_DROP_MEMBERSHIP 36
+
+
+/* These need to appear somewhere around here */
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+/* IPX options */
+#define IPX_TYPE 1
+
+/* TCP options - this way around because someone left a set in the c library includes */
+#define TCP_NODELAY 1
+#define TCP_MAXSEG 2
+
+/* The various priorities. */
+#define SOPRI_INTERACTIVE 0
+#define SOPRI_NORMAL 1
+#define SOPRI_BACKGROUND 2
+
+/*
+ * Functions
+ */
+
+__BEGIN_DECLS
+
+int accept __P_((int, struct sockaddr *, socklen_t *));
+int bind __P_((int, const struct sockaddr *, socklen_t));
+int connect __P_((int, const struct sockaddr *, socklen_t));
+int listen __P_((int, int));
+int socket __P_((int, int, int));
+
+int getsockopt __P_((int __s, int __level, int __optname,
+ void *__optval, socklen_t *__optlen));
+int setsockopt __P_((int __s, int __level, int __optname,
+ __const void *__optval, socklen_t optlen));
+int getsockname __P_((int __sockfd, struct sockaddr *__addr,
+ socklen_t *__paddrlen));
+int getpeername __P_((int __sockfd, struct sockaddr *__peer,
+ socklen_t *__paddrlen));
+ssize_t send __P_((int __sockfd, __const void *__buff, size_t __len, int __flags));
+ssize_t recv __P_((int __sockfd, void *__buff, size_t __len, int __flags));
+ssize_t sendto __P_((int __sockfd, __const void *__buff, size_t __len,
+ int __flags, __const struct sockaddr *__to,
+ socklen_t __tolen));
+ssize_t recvfrom __P_((int __sockfd, void *__buff, size_t __len,
+ int __flags, struct sockaddr *__from,
+ socklen_t *__fromlen));
+extern ssize_t sendmsg __P_((int __fd, __const struct msghdr *__message,
+ int __flags));
+extern ssize_t recvmsg __P_((int __fd, struct msghdr *__message,
+ int __flags));
+int shutdown __P_((int __sockfd, int __how));
+
+__END_DECLS
+
+#endif
+
+
+
+
diff --git a/mit-pthreads/machdep/linux-2.0/socketcall.h b/mit-pthreads/machdep/linux-2.0/socketcall.h
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/socketcall.h
diff --git a/mit-pthreads/machdep/linux-2.0/timers.h b/mit-pthreads/machdep/linux-2.0/timers.h
new file mode 100755
index 00000000000..110cb27378c
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/timers.h
@@ -0,0 +1,71 @@
+/* ==== 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 <pthread/config.h>
+#include <sys/types.h>
+#include <time.h>
+
+#ifndef _OS_HAS_TIMESPEC
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+#endif
+
+#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/linux-2.0/uio.h b/mit-pthreads/machdep/linux-2.0/uio.h
new file mode 100755
index 00000000000..67af5bf76e0
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/uio.h
@@ -0,0 +1,15 @@
+/* ==== uio.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Correct Linux header file.
+ */
+
+#ifndef _PTHREAD_UIO_H_
+#define _PTHREAD_UIO_H_
+
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+
+#endif
diff --git a/mit-pthreads/machdep/linux-2.0/wait.h b/mit-pthreads/machdep/linux-2.0/wait.h
new file mode 100755
index 00000000000..bcc28c5ef58
--- /dev/null
+++ b/mit-pthreads/machdep/linux-2.0/wait.h
@@ -0,0 +1,98 @@
+/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
+
+/*
+ * 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.
+ *
+ * @(#)wait.h 8.1 (Berkeley) 6/2/93
+ */
+
+/*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+/*
+ * Macros to test the exit status returned by wait and extract the
+ * relevant values. Union wait is no supported with pthreads.
+ */
+#define __W_INT(i) (i)
+#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
+
+/*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#define WNOHANG 1 /* dont hang in wait */
+#define WUNTRACED 2 /* tell about stopped, untraced children */
+
+#ifndef _POSIX_SOURCE
+
+/* 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>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+__BEGIN_DECLS
+pid_t wait __P_((int *));
+pid_t waitpid __P_((pid_t, int *, int));
+#ifndef _POSIX_SOURCE
+pid_t wait3 __P_((int *, int, void *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+__END_DECLS
diff --git a/mit-pthreads/machdep/netbsd-0.9/dirent.h b/mit-pthreads/machdep/netbsd-0.9/dirent.h
new file mode 100755
index 00000000000..5226443f86b
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-0.9/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__math.h b/mit-pthreads/machdep/netbsd-1.0/__math.h
new file mode 100755
index 00000000000..dc009d822f4
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__math.h
@@ -0,0 +1,6 @@
+/*
+ * ANSI/POSIX
+ */
+extern char __infinity[];
+#define HUGE_VAL (*(double *) __infinity)
+
diff --git a/mit-pthreads/machdep/netbsd-1.0/__path.h b/mit-pthreads/machdep/netbsd-1.0/__path.h
new file mode 100755
index 00000000000..432494daafa
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__path.h
@@ -0,0 +1,14 @@
+/*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/share/zoneinfo"
+#define _PATH_TZFILE "/etc/localtime"
+
+#endif /* !_SYS__PATH_H_ */
+
diff --git a/mit-pthreads/machdep/netbsd-1.0/__signal.h b/mit-pthreads/machdep/netbsd-1.0/__signal.h
new file mode 100755
index 00000000000..918955c9948
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__signal.h
@@ -0,0 +1,8 @@
+#include <sys/signal.h>
+
+#define __SIGEMPTYSET 0
+#define __SIGFILLSET 0xffffffff
+#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
+#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
+#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
+
diff --git a/mit-pthreads/machdep/netbsd-1.0/__stdio.h b/mit-pthreads/machdep/netbsd-1.0/__stdio.h
new file mode 100755
index 00000000000..d60b9df7a54
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__stdio.h
@@ -0,0 +1,8 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__stdlib.h b/mit-pthreads/machdep/netbsd-1.0/__stdlib.h
new file mode 100755
index 00000000000..7b24491b892
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__stdlib.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#ifdef _BSD_WCHAR_T_
+typedef _BSD_WCHAR_T_ wchar_t;
+#undef _BSD_WCHAR_T_
+#endif
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__string.h b/mit-pthreads/machdep/netbsd-1.0/__string.h
new file mode 100755
index 00000000000..1ebee28e708
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__string.h
@@ -0,0 +1,20 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+/* Non-standard NetBSD 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 *));
+void strmode __P_((int, char *));
+char *strsep __P_((char **, const char *));
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/__time.h b/mit-pthreads/machdep/netbsd-1.0/__time.h
new file mode 100755
index 00000000000..16ea9d1f0dd
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__time.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__TIME_H_
+#define _SYS__TIME_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_CLOCK_T_
+typedef _BSD_CLOCK_T_ clock_t;
+#undef _BSD_CLOCK_T_
+#endif
+
+#ifdef _BSD_TIME_T_
+typedef _BSD_TIME_T_ time_t;
+#undef _BSD_TIME_T_
+#endif
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#define CLOCKS_PER_SEC 100
+
+#if !defined(_ANSI_SOURCE)
+#define CLK_TCK 100
+#endif /* not ANSI */
+
+#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/__unistd.h b/mit-pthreads/machdep/netbsd-1.0/__unistd.h
new file mode 100755
index 00000000000..b4741ba6725
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/__unistd.h
@@ -0,0 +1,107 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* compile-time symbolic constants */
+#define _POSIX_JOB_CONTROL /* implementation supports job control */
+
+#ifdef _NOT_AVAILABLE
+#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
+#endif
+
+#define _POSIX_VERSION 198808L
+#define _POSIX2_VERSION 199212L
+
+/* execution-time symbolic constants */
+ /* chown requires appropriate privileges */
+#define _POSIX_CHOWN_RESTRICTED 1
+ /* too-long path components generate errors */
+#define _POSIX_NO_TRUNC 1
+ /* may disable terminal special characters */
+#define _POSIX_VDISABLE ((unsigned char)'\377')
+
+/* configurable pathname variables */
+#define _PC_LINK_MAX 1
+#define _PC_MAX_CANON 2
+#define _PC_MAX_INPUT 3
+#define _PC_NAME_MAX 4
+#define _PC_PATH_MAX 5
+#define _PC_PIPE_BUF 6
+#define _PC_CHOWN_RESTRICTED 7
+#define _PC_NO_TRUNC 8
+#define _PC_VDISABLE 9
+
+/* configurable system variables */
+#define _SC_ARG_MAX 1
+#define _SC_CHILD_MAX 2
+#define _SC_CLK_TCK 3
+#define _SC_NGROUPS_MAX 4
+#define _SC_OPEN_MAX 5
+#define _SC_JOB_CONTROL 6
+#define _SC_SAVED_IDS 7
+#define _SC_VERSION 8
+#define _SC_BC_BASE_MAX 9
+#define _SC_BC_DIM_MAX 10
+#define _SC_BC_SCALE_MAX 11
+#define _SC_BC_STRING_MAX 12
+#define _SC_COLL_WEIGHTS_MAX 13
+#define _SC_EXPR_NEST_MAX 14
+#define _SC_LINE_MAX 15
+#define _SC_RE_DUP_MAX 16
+#define _SC_2_VERSION 17
+#define _SC_2_C_BIND 18
+#define _SC_2_C_DEV 19
+#define _SC_2_CHAR_TERM 20
+#define _SC_2_FORT_DEV 21
+#define _SC_2_FORT_RUN 22
+#define _SC_2_LOCALEDEF 23
+#define _SC_2_SW_DEV 24
+#define _SC_2_UPE 25
+#define _SC_STREAM_MAX 26
+#define _SC_TZNAME_MAX 27
+
+/* configurable system strings */
+#define _CS_PATH 1
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/compat.h b/mit-pthreads/machdep/netbsd-1.0/compat.h
new file mode 100755
index 00000000000..e7de318aa88
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/compat.h
@@ -0,0 +1,43 @@
+/* ==== 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 : COmpat header to make socket code compile.
+ *
+ * 1.00 94/08/01 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/dirent.h b/mit-pthreads/machdep/netbsd-1.0/dirent.h
new file mode 100755
index 00000000000..5226443f86b
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/errno.h b/mit-pthreads/machdep/netbsd-1.0/errno.h
new file mode 100755
index 00000000000..3da61d692a3
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/errno.h
@@ -0,0 +1,160 @@
+/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#endif
+#define EBUSY 16 /* Device busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define ETXTBSY 26 /* Text file busy */
+#endif
+#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 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define EAGAIN 35 /* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define EWOULDBLOCK EAGAIN /* 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 */
+#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 */
+
+/* ipc/network software -- 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 /* Operation timed out */
+#define ECONNREFUSED 61 /* Connection refused */
+
+#define ELOOP 62 /* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define ENAMETOOLONG 63 /* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+#endif /* _POSIX_SOURCE */
+#define ENOTEMPTY 66 /* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#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 */
+#define EBADRPC 72 /* RPC struct is bad */
+#define ERPCMISMATCH 73 /* RPC version wrong */
+#define EPROGUNAVAIL 74 /* RPC prog. not avail */
+#define EPROGMISMATCH 75 /* Program version wrong */
+#define EPROCUNAVAIL 76 /* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define ENOLCK 77 /* No locks available */
+#define ENOSYS 78 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define EFTYPE 79 /* Inappropriate file type or format */
+#define EAUTH 80 /* Authentication error */
+#define ENEEDAUTH 81 /* Need authenticator */
+#define ELAST 81 /* Must be equal largest errno */
+#endif /* _POSIX_SOURCE */
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/time.h b/mit-pthreads/machdep/netbsd-1.0/time.h
new file mode 100755
index 00000000000..f2cc61f8d75
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/time.h
@@ -0,0 +1,125 @@
+/* $NetBSD: time.h,v 1.8 1994/06/29 06:45:44 cgd Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 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.
+ *
+ * @(#)time.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _SYS_TIME_H_
+#define _SYS_TIME_H_
+
+/*
+ * Structure returned by gettimeofday(2) system call,
+ * and used in other calls.
+ */
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+
+/*
+ * Structure defined by POSIX.4 to be like a timeval.
+ */
+struct timespec {
+ long tv_sec; /* seconds */
+ long tv_nsec; /* and nanoseconds */
+};
+
+#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; \
+}
+
+struct timezone {
+ int tz_minuteswest; /* minutes west of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+};
+#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 */
+#define DST_CAN 6 /* Canada */
+
+/* Operations on timevals. */
+#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+#define timercmp(tvp, uvp, cmp) \
+ (((tvp)->tv_sec == (uvp)->tv_sec) ? \
+ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec))
+
+/*
+ * Names of the interval timers, and structure
+ * defining a timer setting.
+ */
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+};
+
+/*
+ * Getkerninfo clock information structure
+ */
+struct clockinfo {
+ int hz; /* clock frequency */
+ int tick; /* micro-seconds per hz tick */
+ int stathz; /* statistics clock frequency */
+ int profhz; /* profiling clock frequency */
+};
+
+#include <time.h>
+
+#ifndef _POSIX_SOURCE
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+int adjtime __P_((const struct timeval *, struct timeval *));
+int getitimer __P_((int, struct itimerval *));
+int gettimeofday __P_((struct timeval *, struct timezone *));
+int setitimer __P_((int, const struct itimerval *, struct itimerval *));
+int settimeofday __P_((const struct timeval *, const struct timezone *));
+int utimes __P_((const char *, const struct timeval *));
+__END_DECLS
+#endif /* !POSIX */
+
+#endif /* !_SYS_TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.0/timers.h b/mit-pthreads/machdep/netbsd-1.0/timers.h
new file mode 100755
index 00000000000..f9768c68c8f
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/timers.h
@@ -0,0 +1,45 @@
+/* ==== 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/time.h>
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.0/wait.h b/mit-pthreads/machdep/netbsd-1.0/wait.h
new file mode 100755
index 00000000000..c1cd876d052
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.0/wait.h
@@ -0,0 +1,158 @@
+/* $NetBSD: wait.h,v 1.7 1994/06/29 06:46:23 cgd Exp $ */
+
+/*
+ * 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.
+ *
+ * @(#)wait.h 8.1 (Berkeley) 6/2/93
+ */
+
+/*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+/*
+ * Macros to test the exit status returned by wait
+ * and extract the relevant values.
+ */
+#ifdef _POSIX_SOURCE
+#define _W_INT(i) (i)
+#else
+#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
+#define WCOREFLAG 0200
+#endif
+
+#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
+
+/*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#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 */
+
+#include <machine/endian.h>
+
+/*
+ * Deprecated:
+ * Structure of the information in the status word returned by wait4.
+ * If w_stopval==WSTOPPED, then the second structure describes
+ * the information returned, else the first.
+ */
+union wait {
+ int w_status; /* used in syscall */
+ /*
+ * Terminated process status.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Termsig:7, /* termination signal */
+ w_Coredump:1, /* core dump indicator */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Coredump:1, /* core dump indicator */
+ w_Termsig:7; /* termination signal */
+#endif
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Stopval:8; /* == W_STOPPED if stopped */
+#endif
+ } w_S;
+};
+#define w_termsig w_T.w_Termsig
+#define w_coredump w_T.w_Coredump
+#define w_retcode w_T.w_Retcode
+#define w_stopval w_S.w_Stopval
+#define w_stopsig w_S.w_Stopsig
+
+#define WSTOPPED _WSTOPPED
+#endif /* _POSIX_SOURCE */
+
+#ifndef KERNEL
+#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 *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/__math.h b/mit-pthreads/machdep/netbsd-1.1/__math.h
new file mode 100755
index 00000000000..dc009d822f4
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__math.h
@@ -0,0 +1,6 @@
+/*
+ * ANSI/POSIX
+ */
+extern char __infinity[];
+#define HUGE_VAL (*(double *) __infinity)
+
diff --git a/mit-pthreads/machdep/netbsd-1.1/__path.h b/mit-pthreads/machdep/netbsd-1.1/__path.h
new file mode 100755
index 00000000000..be7f9f6c658
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__path.h
@@ -0,0 +1,14 @@
+/*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * __path.h,v 1.1 1995/01/03 12:53:32 proven Exp
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/share/zoneinfo"
+#define _PATH_TZFILE "/etc/localtime"
+
+#endif /* !_SYS__PATH_H_ */
+
diff --git a/mit-pthreads/machdep/netbsd-1.1/__signal.h b/mit-pthreads/machdep/netbsd-1.1/__signal.h
new file mode 100755
index 00000000000..e41e9218261
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__signal.h
@@ -0,0 +1,20 @@
+#include <sys/signal.h>
+
+#if NSIG <= 32
+#define __SIGEMPTYSET 0
+#define __SIGFILLSET 0xffffffff
+#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
+#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
+#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
+
+#else /* XXX Netbsd >= 1.3H */
+#define __SIGEMPTYSET { 0, 0, 0, 0}
+#define __SIGFILLSET { 0xffffffff, 0xffffffff, \
+ 0xffffffff, 0xffffffff }
+#define __SIGMASK(n) (1 << (((n) - 1) & 31))
+#define __SIGWORD(n) (((n) - 1) >> 5)
+#define __SIGADDSET(s, n) ((s)->__bits[__SIGWORD(n)] |= __SIGMASK(n))
+#define __SIGDELSET(s, n) ((s)->__bits[__SIGWORD(n)] &= ~__SIGMASK(n))
+#define __SIGISMEMBER(s, n) (((s)->__bits[__SIGWORD(n)] & __SIGMASK(n)) != 0)
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/__stdio.h b/mit-pthreads/machdep/netbsd-1.1/__stdio.h
new file mode 100755
index 00000000000..d60b9df7a54
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__stdio.h
@@ -0,0 +1,8 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/netbsd-1.1/__stdlib.h b/mit-pthreads/machdep/netbsd-1.1/__stdlib.h
new file mode 100755
index 00000000000..189bb5e8799
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__stdlib.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __stdlib.h,v 1.1 1995/01/03 12:53:34 proven Exp
+ */
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#ifdef _BSD_WCHAR_T_
+typedef _BSD_WCHAR_T_ wchar_t;
+#undef _BSD_WCHAR_T_
+#endif
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.1/__string.h b/mit-pthreads/machdep/netbsd-1.1/__string.h
new file mode 100755
index 00000000000..1ebee28e708
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__string.h
@@ -0,0 +1,20 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+/* Non-standard NetBSD 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 *));
+void strmode __P_((int, char *));
+char *strsep __P_((char **, const char *));
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/__time.h b/mit-pthreads/machdep/netbsd-1.1/__time.h
new file mode 100755
index 00000000000..27ceb815852
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__time.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * __time.h,v 1.1 1994/12/13 07:18:55 proven Exp
+ */
+
+#ifndef _SYS__TIME_H_
+#define _SYS__TIME_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_CLOCK_T_
+typedef _BSD_CLOCK_T_ clock_t;
+#undef _BSD_CLOCK_T_
+#endif
+
+#ifdef _BSD_TIME_T_
+typedef _BSD_TIME_T_ time_t;
+#undef _BSD_TIME_T_
+#endif
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#define CLOCKS_PER_SEC 100
+
+#if !defined(_ANSI_SOURCE)
+#define CLK_TCK 100
+#endif /* not ANSI */
+
+#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.1/__unistd.h b/mit-pthreads/machdep/netbsd-1.1/__unistd.h
new file mode 100755
index 00000000000..cea3165c229
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/__unistd.h
@@ -0,0 +1,107 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __unistd.h,v 1.1 1995/01/03 12:53:35 proven Exp
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* compile-time symbolic constants */
+#define _POSIX_JOB_CONTROL /* implementation supports job control */
+
+#ifdef _NOT_AVAILABLE
+#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
+#endif
+
+#define _POSIX_VERSION 198808L
+#define _POSIX2_VERSION 199212L
+
+/* execution-time symbolic constants */
+ /* chown requires appropriate privileges */
+#define _POSIX_CHOWN_RESTRICTED 1
+ /* too-long path components generate errors */
+#define _POSIX_NO_TRUNC 1
+ /* may disable terminal special characters */
+#define _POSIX_VDISABLE ((unsigned char)'\377')
+
+/* configurable pathname variables */
+#define _PC_LINK_MAX 1
+#define _PC_MAX_CANON 2
+#define _PC_MAX_INPUT 3
+#define _PC_NAME_MAX 4
+#define _PC_PATH_MAX 5
+#define _PC_PIPE_BUF 6
+#define _PC_CHOWN_RESTRICTED 7
+#define _PC_NO_TRUNC 8
+#define _PC_VDISABLE 9
+
+/* configurable system variables */
+#define _SC_ARG_MAX 1
+#define _SC_CHILD_MAX 2
+#define _SC_CLK_TCK 3
+#define _SC_NGROUPS_MAX 4
+#define _SC_OPEN_MAX 5
+#define _SC_JOB_CONTROL 6
+#define _SC_SAVED_IDS 7
+#define _SC_VERSION 8
+#define _SC_BC_BASE_MAX 9
+#define _SC_BC_DIM_MAX 10
+#define _SC_BC_SCALE_MAX 11
+#define _SC_BC_STRING_MAX 12
+#define _SC_COLL_WEIGHTS_MAX 13
+#define _SC_EXPR_NEST_MAX 14
+#define _SC_LINE_MAX 15
+#define _SC_RE_DUP_MAX 16
+#define _SC_2_VERSION 17
+#define _SC_2_C_BIND 18
+#define _SC_2_C_DEV 19
+#define _SC_2_CHAR_TERM 20
+#define _SC_2_FORT_DEV 21
+#define _SC_2_FORT_RUN 22
+#define _SC_2_LOCALEDEF 23
+#define _SC_2_SW_DEV 24
+#define _SC_2_UPE 25
+#define _SC_STREAM_MAX 26
+#define _SC_TZNAME_MAX 27
+
+/* configurable system strings */
+#define _CS_PATH 1
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/compat.h b/mit-pthreads/machdep/netbsd-1.1/compat.h
new file mode 100755
index 00000000000..f843795cc0a
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/compat.h
@@ -0,0 +1,43 @@
+/* ==== 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.
+ *
+ * compat.h,v 1.50 1994/08/08 03:44:05 proven Exp
+ *
+ * Description : COmpat header to make socket code compile.
+ *
+ * 1.00 94/08/01 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/dirent.h b/mit-pthreads/machdep/netbsd-1.1/dirent.h
new file mode 100755
index 00000000000..cf004a274d6
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/dirent.h
@@ -0,0 +1,95 @@
+/* $NetBSD: dirent.h,v 1.12 1996/04/09 20:55:25 cgd Exp $ */
+
+/*-
+ * Copyright (c) 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.
+ *
+ * @(#)dirent.h 8.3 (Berkeley) 8/10/94
+ */
+
+/*
+ * The dirent structure defines the format of directory entries returned by
+ * the getdirentries(2) system call.
+ *
+ * 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_int32_t d_fileno; /* file number of entry */
+ u_int16_t d_reclen; /* length of this record */
+ u_int8_t d_type; /* file type, see below */
+ u_int8_t 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
+};
+
+#ifdef PTHREAD_KERNEL
+#define d_ino d_fileno
+#endif
+
+/*
+ * File types
+ */
+#define DT_UNKNOWN 0
+#define DT_FIFO 1
+#define DT_CHR 2
+#define DT_DIR 4
+#define DT_BLK 6
+#define DT_REG 8
+#define DT_LNK 10
+#define DT_SOCK 12
+#define DT_WHT 14
+
+/*
+ * Convert between stat structure types and directory types.
+ */
+#define IFTODT(mode) (((mode) & 0170000) >> 12)
+#define DTTOIF(dirtype) ((dirtype) << 12)
+
+#if defined(_KERNEL)
+/*
+ * The DIRENT_SIZE macro gives the minimum record length which will hold
+ * the directory entry. This requires the amount of space in struct dirent
+ * without the d_name field, plus enough space for the name with a terminating
+ * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
+ */
+#define DIRENT_SIZE(dp) \
+ ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
+
+#endif /* !_KERNEL */
diff --git a/mit-pthreads/machdep/netbsd-1.1/errno.h b/mit-pthreads/machdep/netbsd-1.1/errno.h
new file mode 100755
index 00000000000..c313b578c5a
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/errno.h
@@ -0,0 +1,170 @@
+/* $NetBSD: errno.h,v 1.10 1996/01/20 01:33:53 jtc Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ */
+
+#ifndef _KERNEL
+extern int errno; /* global error number */
+
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+extern int sys_nerr;
+extern const char *const sys_errlist[];
+#endif
+#endif
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#endif
+#define EBUSY 16 /* Device busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define ETXTBSY 26 /* Text file busy */
+#endif
+#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 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define EAGAIN 35 /* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define EWOULDBLOCK EAGAIN /* 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 */
+#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 */
+
+/* ipc/network software -- 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 /* Operation timed out */
+#define ECONNREFUSED 61 /* Connection refused */
+
+#define ELOOP 62 /* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define ENAMETOOLONG 63 /* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+#endif /* _POSIX_SOURCE */
+#define ENOTEMPTY 66 /* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#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 */
+#define EBADRPC 72 /* RPC struct is bad */
+#define ERPCMISMATCH 73 /* RPC version wrong */
+#define EPROGUNAVAIL 74 /* RPC prog. not avail */
+#define EPROGMISMATCH 75 /* Program version wrong */
+#define EPROCUNAVAIL 76 /* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define ENOLCK 77 /* No locks available */
+#define ENOSYS 78 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define EFTYPE 79 /* Inappropriate file type or format */
+#define EAUTH 80 /* Authentication error */
+#define ENEEDAUTH 81 /* Need authenticator */
+#define ELAST 81 /* Must be equal largest errno */
+#endif /* _POSIX_SOURCE */
+
+#ifdef _KERNEL
+/* pseudo-errors returned inside kernel to modify return to process */
+#define ERESTART -1 /* restart syscall */
+#define EJUSTRETURN -2 /* don't modify regs, just return */
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/time.h b/mit-pthreads/machdep/netbsd-1.1/time.h
new file mode 100755
index 00000000000..a701db9c62e
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/time.h
@@ -0,0 +1,153 @@
+/* $NetBSD: time.h,v 1.17 1996/02/01 00:10:36 jtc Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 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.
+ *
+ * @(#)time.h 8.2 (Berkeley) 7/10/94
+ */
+
+#ifndef _SYS_TIME_H_
+#define _SYS_TIME_H_
+
+#include <sys/types.h>
+
+/*
+ * Structure returned by gettimeofday(2) system call,
+ * and used in other calls.
+ */
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+
+/*
+ * Structure defined by POSIX.1b to be like a timeval.
+ */
+struct timespec {
+ time_t tv_sec; /* seconds */
+ long tv_nsec; /* and nanoseconds */
+};
+
+#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; \
+}
+
+struct timezone {
+ int tz_minuteswest; /* minutes west of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+};
+#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 */
+#define DST_CAN 6 /* Canada */
+
+/* Operations on timevals. */
+#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+#define timercmp(tvp, uvp, cmp) \
+ (((tvp)->tv_sec == (uvp)->tv_sec) ? \
+ ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec))
+#define timeradd(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
+ if ((vvp)->tv_usec >= 1000000) { \
+ (vvp)->tv_sec++; \
+ (vvp)->tv_usec -= 1000000; \
+ } \
+ } while (0)
+#define timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+
+/*
+ * Names of the interval timers, and structure
+ * defining a timer setting.
+ */
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+};
+
+/*
+ * Getkerninfo clock information structure
+ */
+struct clockinfo {
+ int hz; /* clock frequency */
+ int tick; /* micro-seconds per hz tick */
+ int tickadj; /* clock skew rate for adjtime() */
+ int stathz; /* statistics clock frequency */
+ int profhz; /* profiling clock frequency */
+};
+
+#ifdef _KERNEL
+int itimerfix __P_((struct timeval *tv));
+int itimerdecr __P_((struct itimerval *itp, int usec));
+void microtime __P_((struct timeval *tv));
+#else /* !_KERNEL */
+#include <time.h>
+
+#ifndef _POSIX_SOURCE
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+int adjtime __P_((const struct timeval *, struct timeval *));
+int getitimer __P_((int, struct itimerval *));
+int gettimeofday __P_((struct timeval *, struct timezone *));
+int setitimer __P_((int, const struct itimerval *, struct itimerval *));
+int settimeofday __P_((const struct timeval *, const struct timezone *));
+int utimes __P_((const char *, const struct timeval *));
+__END_DECLS
+#endif /* !POSIX */
+
+#endif /* !_KERNEL */
+
+#endif /* !_SYS_TIME_H_ */
diff --git a/mit-pthreads/machdep/netbsd-1.1/timers.h b/mit-pthreads/machdep/netbsd-1.1/timers.h
new file mode 100755
index 00000000000..b603b78e6b2
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/timers.h
@@ -0,0 +1,45 @@
+/* ==== 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.
+ *
+ * timers.h,v 1.50 1994/08/08 03:44:09 proven Exp
+ *
+ * Description : Basic timers header.
+ *
+ * 1.00 94/06/13 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_TIMERS_H_
+#define _SYS_TIMERS_H_
+
+#include <sys/time.h>
+
+#endif
diff --git a/mit-pthreads/machdep/netbsd-1.1/wait.h b/mit-pthreads/machdep/netbsd-1.1/wait.h
new file mode 100755
index 00000000000..0a1e9285e56
--- /dev/null
+++ b/mit-pthreads/machdep/netbsd-1.1/wait.h
@@ -0,0 +1,163 @@
+/* $NetBSD: wait.h,v 1.11 1996/04/09 20:55:51 cgd Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993, 1994
+ * 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.
+ *
+ * @(#)wait.h 8.2 (Berkeley) 7/10/94
+ */
+
+#ifndef _SYS_WAIT_H_
+#define _SYS_WAIT_H_
+
+/*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+/*
+ * Macros to test the exit status returned by wait
+ * and extract the relevant values.
+ */
+#ifdef _POSIX_SOURCE
+#define _W_INT(i) (i)
+#else
+#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
+#define WCOREFLAG 0200
+#endif
+
+#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
+
+/*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#define WNOHANG 1 /* don't 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 */
+
+#include <machine/endian.h>
+
+/*
+ * Deprecated:
+ * Structure of the information in the status word returned by wait4.
+ * If w_stopval==WSTOPPED, then the second structure describes
+ * the information returned, else the first.
+ */
+union wait {
+ int w_status; /* used in syscall */
+ /*
+ * Terminated process status.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Termsig:7, /* termination signal */
+ w_Coredump:1, /* core dump indicator */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Coredump:1, /* core dump indicator */
+ w_Termsig:7; /* termination signal */
+#endif
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Stopval:8; /* == W_STOPPED if stopped */
+#endif
+ } w_S;
+};
+#define w_termsig w_T.w_Termsig
+#define w_coredump w_T.w_Coredump
+#define w_retcode w_T.w_Retcode
+#define w_stopval w_S.w_Stopval
+#define w_stopsig w_S.w_Stopsig
+
+#define WSTOPPED _WSTOPPED
+#endif /* _POSIX_SOURCE */
+
+#ifndef _KERNEL
+#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 *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+__END_DECLS
+#endif
+
+#endif /* !_SYS_WAIT_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__math.h b/mit-pthreads/machdep/openbsd-2.0/__math.h
new file mode 100755
index 00000000000..27ed0f2575d
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__math.h
@@ -0,0 +1,6 @@
+/*
+ * ANSI/POSIX
+ */
+extern char __infinity[];
+#define HUGE_VAL (*(double *) __infinity)
+
diff --git a/mit-pthreads/machdep/openbsd-2.0/__path.h b/mit-pthreads/machdep/openbsd-2.0/__path.h
new file mode 100755
index 00000000000..432494daafa
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__path.h
@@ -0,0 +1,14 @@
+/*
+ * from: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/share/zoneinfo"
+#define _PATH_TZFILE "/etc/localtime"
+
+#endif /* !_SYS__PATH_H_ */
+
diff --git a/mit-pthreads/machdep/openbsd-2.0/__signal.h b/mit-pthreads/machdep/openbsd-2.0/__signal.h
new file mode 100755
index 00000000000..918955c9948
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__signal.h
@@ -0,0 +1,8 @@
+#include <sys/signal.h>
+
+#define __SIGEMPTYSET 0
+#define __SIGFILLSET 0xffffffff
+#define __SIGADDSET(s, n) (*(s) |= 1 << ((n) - 1), 0)
+#define __SIGDELSET(s, n) (*(s) &= ~(1 << ((n) - 1)), 0)
+#define __SIGISMEMBER(s, n) ((*(s) & (1 << ((n) - 1))) != 0)
+
diff --git a/mit-pthreads/machdep/openbsd-2.0/__stdio.h b/mit-pthreads/machdep/openbsd-2.0/__stdio.h
new file mode 100755
index 00000000000..d60b9df7a54
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__stdio.h
@@ -0,0 +1,8 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+typedef pthread_fpos_t fpos_t; /* Must match off_t <sys/types.h> */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__stdlib.h b/mit-pthreads/machdep/openbsd-2.0/__stdlib.h
new file mode 100755
index 00000000000..5ee2b8ed3d9
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__stdlib.h
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <machine/ansi.h>
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#ifdef _BSD_WCHAR_T_
+typedef _BSD_WCHAR_T_ wchar_t;
+#ifdef _BSD_RUNE_T_
+typedef _BSD_RUNE_T_ rune_t;
+#undef _BSD_RUNE_T_
+#else
+typedef _BSD_WCHAR_T_ rune_t;
+#endif
+#undef _BSD_WCHAR_T_
+#endif
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif /* _STDLIB_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__string.h b/mit-pthreads/machdep/openbsd-2.0/__string.h
new file mode 100755
index 00000000000..93d4fcf9dd2
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__string.h
@@ -0,0 +1,21 @@
+
+#include <machine/ansi.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+/* Non-standard NetBSD 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 *));
+void strmode __P_((int, char *));
+char *strsep __P_((char **, const char *));
+__END_DECLS
+#endif
+
diff --git a/mit-pthreads/machdep/openbsd-2.0/__time.h b/mit-pthreads/machdep/openbsd-2.0/__time.h
new file mode 100755
index 00000000000..5c4b722bc3c
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__time.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__TIME_H_
+#define _SYS__TIME_H_
+
+#include <machine/ansi.h>
+#include <machine/limits.h>
+
+#ifdef _BSD_CLOCK_T_
+typedef _BSD_CLOCK_T_ clock_t;
+#undef _BSD_CLOCK_T_
+#endif
+
+#ifdef _BSD_TIME_T_
+typedef _BSD_TIME_T_ time_t;
+#undef _BSD_TIME_T_
+#endif
+
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
+
+#define CLOCKS_PER_SEC 100
+
+#if !defined(CLK_TCK)
+#define CLK_TCK 100
+#endif /* not CLK_TCK */
+
+#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/__unistd.h b/mit-pthreads/machdep/openbsd-2.0/__unistd.h
new file mode 100755
index 00000000000..41244522461
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/__unistd.h
@@ -0,0 +1,109 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define ioctl_request_type unsigned long /* For fd.c */
+
+/* compile-time symbolic constants */
+#define _POSIX_JOB_CONTROL /* implementation supports job control */
+
+#ifdef _NOT_AVAILABLE
+#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */
+#endif
+
+#define _POSIX_VERSION 198808L
+#define _POSIX2_VERSION 199212L
+
+/* execution-time symbolic constants */
+ /* chown requires appropriate privileges */
+#define _POSIX_CHOWN_RESTRICTED 1
+ /* too-long path components generate errors */
+#define _POSIX_NO_TRUNC 1
+ /* may disable terminal special characters */
+/* #define _POSIX_VDISABLE 0xff */
+
+/* configurable pathname variables */
+#define _PC_LINK_MAX 1
+#define _PC_MAX_CANON 2
+#define _PC_MAX_INPUT 3
+#define _PC_NAME_MAX 4
+#define _PC_PATH_MAX 5
+#define _PC_PIPE_BUF 6
+#define _PC_CHOWN_RESTRICTED 7
+#define _PC_NO_TRUNC 8
+#define _PC_VDISABLE 9
+
+/* configurable system variables */
+#define _SC_ARG_MAX 1
+#define _SC_CHILD_MAX 2
+#define _SC_CLK_TCK 3
+#define _SC_NGROUPS_MAX 4
+#define _SC_OPEN_MAX 5
+#define _SC_JOB_CONTROL 6
+#define _SC_SAVED_IDS 7
+#define _SC_VERSION 8
+#define _SC_BC_BASE_MAX 9
+#define _SC_BC_DIM_MAX 10
+#define _SC_BC_SCALE_MAX 11
+#define _SC_BC_STRING_MAX 12
+#define _SC_COLL_WEIGHTS_MAX 13
+#define _SC_EXPR_NEST_MAX 14
+#define _SC_LINE_MAX 15
+#define _SC_RE_DUP_MAX 16
+#define _SC_2_VERSION 17
+#define _SC_2_C_BIND 18
+#define _SC_2_C_DEV 19
+#define _SC_2_CHAR_TERM 20
+#define _SC_2_FORT_DEV 21
+#define _SC_2_FORT_RUN 22
+#define _SC_2_LOCALEDEF 23
+#define _SC_2_SW_DEV 24
+#define _SC_2_UPE 25
+#define _SC_STREAM_MAX 26
+#define _SC_TZNAME_MAX 27
+
+/* configurable system strings */
+#define _CS_PATH 1
+
+#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/compat.h b/mit-pthreads/machdep/openbsd-2.0/compat.h
new file mode 100755
index 00000000000..e7de318aa88
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/compat.h
@@ -0,0 +1,43 @@
+/* ==== 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 : COmpat header to make socket code compile.
+ *
+ * 1.00 94/08/01 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/dirent.h b/mit-pthreads/machdep/openbsd-2.0/dirent.h
new file mode 100755
index 00000000000..5226443f86b
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 /* backward compatibility */
+
+/* definitions for library routines operating on directories. */
+#define DIRBLKSIZ 1024
+
+#endif /* !_DIRENT_H_ */
diff --git a/mit-pthreads/machdep/openbsd-2.0/errno.h b/mit-pthreads/machdep/openbsd-2.0/errno.h
new file mode 100755
index 00000000000..3da61d692a3
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/errno.h
@@ -0,0 +1,160 @@
+/* $NetBSD: errno.h,v 1.8 1994/06/29 06:44:02 cgd Exp $ */
+
+/*
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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.
+ *
+ * @(#)errno.h 8.5 (Berkeley) 1/21/94
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EDEADLK 11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#endif
+#define EBUSY 16 /* Device busy */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+#ifndef _POSIX_SOURCE
+#define ETXTBSY 26 /* Text file busy */
+#endif
+#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 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+
+/* non-blocking and interrupt i/o */
+#define EAGAIN 35 /* Resource temporarily unavailable */
+#ifndef _POSIX_SOURCE
+#define EWOULDBLOCK EAGAIN /* 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 */
+#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 */
+
+/* ipc/network software -- 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 /* Operation timed out */
+#define ECONNREFUSED 61 /* Connection refused */
+
+#define ELOOP 62 /* Too many levels of symbolic links */
+#endif /* _POSIX_SOURCE */
+#define ENAMETOOLONG 63 /* File name too long */
+
+/* should be rearranged */
+#ifndef _POSIX_SOURCE
+#define EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+#endif /* _POSIX_SOURCE */
+#define ENOTEMPTY 66 /* Directory not empty */
+
+/* quotas & mush */
+#ifndef _POSIX_SOURCE
+#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 */
+#define EBADRPC 72 /* RPC struct is bad */
+#define ERPCMISMATCH 73 /* RPC version wrong */
+#define EPROGUNAVAIL 74 /* RPC prog. not avail */
+#define EPROGMISMATCH 75 /* Program version wrong */
+#define EPROCUNAVAIL 76 /* Bad procedure for program */
+#endif /* _POSIX_SOURCE */
+
+#define ENOLCK 77 /* No locks available */
+#define ENOSYS 78 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define EFTYPE 79 /* Inappropriate file type or format */
+#define EAUTH 80 /* Authentication error */
+#define ENEEDAUTH 81 /* Need authenticator */
+#define ELAST 81 /* Must be equal largest errno */
+#endif /* _POSIX_SOURCE */
+
+#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/timers.h b/mit-pthreads/machdep/openbsd-2.0/timers.h
new file mode 100755
index 00000000000..f9768c68c8f
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/timers.h
@@ -0,0 +1,45 @@
+/* ==== 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/time.h>
+
+#endif
diff --git a/mit-pthreads/machdep/openbsd-2.0/wait.h b/mit-pthreads/machdep/openbsd-2.0/wait.h
new file mode 100755
index 00000000000..7861e3fa180
--- /dev/null
+++ b/mit-pthreads/machdep/openbsd-2.0/wait.h
@@ -0,0 +1,162 @@
+/*
+ * 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.
+ *
+ * @(#)wait.h 8.1 (Berkeley) 6/2/93
+ * $Id$
+ */
+
+#ifndef _SYS_WAIT_H_
+#define _SYS_WAIT_H_
+
+/*
+ * This file holds definitions relevent to the wait4 system call
+ * and the alternate interfaces that use it (wait, wait3, waitpid).
+ */
+
+/*
+ * Macros to test the exit status returned by wait
+ * and extract the relevant values.
+ */
+#ifdef _POSIX_SOURCE
+#define _W_INT(i) (i)
+#else
+#define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */
+#define WCOREFLAG 0200
+#endif
+
+#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
+
+/*
+ * Option bits for the third argument of wait4. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#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 */
+
+#include <machine/endian.h>
+
+/*
+ * Deprecated:
+ * Structure of the information in the status word returned by wait4.
+ * If w_stopval==WSTOPPED, then the second structure describes
+ * the information returned, else the first.
+ */
+union wait {
+ int w_status; /* used in syscall */
+ /*
+ * Terminated process status.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Termsig:7, /* termination signal */
+ w_Coredump:1, /* core dump indicator */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Retcode:8, /* exit code if w_termsig==0 */
+ w_Coredump:1, /* core dump indicator */
+ w_Termsig:7; /* termination signal */
+#endif
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
+ unsigned int w_Stopval:8, /* == W_STOPPED if stopped */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Filler:16; /* upper bits filler */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+ unsigned int w_Filler:16, /* upper bits filler */
+ w_Stopsig:8, /* signal that stopped us */
+ w_Stopval:8; /* == W_STOPPED if stopped */
+#endif
+ } w_S;
+};
+#define w_termsig w_T.w_Termsig
+#define w_coredump w_T.w_Coredump
+#define w_retcode w_T.w_Retcode
+#define w_stopval w_S.w_Stopval
+#define w_stopsig w_S.w_Stopsig
+
+#define WSTOPPED _WSTOPPED
+#endif /* _POSIX_SOURCE */
+
+#ifndef KERNEL
+#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 *));
+pid_t wait4 __P_((pid_t, int *, int, void *));
+#endif
+__END_DECLS
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-alpha-osf1.h b/mit-pthreads/machdep/posix-alpha-osf1.h
new file mode 100644
index 00000000000..1d8bb6c5c4b
--- /dev/null
+++ b/mit-pthreads/machdep/posix-alpha-osf1.h
@@ -0,0 +1,7 @@
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#define __WAIT_STATUS int *
+#include <pthread/types.h>
+
+#endif
diff --git a/mit-pthreads/machdep/posix-bsdi-1.1.h b/mit-pthreads/machdep/posix-bsdi-1.1.h
new file mode 100644
index 00000000000..4c56ea93a3b
--- /dev/null
+++ b/mit-pthreads/machdep/posix-bsdi-1.1.h
@@ -0,0 +1,34 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#define __NORETURN
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
+
diff --git a/mit-pthreads/machdep/posix-bsdi-2.0.h b/mit-pthreads/machdep/posix-bsdi-2.0.h
new file mode 100644
index 00000000000..4c56ea93a3b
--- /dev/null
+++ b/mit-pthreads/machdep/posix-bsdi-2.0.h
@@ -0,0 +1,34 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#define __NORETURN
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
+
diff --git a/mit-pthreads/machdep/posix-freebsd-1.1.h b/mit-pthreads/machdep/posix-freebsd-1.1.h
new file mode 100644
index 00000000000..e1a00e9efd1
--- /dev/null
+++ b/mit-pthreads/machdep/posix-freebsd-1.1.h
@@ -0,0 +1,33 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#define __NORETURN
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-freebsd-2.0.h b/mit-pthreads/machdep/posix-freebsd-2.0.h
new file mode 100644
index 00000000000..7bad77aba02
--- /dev/null
+++ b/mit-pthreads/machdep/posix-freebsd-2.0.h
@@ -0,0 +1,31 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-hpux-10.20.h b/mit-pthreads/machdep/posix-hpux-10.20.h
new file mode 100644
index 00000000000..c7ecb429e79
--- /dev/null
+++ b/mit-pthreads/machdep/posix-hpux-10.20.h
@@ -0,0 +1,23 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
+
diff --git a/mit-pthreads/machdep/posix-hpux-9.03.h b/mit-pthreads/machdep/posix-hpux-9.03.h
new file mode 100644
index 00000000000..c7ecb429e79
--- /dev/null
+++ b/mit-pthreads/machdep/posix-hpux-9.03.h
@@ -0,0 +1,23 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
+
diff --git a/mit-pthreads/machdep/posix-i386-sco-3.2v5.h b/mit-pthreads/machdep/posix-i386-sco-3.2v5.h
new file mode 100644
index 00000000000..ab91311612d
--- /dev/null
+++ b/mit-pthreads/machdep/posix-i386-sco-3.2v5.h
@@ -0,0 +1,35 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * posix-freebsd-2.0.h,v 1.1 1995/03/01 01:21:30 proven Exp
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-irix-5.2.h b/mit-pthreads/machdep/posix-irix-5.2.h
new file mode 100644
index 00000000000..d387bbbbf69
--- /dev/null
+++ b/mit-pthreads/machdep/posix-irix-5.2.h
@@ -0,0 +1,31 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1995 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an IRIX-5.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 95/06/01 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-linux-1.0.h b/mit-pthreads/machdep/posix-linux-1.0.h
new file mode 100644
index 00000000000..7f665d6b44a
--- /dev/null
+++ b/mit-pthreads/machdep/posix-linux-1.0.h
@@ -0,0 +1,31 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993, 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Convert a Linux-1.0 system to a more or less POSIX system.
+ * Mostly POSIX already
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#define __INLINE extern inline
+/*
+ * OK now do stuff to make the code compile.
+ * Every OS has its own prototypes for each function
+ */
+#ifdef malloc
+#undef malloc
+#endif
+
+#ifdef free
+#undef free
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-linux-2.0.h b/mit-pthreads/machdep/posix-linux-2.0.h
new file mode 100644
index 00000000000..7f665d6b44a
--- /dev/null
+++ b/mit-pthreads/machdep/posix-linux-2.0.h
@@ -0,0 +1,31 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993, 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Convert a Linux-1.0 system to a more or less POSIX system.
+ * Mostly POSIX already
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#define __INLINE extern inline
+/*
+ * OK now do stuff to make the code compile.
+ * Every OS has its own prototypes for each function
+ */
+#ifdef malloc
+#undef malloc
+#endif
+
+#ifdef free
+#undef free
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-netbsd-0.9.h b/mit-pthreads/machdep/posix-netbsd-0.9.h
new file mode 100644
index 00000000000..00ff2efa327
--- /dev/null
+++ b/mit-pthreads/machdep/posix-netbsd-0.9.h
@@ -0,0 +1,22 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#define __NORETURN
+
+#endif
diff --git a/mit-pthreads/machdep/posix-netbsd-1.0.h b/mit-pthreads/machdep/posix-netbsd-1.0.h
new file mode 100644
index 00000000000..7bad77aba02
--- /dev/null
+++ b/mit-pthreads/machdep/posix-netbsd-1.0.h
@@ -0,0 +1,31 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-netbsd-1.1.h b/mit-pthreads/machdep/posix-netbsd-1.1.h
new file mode 100644
index 00000000000..f4ff1dfae05
--- /dev/null
+++ b/mit-pthreads/machdep/posix-netbsd-1.1.h
@@ -0,0 +1,31 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * posix-netbsd-1.0.h,v 1.53 1995/02/17 03:41:34 proven Exp
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-openbsd-2.0.h b/mit-pthreads/machdep/posix-openbsd-2.0.h
new file mode 100644
index 00000000000..7bad77aba02
--- /dev/null
+++ b/mit-pthreads/machdep/posix-openbsd-2.0.h
@@ -0,0 +1,31 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * $Id$
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-romp-bsd.h b/mit-pthreads/machdep/posix-romp-bsd.h
new file mode 100644
index 00000000000..7825622b064
--- /dev/null
+++ b/mit-pthreads/machdep/posix-romp-bsd.h
@@ -0,0 +1,33 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert a system to a more or less POSIX system.
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+#ifndef O_NONBLOCK
+#ifdef FNDELAY
+#define O_NONBLOCK FNDELAY
+#endif
+#endif
+
+#ifndef O_ACCMODE
+#define O_ACCMODE (O_RDONLY|O_RDWR|O_WRONLY)
+#endif
+
+#ifndef S_ISREG
+#define S_ISREG(x) ((x & S_IFMT) == S_IFREG)
+#endif
+
+#ifndef ENOSYS
+#define ENOSYS EINVAL
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
diff --git a/mit-pthreads/machdep/posix-sco-3.2v5.h b/mit-pthreads/machdep/posix-sco-3.2v5.h
new file mode 100644
index 00000000000..ab91311612d
--- /dev/null
+++ b/mit-pthreads/machdep/posix-sco-3.2v5.h
@@ -0,0 +1,35 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * posix-freebsd-2.0.h,v 1.1 1995/03/01 01:21:30 proven Exp
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* More stuff for compiling */
+#if defined(__GNUC__)
+#define __INLINE extern inline
+#else
+#define __INLINE static
+#endif
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __NORETURN
+#define __NORETURN
+#endif
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-sunos-4.1.3.h b/mit-pthreads/machdep/posix-sunos-4.1.3.h
new file mode 100644
index 00000000000..719386bc558
--- /dev/null
+++ b/mit-pthreads/machdep/posix-sunos-4.1.3.h
@@ -0,0 +1,27 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Do the right thing for a sunos 4.1.3 system.
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+extern long strtol();
+extern unsigned long strtoul();
+
+#endif
diff --git a/mit-pthreads/machdep/posix-sunos-5.3.h b/mit-pthreads/machdep/posix-sunos-5.3.h
new file mode 100644
index 00000000000..9fb765d60c3
--- /dev/null
+++ b/mit-pthreads/machdep/posix-sunos-5.3.h
@@ -0,0 +1,22 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Do the right thing for a sunos 4.1.3 system.
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-sunos-5.5.h b/mit-pthreads/machdep/posix-sunos-5.5.h
new file mode 100644
index 00000000000..9fb765d60c3
--- /dev/null
+++ b/mit-pthreads/machdep/posix-sunos-5.5.h
@@ -0,0 +1,22 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Do the right thing for a sunos 4.1.3 system.
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/posix-ultrix-4.2.h b/mit-pthreads/machdep/posix-ultrix-4.2.h
new file mode 100644
index 00000000000..f21aec23ea3
--- /dev/null
+++ b/mit-pthreads/machdep/posix-ultrix-4.2.h
@@ -0,0 +1,24 @@
+/* ==== posix.h ============================================================
+ * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * $Id$
+ *
+ * Description : Convert an Ultrix-4.2 system to a more or less POSIX system.
+ *
+ * 1.00 93/07/20 proven
+ * -Started coding this file.
+ */
+
+#ifndef _PTHREAD_POSIX_H_
+#define _PTHREAD_POSIX_H_
+
+#include <sys/cdefs.h>
+
+/* Make sure we have size_t defined */
+#include <pthread/types.h>
+
+#ifndef __WAIT_STATUS
+#define __WAIT_STATUS int *
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/__math.h b/mit-pthreads/machdep/sco-3.2v5/__math.h
new file mode 100755
index 00000000000..4852683fcbf
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/__math.h
@@ -0,0 +1,219 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/__math.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/__math.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/__math.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/__math.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/__math.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___MATH_H
+#define ___MATH_H
+
+#pragma comment(exestr, "xpg4plus @(#) math.h 20.1 94/12/04 ")
+
+#pragma pack(4)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern double acos(double);
+extern double asin(double);
+extern double atan(double);
+extern double atan2(double, double);
+extern double cos(double);
+extern double sin(double);
+extern double tan(double);
+
+extern double cosh(double);
+extern double sinh(double);
+extern double tanh(double);
+
+extern double exp(double);
+extern double frexp(double, int *);
+extern double ldexp(double, int);
+extern double log(double);
+extern double log10(double);
+extern double modf(double, double *);
+
+extern double pow(double, double);
+extern double sqrt(double);
+
+extern double ceil(double);
+extern double fabs(double);
+extern double floor(double);
+extern double fmod(double, double);
+
+#ifndef HUGE_VAL
+extern const double __huge_val;
+#define HUGE_VAL (+__huge_val)
+#endif
+
+
+extern double erf(double);
+extern double erfc(double);
+extern double gamma(double);
+extern double hypot(double, double);
+extern double j0(double);
+extern double j1(double);
+extern double jn(int, double);
+extern double y0(double);
+extern double y1(double);
+extern double yn(int, double);
+extern double lgamma(double);
+extern int isnan(double);
+
+#define MAXFLOAT ((float)3.40282346638528860e+38)
+
+
+
+#define HUGE MAXFLOAT
+
+/*
+ * The following are all legal as XPG4 external functions but must only
+ * be declared in the non standards environments as they conflict with
+ * the user name space
+ */
+
+extern long double frexpl(long double, int *);
+extern long double ldexpl(long double, int);
+extern long double modfl(long double, long double *);
+
+extern float acosf(float);
+extern float asinf(float);
+extern float atanf(float);
+extern float atan2f(float, float);
+extern float cosf(float);
+extern float sinf(float);
+extern float tanf(float);
+
+extern float coshf(float);
+extern float sinhf(float);
+extern float tanhf(float);
+
+extern float expf(float);
+extern float logf(float);
+extern float log10f(float);
+
+extern float powf(float, float);
+extern float sqrtf(float);
+
+extern float ceilf(float);
+extern float fabsf(float);
+extern float floorf(float);
+extern float fmodf(float, float);
+extern float modff(float, float *);
+
+/* These are all extensions from XPG4 */
+
+extern double atof(const char *);
+extern double scalb(double, double);
+extern double logb(double);
+extern double log1p(double);
+extern double nextafter(double, double);
+extern double acosh(double);
+extern double asinh(double);
+extern double atanh(double);
+extern double cbrt(double);
+extern double copysign(double, double);
+extern double expm1(double);
+extern int ilogb(double);
+extern double remainder(double, double);
+extern double rint(double);
+extern int unordered(double, double);
+extern int finite(double);
+
+extern long double scalbl(long double, long double);
+extern long double logbl(long double);
+extern long double nextafterl(long double, long double);
+extern int unorderedl(long double, long double);
+extern int finitel(long double);
+
+
+
+
+extern int signgam;
+
+#define M_E 2.7182818284590452354
+#define M_LOG2E 1.4426950408889634074
+#define M_LOG10E 0.43429448190325182765
+#define M_LN2 0.69314718055994530942
+#define M_LN10 2.30258509299404568402
+#define M_PI 3.14159265358979323846
+#define M_PI_2 1.57079632679489661923
+#define M_PI_4 0.78539816339744830962
+#define M_1_PI 0.31830988618379067154
+#define M_2_PI 0.63661977236758134308
+#define M_2_SQRTPI 1.12837916709551257390
+#define M_SQRT2 1.41421356237309504880
+#define M_SQRT1_2 0.70710678118654752440
+
+
+
+#define _ABS(x) ((x) < 0 ? -(x) : (x))
+
+#define _REDUCE(TYPE, X, XN, C1, C2) { \
+ double x1 = (double)(TYPE)X, x2 = X - x1; \
+ X = x1 - (XN) * (C1); X += x2; X -= (XN) * (C2); }
+
+#define DOMAIN 1
+#define SING 2
+#define OVERFLOW 3
+#define UNDERFLOW 4
+#define TLOSS 5
+#define PLOSS 6
+
+#define _POLY1(x, c) ((c)[0] * (x) + (c)[1])
+#define _POLY2(x, c) (_POLY1((x), (c)) * (x) + (c)[2])
+#define _POLY3(x, c) (_POLY2((x), (c)) * (x) + (c)[3])
+#define _POLY4(x, c) (_POLY3((x), (c)) * (x) + (c)[4])
+#define _POLY5(x, c) (_POLY4((x), (c)) * (x) + (c)[5])
+#define _POLY6(x, c) (_POLY5((x), (c)) * (x) + (c)[6])
+#define _POLY7(x, c) (_POLY6((x), (c)) * (x) + (c)[7])
+#define _POLY8(x, c) (_POLY7((x), (c)) * (x) + (c)[8])
+#define _POLY9(x, c) (_POLY8((x), (c)) * (x) + (c)[9])
+
+
+#ifdef __cplusplus
+}
+inline int sqr(int i) {return(i*i);}
+inline double sqr(double i) {return(i*i);}
+
+#endif /* __cplusplus */
+
+#pragma pack()
+
+#if __cplusplus && !defined(PI)
+#define PI M_PI
+#endif /* __cplusplus */
+
+#endif /* _MATH_H */
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/__signal.h b/mit-pthreads/machdep/sco-3.2v5/__signal.h
new file mode 100755
index 00000000000..6a33d37a261
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/__signal.h
@@ -0,0 +1,109 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <sys/oldstyle/signal.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/signal.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <sys/posix/__signal.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <sys/ansi/signal.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <sys/ods_30_compat/signal.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___SIGNAL_H
+#define ___SIGNAL_H
+
+#pragma comment(exestr, "xpg4plus @(#) signal.h 20.3 94/12/19 ")
+
+#ifndef _SIG_ATOMIC_T
+#define _SIG_ATOMIC_T
+ /* atomic entity for signal handling */
+typedef int sig_atomic_t;
+#endif
+
+extern const char * const _sys_siglist[];
+extern const int _sys_nsig;
+
+#ifndef _SYS_SIGNAL_H
+#include <sys/signal.h>
+#endif
+
+#define SignalBad ((SignalHandler)-1)
+#define SignalDefault ((SignalHandler)0)
+#define SignalIgnore ((SignalHandler)1)
+
+#define __sigmask(sig) (1 << ((sig) - 1))
+#define __SIGEMPTYSET (~SIGALL)
+#define __SIGFILLSET SIGALL
+#define __SIGADDSET(s,n) ((*s) |= (__sigmask(n)))
+#define __SIGDELSET(s,n) ((*s) &= ~(__sigmask(n)))
+#define __SIGISMEMBER(s,n) ((*s) & (__sigmask(n)))
+
+#if !defined(_SYS_TYPES_H)
+#include <sys/types.h>
+#endif
+
+
+#if __cplusplus
+extern "C" {
+#endif
+
+extern void (*signal(int, void(*)(int)))(int);
+extern int raise(int);
+
+extern void (*bsd_signal(int, void(*)(int)))(int);
+extern int ( *ssignal( int, int(*)(int) ) )(int);
+extern void ( *sigset( int, void(*)(int) ) )(int);
+extern int killpg(pid_t, int);
+#ifdef SS_ONSTACK /* Not defined on old versions of the OS */
+extern int sigaltstack(const stack_t *, stack_t *);
+extern int sigstack(struct sigstack *, struct sigstack *);
+#endif
+extern int sighold(int);
+extern int sigignore(int);
+extern int siginterrupt(int, int);
+extern int sigpause(int);
+extern int sigrelse(int);
+
+extern int (sigfillset)(sigset_t *);
+extern int (sigemptyset)(sigset_t *);
+extern int (sigaddset)(sigset_t *, int);
+extern int (sigdelset)(sigset_t *, int);
+extern int (sigismember)(const sigset_t *, int);
+extern int sigpending(sigset_t *);
+extern int sigsuspend(const sigset_t *);
+extern int sigprocmask(int, const sigset_t *, sigset_t *);
+extern int kill(pid_t, int);
+extern int sigaction(int, const struct sigaction *, struct sigaction *);
+
+#if __cplusplus
+};
+#endif
+
+
+#endif /* ___SIGNAL_H */
+
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/__stdio.h b/mit-pthreads/machdep/sco-3.2v5/__stdio.h
new file mode 100755
index 00000000000..f19672980ec
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/__stdio.h
@@ -0,0 +1,113 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/__stdio.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/__stdio.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/__stdio.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/__stdio.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/__stdio.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1984-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___STDIO_H
+#define ___STDIO_H
+
+#pragma comment(exestr, "xpg4plus @(#) stdio.h 20.1 94/12/04 ")
+
+#pragma pack(4)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#ifndef _FPOS_T
+#define _FPOS_T
+typedef long fpos_t;
+#endif
+
+#ifndef _WCHAR_T
+#define _WCHAR_T
+typedef long wchar_t;
+#endif
+
+#ifndef _WINT_T
+#define _WINT_T
+typedef long wint_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+#ifndef EOF
+#define EOF (-1)
+#endif
+
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+
+#ifndef TMP_MAX
+#define TMP_MAX 17576 /* 26 * 26 * 26 */
+#endif
+
+#define BUFSIZ 1024 /* default buffer size */
+
+
+#define _IOEOF 0020 /* EOF reached on read */
+#define _IOERR 0040 /* I/O error from system */
+
+#define _IOREAD 0001 /* currently reading */
+#define _IOWRT 0002 /* currently writing */
+#define _IORW 0200 /* opened for reading and writing */
+#define _IOMYBUF 0010 /* stdio malloc()'d buffer */
+
+#define _SBFSIZ 8
+
+#define L_cuserid 9
+
+/* Non name space polluting version of above */
+#define _P_tmpdir "/usr/tmp/"
+
+#ifndef _VA_LIST
+#define _VA_LIST char *
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack()
+
+#endif /* ___STDIO_H */
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/__stdlib.h b/mit-pthreads/machdep/sco-3.2v5/__stdlib.h
new file mode 100755
index 00000000000..db6a8a56151
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/__stdlib.h
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 1984-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___STDLIB_H
+#define ___STDLIB_H
+
+#pragma comment(exestr, "posix @(#) stdlib.h 20.1 94/12/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(4)
+
+#ifndef _DIV_T
+#define _DIV_T
+typedef struct
+{
+ int quot;
+ int rem;
+} div_t;
+#endif
+
+#ifndef _LDIV_T
+#define _LDIV_T
+typedef struct
+{
+ long quot;
+ long rem;
+} ldiv_t;
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#if !defined(_SSIZE_T)
+#define _SSIZE_T
+typedef int ssize_t;
+#endif
+
+#ifndef _WCHAR_T
+#define _WCHAR_T
+typedef long wchar_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+#define RAND_MAX 077777
+
+
+
+extern unsigned char __ctype[];
+
+#define MB_CUR_MAX ((int)__ctype[520])
+
+extern double atof(const char *);
+extern int atoi(const char *);
+extern long atol(const char *);
+extern double strtod(const char *, char **);
+extern float strtof(const char *, char **);
+extern long strtol(const char *, char **, int);
+extern unsigned long strtoul(const char *, char **, int);
+
+extern int rand(void);
+extern void srand(unsigned int);
+
+extern void *calloc(size_t, size_t);
+extern void free(void *);
+extern void *malloc(size_t);
+extern void *realloc(void *, size_t);
+
+extern void abort(void);
+extern void exit(int);
+extern char *getenv(const char *);
+extern int system(const char *);
+
+extern void *bsearch(const void *, const void *, size_t, size_t,
+ int (*)(const void *, const void *));
+extern void qsort(void *, size_t, size_t,
+ int (*)(const void *, const void *));
+
+#ifdef __cplusplus
+#ifndef _ABS_INL
+#define _ABS_INL
+inline int (abs)(int i) {return (i > 0) ? i : -i;}
+#endif
+#else
+extern int (abs)(int); /* Protect from macro definitions */
+#endif
+
+extern div_t div(int, int);
+extern long labs(long);
+extern ldiv_t ldiv(long, long);
+
+extern int mbtowc(wchar_t *, const char *, size_t);
+extern int mblen(const char *, size_t);
+extern int wctomb(char *, wchar_t);
+
+extern size_t mbstowcs(wchar_t *, const char *, size_t);
+extern size_t wcstombs(char *, const wchar_t *, size_t);
+
+
+
+
+#define mblen(s, n) mbtowc((wchar_t *)0, s, n)
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack()
+
+#endif /* ___STDLIB_H */
diff --git a/mit-pthreads/machdep/sco-3.2v5/__string.h b/mit-pthreads/machdep/sco-3.2v5/__string.h
new file mode 100755
index 00000000000..e4bb93afe5a
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/__string.h
@@ -0,0 +1,125 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/string.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/string.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/string.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/string.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/string.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___STRING_H
+#define ___STRING_H
+
+#pragma comment(exestr, "xpg4plus @(#) string.h 20.1 94/12/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+
+
+extern void *memchr(const void *, int, size_t);
+extern void *memcpy(void *, const void *, size_t);
+extern void *memccpy(void *, const void *, int, size_t);
+extern void *memmove(void *, const void *, size_t);
+extern void *memset(void *, int, size_t);
+
+extern char *strchr(const char *, int);
+extern char *strcpy(char *, const char *);
+extern char *strncpy(char *, const char *, size_t);
+extern char *strcat(char *, const char *);
+extern char *strncat(char *, const char *, size_t);
+extern char *strpbrk(const char *, const char *);
+extern char *strrchr(const char *, int);
+extern char *strstr(const char *, const char *);
+extern char *strtok(char *, const char *);
+extern char *strtok_r(char *, const char *, char **);
+extern char *strerror(int);
+extern char *strlist(char *, const char *, ...);
+
+extern int memcmp(const void *, const void *, size_t);
+extern int strcmp(const char *, const char *);
+extern int strcoll(const char *, const char *);
+extern int strncmp(const char *, const char *, size_t);
+
+extern void perror(const char *);
+extern char *strdup(const char *);
+extern int strncoll(const char *, const char *, int);
+extern size_t strnxfrm(char *, const char *, size_t , int);
+
+extern size_t strxfrm(char *, const char *, size_t);
+extern size_t strcspn(const char *, const char *);
+extern size_t strspn(const char *, const char *);
+extern size_t strlen(const char *);
+
+#ifdef __USLC__
+#pragma int_to_unsigned strcspn
+#pragma int_to_unsigned strspn
+#pragma int_to_unsigned strlen
+#endif
+
+#if !defined(__cplusplus) && defined(__USLC__)
+/* Use intrinsic ??? */
+#ifndef strlen
+#define strlen __std_hdr_strlen
+#endif
+#ifndef strcpy
+#define strcpy __std_hdr_strcpy
+#endif
+#ifndef strncpy
+#define strncpy __std_hdr_strncpy
+#endif
+#endif
+
+
+extern int ffs(int);
+/*
+ * The following two functions were withdrawn in XPG3,
+ * but are provided for backwards compatibility.
+ */
+extern int nl_strcmp(char *, char *);
+extern int nl_strncmp(char *, char *, int n);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ___STRING_H */
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/__time.h b/mit-pthreads/machdep/sco-3.2v5/__time.h
new file mode 100755
index 00000000000..4aeee737601
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/__time.h
@@ -0,0 +1,141 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/time.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/time.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/time.h>
+#elif _STRICT_ANSI /* Pure Ansi/ISO environment */
+#include <ansi/time.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/time.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___TIME_H
+#define ___TIME_H
+
+#pragma comment(exestr, "xpg4plus @(#) time.h 20.2 95/01/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif /* NULL */
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef long clock_t;
+#endif
+#ifndef _TIME_T
+#define _TIME_T
+typedef long time_t;
+#endif
+
+#ifdef _POSIXTIMERS
+#include <sys/sudstime.h>
+#endif
+
+#define CLOCKS_PER_SEC 1000000 /* As required by XPG4 and friends */
+
+#pragma pack(4)
+
+#ifndef _STRUCT_TM
+#define _STRUCT_TM
+struct tm
+{
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+#define LTZNMAX 50
+ long tm_tzadj;
+ char tm_name[LTZNMAX]; /* name of timezone */
+};
+
+#pragma pack()
+#endif /* _STRUCT_TM */
+
+
+extern clock_t clock(void);
+extern double difftime(time_t, time_t);
+extern time_t mktime(struct tm *);
+extern time_t time(time_t *);
+extern char *asctime(const struct tm *);
+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 *);
+
+
+extern void tzset(void);
+extern char *tzname[];
+
+#ifndef CLK_TCK
+#define CLK_TCK _sysconf(2) /* 2 is _SC_CLK_TCK */
+#endif
+
+extern long timezone;
+extern int daylight;
+extern char *strptime(const char *, const char *, struct tm *);
+
+
+
+
+#include <sys/timeb.h>
+extern int ftime ( struct timeb * );
+extern char * nl_cxtime( long *, char * );
+extern char * nl_ascxtime( struct tm *, char * );
+extern int cftime(char *, const char *, const time_t *);
+extern int ascftime(char *, const char *, const struct tm *);
+extern long altzone;
+extern struct tm *getdate(const char *);
+extern int getdate_err;
+extern char *asctime_r(const struct tm *, char *,int);
+extern char *ctime_r(const time_t *, char *,int);
+extern struct tm *localtime_r(const time_t *, struct tm *);
+extern struct tm *gmtime_r(const time_t *, struct tm *);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef difftime
+#define difftime(t1, t0) ((double)((t1) - (t0)))
+#endif
+
+#endif /* ___TIME_H */
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/__unistd.h b/mit-pthreads/machdep/sco-3.2v5/__unistd.h
new file mode 100755
index 00000000000..408886301f5
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/__unistd.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * __unistd.h,v 1.1 1995/01/03 12:54:54 proven Exp
+ */
+
+#ifndef ___UNISTD_H_
+#define ___UNISTD_H_
+
+#include <sys/types.h>
+#include <stddef.h>
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+#endif
+
diff --git a/mit-pthreads/machdep/sco-3.2v5/compat.h b/mit-pthreads/machdep/sco-3.2v5/compat.h
new file mode 100755
index 00000000000..3befbffa68d
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/compat.h
@@ -0,0 +1,46 @@
+/* ==== 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.
+ *
+ * compat.h,v 1.52 1995/10/20 09:32:56 proven Exp
+ *
+ * Description : Basic timers header.
+ *
+ * 1.00 94/06/13 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS_COMPAT_H_
+#define _SYS_COMPAT_H_
+
+#include <sys/types.h>
+
+#define omsghdr msghdr
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/dirent.h b/mit-pthreads/machdep/sco-3.2v5/dirent.h
new file mode 100755
index 00000000000..6f6804590bb
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/dirent.h
@@ -0,0 +1,145 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/dirent.h>
+#elif defined(_XOPEN_SOURCE) || defined(_XPG4_VERS) /* Xpg4 environment */
+#include <xpg4/dirent.h>
+#elif defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) /* Posix environment */
+#include <posix/dirent.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/dirent.h>
+#else /* Normal, default environment */
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef _DIRENT_H
+#define _DIRENT_H
+
+#pragma comment(exestr, "xpg4plus @(#) dirent.h 20.1 94/12/04 ")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(4)
+
+#define MAXNAMLEN 512 /* maximum filename length */
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+#undef DIRBLKSIZ
+#define DIRBLKSIZ 1048 /* buffer size for fs-indep. dirs */
+
+#ifndef _SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+#ifdef __STDC__
+#pragma comment(exestr, "@(#) dirent.h 25.8 94/09/22 ")
+#else
+#ident "@(#) dirent.h 25.8 94/09/22 "
+#endif
+/*
+ * Copyright (C) 1988-1994 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+/* Copyright (c) 1984, 1986, 1987, 1988 AT&T */
+/* 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. */
+
+/* #ident "@)#(head.sys:dirent.h 1.3" */
+
+/*
+ * The following structure defines the file
+ * system independent directory entry.
+ *
+ */
+
+#include <sys/types.h>
+
+#ifdef _M_I386
+#pragma pack(4)
+#else
+#pragma pack(2)
+#endif
+
+#ifdef _INKERNEL
+/*
+ * dirent used by the kernel
+ */
+struct dirent {
+ ino32_t d_ino; /* inode number of entry */
+ off_t d_off; /* offset of disk directory entry */
+ unsigned short d_reclen; /* length of this record */
+ char d_name[MAXNAMLEN+1]; /* name of file */
+};
+
+#else /* !_INKERNEL */
+/*
+ * dirent as used by application code
+ * For now leave the declaration as is. When the new development system
+ * is implemented, ino_t may be ushort or ulong. If ino_t is ulong, there
+ * will be no d_pad field.
+ */
+struct dirent /* data from readdir() */
+ {
+#if defined(_IBCS2)
+ long d_ino;
+#else /* !_IBCS2 */
+ ino_t d_ino; /* inode number of entry */
+#if defined(_INO_16_T)
+ short d_pad; /* because ino_t is ushort */
+#endif /* defined(_INO_16_T) */
+#endif /* defined(_IBCS2) */
+ off_t d_off; /* offset of disk directory entry */
+ unsigned short d_reclen; /* length of this record */
+ char d_name[MAXNAMLEN+1]; /* name of file */
+ };
+#endif /* _INKERNEL */
+
+typedef struct dirent dirent_t;
+
+#pragma pack()
+#endif /* _SYS_DIRENT_H */
+
+#define d_fileno d_ino
+#define d_namlen d_reclen
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack()
+
+#endif /* _DIRENT_H */
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/posix/__signal.h b/mit-pthreads/machdep/sco-3.2v5/posix/__signal.h
new file mode 100755
index 00000000000..5680fc1491a
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/posix/__signal.h
@@ -0,0 +1,69 @@
+/*
+ * Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+/* All Rights Reserved */
+
+/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */
+/* UNIX System Laboratories, Inc. */
+/* The copyright notice above does not evidence any */
+/* actual or intended publication of such source code. */
+
+#ifndef ___SIGNAL_H
+#define ___SIGNAL_H
+
+#pragma comment(exestr, "posix @(#) signal.h 20.3 94/12/19 ")
+
+#ifndef _SIG_ATOMIC_T
+#define _SIG_ATOMIC_T
+ /* atomic entity for signal handling */
+typedef int sig_atomic_t;
+#endif
+
+
+#ifndef _SYS_SIGNAL_H
+#include <sys/signal.h>
+#endif
+
+#if !defined(_SYS_TYPES_H)
+#include <sys/types.h>
+#endif
+
+
+#if __cplusplus
+extern "C" {
+#endif
+
+extern void (*signal(int, void(*)(int)))(int);
+extern int raise(int);
+
+
+
+extern int (sigfillset)(sigset_t *);
+extern int (sigemptyset)(sigset_t *);
+extern int (sigaddset)(sigset_t *, int);
+extern int (sigdelset)(sigset_t *, int);
+extern int (sigismember)(const sigset_t *, int);
+extern int sigpending(sigset_t *);
+extern int sigsuspend(const sigset_t *);
+extern int sigprocmask(int, const sigset_t *, sigset_t *);
+extern int kill(pid_t, int);
+extern int sigaction(int, const struct sigaction *, struct sigaction *);
+
+#if __cplusplus
+};
+#endif
+
+
+#endif /* ___SIGNAL_H */
+
diff --git a/mit-pthreads/machdep/sco-3.2v5/socket.h b/mit-pthreads/machdep/sco-3.2v5/socket.h
new file mode 100755
index 00000000000..4a53c7176f9
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/socket.h
@@ -0,0 +1,490 @@
+/* @(#)socket.h 6.23 7/18/94 - STREAMware TCP/IP source */
+/*
+ * Copyrighted as an unpublished work.
+ * (c) Copyright 1987-1994 Legent Corporation
+ * All rights reserved.
+ *
+ * RESTRICTED RIGHTS
+ *
+ * These programs are supplied under a license. They may be used,
+ * disclosed, and/or copied only as permitted under such license
+ * agreement. Any copy must contain the above copyright notice and
+ * this restricted rights notice. Use, copying, and/or disclosure
+ * of the programs is strictly prohibited unless otherwise provided
+ * in the license agreement.
+ *
+ */
+/* SCCS IDENTIFICATION */
+/*
+ * Copyright (c) 1985 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.
+ */
+
+#ifndef __sys_socket_h
+#define __sys_socket_h
+
+#if !defined(FD_SETSIZE)
+/* Pick up select stuff from standard system include */
+#include <sys/types.h>
+#endif
+
+/* socket.h 6.1 83/07/29 */
+
+/*
+ * Definitions related to sockets: types, address families, options.
+ */
+
+/*
+ * Types
+ */
+#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 */
+#define SO_ORDREL 0x0200 /* give use orderly release */
+#define SO_IMASOCKET 0x0400 /* use socket semantics (affects bind) */
+#define SO_MGMT 0x0800 /* => it is used for mgmt. purposes */
+#define SO_REUSEPORT 0x1000 /* allow local port reuse */
+
+/*
+ * 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_PROTOTYPE 0x1009 /* get/set protocol type */
+
+/*
+ * Structure used for manipulating linger option.
+ */
+struct linger {
+ int l_onoff; /* option on/off */
+ int l_linger; /* linger time */
+};
+
+/*
+ * Level number for (get/set)sockopt() to apply to socket itself.
+ */
+#define SOL_SOCKET 0xffff /* options for socket level */
+
+/*
+ * An option specification consists of an opthdr, followed by the value of
+ * the option. An options buffer contains one or more options. The len
+ * field of opthdr specifies the length of the option value in bytes. This
+ * length must be a multiple of sizeof(long) (use OPTLEN macro).
+ */
+
+struct opthdr {
+ long level; /* protocol level affected */
+ long name; /* option to modify */
+ long len; /* length of option value */
+};
+
+#define OPTLEN(x) ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
+#define OPTVAL(opt) ((char *)(opt + 1))
+
+#if defined(INKERNEL) || defined(_KERNEL) || defined(_INKERNEL)
+/*
+ * the optdefault structure is used for internal tables of option default
+ * values.
+ */
+struct optdefault {
+ int optname;/* the option */
+ char *val; /* ptr to default value */
+ int len; /* length of value */
+};
+
+/*
+ * the opproc structure is used to build tables of options processing
+ * functions for in_dooptions().
+ */
+struct opproc {
+ int level; /* options level this function handles */
+ int (*func) (); /* the function */
+};
+#endif
+
+/*
+ * 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_ISO 7 /* ISO protocols */
+#define AF_OSI AF_ISO
+#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_ROUTE 17 /* Internal Routing Protocol */
+#define AF_LINK 18 /* Link layer interface */
+#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */
+
+#define AF_MAX 20
+
+/*
+ * Structure used by kernel to store most addresses.
+ */
+struct sockaddr {
+ u_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_ROUTE AF_ROUTE
+#define PF_LINK AF_LINK
+#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */
+
+#define PF_MAX AF_MAX
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ * Used value-result for recmvsg, value only for sendmsg.
+ */
+struct msghdr {
+ caddr_t msg_name; /* optional address */
+ u_int msg_namelen; /* size of address */
+ struct iovec *msg_iov; /* scatter/gather array */
+ u_int msg_iovlen; /* # elements msg_iov */
+ caddr_t msg_control; /* ancillary data, see below */
+ u_int msg_controllen; /* ancillary data buffer len */
+ int msg_flags; /* flags on received message */
+};
+#define msg_accrights msg_control
+#define msg_accrightslen msg_controllen
+
+#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_EOR 0x8 /* data completes record */ /*notused*/
+#define MSG_TRUNC 0x10 /* data discarded before delivery */
+#define MSG_CTRUNC 0x20 /* control data lost before delivery */
+#define MSG_WAITALL 0x40 /* wait for full request or error */ /*notused*/
+
+#define MSG_MAXIOVLEN 16
+
+/*
+ * Header for ancillary data objects in msg_control buffer.
+ * Used for additional information with/about a datagram
+ * not expressible by flags. The format is a sequence
+ * of message elements headed by cmsghdr structures.
+ * In STREAMware, we shuffle the fields around a little from what
+ * they were in net-2, so that they line up the same as an opthdr
+ * which simplifies our socket implementation amazingly.
+ *
+ * Unfortunately, the opthdrs don't include their own length, which the
+ * cmsghdrs do. What this means is that TLI programmers will not be
+ * able to take something returned using these macros and immediately give
+ * it back to the stack. The size of the struct cmsghdr will have to be
+ * subtracted out.
+ * There doesn't seem to be a way to avoid this, since several applications
+ * look into the cmsg_len field and won't work if it doesn't include the size
+ * of the struct cmsghdr.
+ */
+struct cmsghdr {
+ int cmsg_level; /* originating protocol */
+ int cmsg_type; /* protocol-specific type */
+ u_int cmsg_len; /* data byte count, including hdr */
+/* followed by u_char cmsg_data[]; */
+};
+
+/* given pointer to struct adatahdr, return pointer to data */
+#define CMSG_DATA(cmsg) ((u_char *)((cmsg) + 1))
+
+/* given pointer to struct adatahdr, return pointer to next adatahdr */
+#define CMSG_NXTHDR(mhdr, cmsg) \
+ (((caddr_t)(cmsg) + (cmsg)->cmsg_len + sizeof(struct cmsghdr) > \
+ (mhdr)->msg_control + (mhdr)->msg_controllen) ? \
+ (struct cmsghdr *)NULL : \
+ (struct cmsghdr *)((caddr_t)(cmsg) + OPTLEN((cmsg)->cmsg_len)))
+
+#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
+
+/* "Socket"-level control message types: */
+#define SCM_RIGHTS 0x01 /* access rights (array of int) */
+
+/*
+ * This ioctl code uses BSD style ioctls to avoid copyin/out problems.
+ * Ioctls 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 128 bytes.
+ */
+#define IOCPARM_MASK 0x7f /* parameters must be < 128 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 ioctls from old */
+#define _IOS(x,y) (IOC_VOID|(x<<8)|y)
+#define _IOSR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+#define _IOSW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+/* this should be _IOSRW, but stdio got there first */
+#define _IOSWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+
+/*
+ * Socket ioctl commands
+ */
+
+#define SIOCSHIWAT _IOSW('S', 1, int) /* set high watermark */
+#define SIOCGHIWAT _IOSR('S', 2, int) /* get high watermark */
+#define SIOCSLOWAT _IOSW('S', 3, int) /* set low watermark */
+#define SIOCGLOWAT _IOSR('S', 4, int) /* get low watermark */
+#define SIOCATMARK _IOSR('S', 5, int) /* at oob mark? */
+#define SIOCSPGRP _IOSW('S', 6, int) /* set process group */
+#define SIOCGPGRP _IOSR('S', 7, int) /* get process group */
+#define FIONREAD _IOSR('S', 8, int) /* BSD compatibilty */
+#define FIONBIO _IOSW('S', 9, int) /* BSD compatibilty */
+#define FIOASYNC _IOSW('S', 10, int) /* BSD compatibilty */
+#define SIOCPROTO _IOSW('S', 11, struct socknewproto) /* link proto */
+#define SIOCGETNAME _IOSR('S', 12, struct sockaddr) /* getsockname */
+#define SIOCGETPEER _IOSR('S', 13, struct sockaddr) /* getpeername */
+#define IF_UNITSEL _IOSW('S', 14, int) /* set unit number */
+#define SIOCXPROTO _IOS('S', 15) /* empty proto table */
+#define SIOCSHRDTYPE _IOSW('S', 16, int) /* set hardware type */
+
+#define SIOCADDRT _IOSW('R', 9, struct ortentry) /* add route */
+#define SIOCDELRT _IOSW('R', 10, struct ortentry) /* delete route */
+
+#define SIOCSIFADDR _IOSW('I', 11, struct ifreq) /* set ifnet address */
+#define SIOCGIFADDR _IOSWR('I', 12, struct ifreq) /* get ifnet address */
+#define SIOCSIFDSTADDR _IOSW('I', 13, struct ifreq) /* set p-p address */
+#define SIOCGIFDSTADDR _IOSWR('I', 14, struct ifreq) /* get p-p address */
+#define SIOCSIFFLAGS _IOSW('I', 15, struct ifreq) /* set ifnet flags */
+#define SIOCGIFFLAGS _IOSWR('I', 16, struct ifreq) /* get ifnet flags */
+#define SIOCGIFCONF _IOSWR('I', 17, struct ifconf) /* get ifnet list */
+
+#define SIOCSIFMTU _IOSW('I', 21, struct ifreq) /* get if_mtu */
+#define SIOCGIFMTU _IOSWR('I', 22, struct ifreq) /* set if_mtu */
+
+
+#define SIOCGIFBRDADDR _IOSWR('I', 32, struct ifreq) /* get broadcast addr */
+#define SIOCSIFBRDADDR _IOSW('I', 33, struct ifreq) /* set broadcast addr */
+#define SIOCGIFNETMASK _IOSWR('I', 34, struct ifreq) /* get net addr mask */
+#define SIOCSIFNETMASK _IOSW('I', 35, struct ifreq) /* set net addr mask */
+#define SIOCGIFMETRIC _IOSWR('I', 36, struct ifreq) /* get IF metric */
+#define SIOCSIFMETRIC _IOSW('I', 37, struct ifreq) /* set IF metric */
+
+#define SIOCSARP _IOSW('I', 38, struct arpreq) /* set arp entry */
+#define SIOCGARP _IOSWR('I', 39, struct arpreq) /* get arp entry */
+#define SIOCDARP _IOSW('I', 40, struct arpreq) /* delete arp entry */
+
+#define SIOCSIFNAME _IOSW('I', 41, struct ifreq) /* set interface name */
+#define SIOCGIFONEP _IOSWR('I', 42, struct ifreq) /* get one-packet params */
+#define SIOCSIFONEP _IOSW('I', 43, struct ifreq) /* set one-packet params */
+#define SIOCDIFADDR _IOSW('I', 44, struct ifreq) /* delete IF addr */
+#define SIOCAIFADDR _IOSW('I', 45, struct ifaliasreq) /*add/change IF alias*/
+#define SIOCADDMULTI _IOSW('I', 49, struct ifreq) /* add m'cast addr */
+#define SIOCDELMULTI _IOSW('I', 50, struct ifreq) /* del m'cast addr */
+#define SIOCGIFALIAS _IOSWR('I', 51, struct ifaliasreq) /* get IF alias */
+
+
+#define SIOCSOCKSYS _IOSW('I', 66, struct socksysreq) /* Pseudo socket syscall */
+
+/* these use ifr_metric to pass the information */
+#define SIOCSIFDEBUG _IOSW('I', 67, struct ifreq) /* set if debug level */
+#define SIOCGIFDEBUG _IOSWR('I', 68, struct ifreq) /* get if debug level */
+
+#define SIOCSIFTYPE _IOSW('I', 69, struct ifreq) /* set if MIB type */
+#define SIOCGIFTYPE _IOSWR('I', 70, struct ifreq) /* get if MIB type */
+
+#define SIOCGIFNUM _IOSR('I', 71, int) /* get number of ifs */
+/*
+ * This returns the number of ifreqs that SIOCGIFCONF would return, including
+ * aliases. This is the preferred way of sizing a buffer big enough to hold
+ * all interfaces.
+ */
+#define SIOCGIFANUM _IOSR('I', 72, int) /* get number of ifreqs */
+/*
+ * Interface specific performance tuning
+ */
+#define SIOCGIFPERF _IOSR('I', 73, struct ifreq) /* get perf info */
+#define SIOCSIFPERF _IOSR('I', 74, struct ifreq) /* get perf info */
+
+/*
+ * This structure is used to encode pseudo system calls
+ */
+struct socksysreq {
+ /* When porting, make this the widest thing it can be */
+ int args[7];
+};
+
+/*
+ * This structure is used for adding new protocols to the list supported by
+ * sockets.
+ */
+struct socknewproto {
+ int family; /* address family (AF_INET, etc.) */
+ int type; /* protocol type (SOCK_STREAM, etc.) */
+ int proto; /* per family proto number */
+ dev_t dev; /* major/minor to use (must be a clone) */
+ int flags; /* protosw flags */
+};
+
+/*
+ * utility definitions.
+ */
+
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(x,y) ((x) < (y) ? (x) : (y))
+#ifndef MAX
+#define MAX(x,y) ((x) > (y) ? (x) : (y))
+#endif
+
+#define MAXHOSTNAMELEN 256
+
+#define NBBY 8 /* number of bits in a byte */
+
+
+/* defines for user/kernel interface */
+
+#define MAX_MINOR (makedev(1,0) - 1) /* could be non-portable */
+
+#define SOCKETSYS 140 /* SCO 3.2v5 */
+
+#define SO_ACCEPT 1
+#define SO_BIND 2
+#define SO_CONNECT 3
+#define SO_GETPEERNAME 4
+#define SO_GETSOCKNAME 5
+#define SO_GETSOCKOPT 6
+#define SO_LISTEN 7
+#define SO_RECV 8
+#define SO_RECVFROM 9
+#define SO_SEND 10
+#define SO_SENDTO 11
+#define SO_SETSOCKOPT 12
+#define SO_SHUTDOWN 13
+#define SO_SOCKET 14
+#define SO_SELECT 15
+#define SO_GETIPDOMAIN 16
+#define SO_SETIPDOMAIN 17
+#define SO_ADJTIME 18
+#define SO_SETREUID 19
+#define SO_SETREGID 20
+#define SO_GETTIME 21
+#define SO_SETTIME 22
+#define SO_GETITIMER 23
+#define SO_SETITIMER 24
+#define SO_RECVMSG 25
+#define SO_SENDMSG 26
+#define SO_SOCKPAIR 27
+
+/*
+ * message flags
+ */
+#define M_BCAST 0x80000000
+
+/* Definitions and structures used for extracting */
+/* the size and/or the contents of kernel tables */
+
+/* Copyin/out values */
+#define GIARG 0x1
+#define CONTI 0x2
+#define GITAB 0x4
+
+struct gi_arg {
+ caddr_t gi_where;
+ unsigned gi_size;
+};
+
+#if !defined(_KERNEL) && !defined(INKERNEL) && !defined(_INKERNEL)
+
+#include <sys/cdefs.h>
+
+__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 getpeername __P_((int, struct sockaddr *, int *));
+int getsockname __P_((int, struct sockaddr *, int *));
+int getsockopt __P_((int, int, int, void *, int *));
+int setsockopt __P_((int, int, int, const void *, int));
+int listen __P_((int, int));
+ssize_t recv __P_((int, void *, size_t, int));
+ssize_t recvfrom __P_((int, void *, size_t, int, struct sockaddr *, int *));
+int recvmsg __P_((int, struct msghdr *, int));
+ssize_t send __P_((int, const void *, size_t, int));
+int sendmsg __P_((int, const struct msghdr *, int));
+ssize_t sendto __P_((int, const void *, size_t, int, const struct sockaddr *, int));
+int shutdown __P_((int, int));
+int socket __P_((int, int, int));
+int socketpair __P_((int, int, int, int[2]));
+__END_DECLS
+
+#endif /* !INKERNEL */
+#endif /* __sys_socket_h */
diff --git a/mit-pthreads/machdep/sco-3.2v5/syscall.h b/mit-pthreads/machdep/sco-3.2v5/syscall.h
new file mode 100755
index 00000000000..f49fba81b6e
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/syscall.h
@@ -0,0 +1,175 @@
+/* Copyright 1994-1995 The Santa Cruz Operation, Inc. All Rights Reserved. */
+
+
+#if defined(_NO_PROTOTYPE) /* Old, crufty environment */
+#include <oldstyle/syscall.h>
+#elif defined(_SCO_ODS_30) /* Old, Tbird compatible environment */
+#include <ods_30_compat/syscall.h>
+#else /* Normal, default environment */
+/*
+/ Portions Copyright (C) 1983-1995 The Santa Cruz Operation, Inc.
+ * All Rights Reserved.
+ *
+ * The information in this file is provided for the exclusive use of
+ * the licensees of The Santa Cruz Operation, Inc. Such users have the
+ * right to use, modify, and incorporate this code into other products
+ * for purposes authorized by the license agreement provided they include
+ * this notice and the associated copyright notice with any such product.
+ * The information in this file is provided "AS IS" without warranty.
+ */
+
+/* Portions Copyright (c) 1990, 1991, 1992, 1993 UNIX System Laboratories, Inc. */
+/* Portions Copyright (c) 1979 - 1990 AT&T */
+
+#ident "xpg4plus @(#) sys.i386 20.1 94/12/04 "
+/* #ident "xpg4plus @(#)head:sys.i386 1.2" */
+
+/*
+/* Definitions of Kernel Entry Call Gates
+*/
+
+#ifndef _SYSCALL_H_
+#define _SYSCALL_H_
+
+/*#define SYSCALL $0x7,$0*/
+/*#define SIGCALL $0xF,$0*/
+
+/*
+/* Definitions of System Call Entry Point Numbers
+*/
+
+#define SYS_access 33
+#define SYS_acct 51
+#define SYS_advfs 70
+#define SYS_alarm 27
+#define SYS_break 17
+#define SYS_brk 17
+#define SYS_chdir 12
+#define SYS_chmod 15
+#define SYS_chown 16
+#define SYS_chroot 61
+#define SYS_close 6
+#define SYS_creat 8
+#define SYS_dup 41
+#define SYS_exec 11
+#define SYS_execve 59
+#define SYS_exit 1
+#define SYS_fcntl 62
+#define SYS_fork 2
+#define SYS_fstat 28
+#define SYS_fstatfs 38
+#define SYS_fxstat 125
+#define SYS_getdents 81
+#define SYS_getgid 47
+#define SYS_getmsg 85
+#define SYS_getpid 20
+#define SYS_gettimeofday 171
+#define SYS_getuid 24
+#define SYS_gtty 32
+#define SYS_ioctl 54
+#define SYS_kill 37
+#define SYS_link 9
+#define SYS_lock 45
+#define SYS_lseek 19
+#define SYS_lstat 91
+#define SYS_lxstat 124
+#define SYS_mkdir 80
+#define SYS_mknod 14
+#define SYS_mount 21
+#define SYS_msgsys 49
+#define SYS_nice 34
+#define SYS_open 5
+#define SYS_pause 29
+#define SYS_pipe 42
+#define SYS_plock 45
+#define SYS_poll 87
+#define SYS_prof 44
+#define SYS_ptrace 26
+#define SYS_putmsg 86
+#define SYS_rdebug 76
+#define SYS_read 3
+#define SYS_readlink 92
+#define SYS_readv 121
+#define SYS_rfstart 74
+#define SYS_rfstop 77
+#define SYS_rfsys 78
+#define SYS_rmdir 79
+#define SYS_rmount 72
+#define SYS_rumount 73
+#define SYS_seek 19
+#define SYS_semsys 53
+#define SYS_setgid 46
+#define SYS_setpgrp 39
+#define SYS_settimeofday 172
+#define SYS_setuid 23
+#define SYS_shmsys 52
+#define SYS_signal 48
+#define SYS_stat 18
+#define SYS_statfs 35
+#define SYS_stime 25
+#define SYS_stty 31
+#define SYS_symlink 90
+#define SYS_sync 36
+#define SYS_sys3b 50
+#define SYS_sysi86 50
+#define SYS_sysacct 51
+#define SYS_sysfs 84
+#define SYS_time 13
+#define SYS_times 43
+#define SYS_uadmin 55
+#define SYS_ulimit 63
+#define SYS_umask 60
+#define SYS_umount 22
+#define SYS_unadvfs 71
+#define SYS_unlink 10
+#define SYS_utime 30
+#define SYS_utssys 57
+#define SYS_wait 7
+#define SYS_write 4
+#define SYS_writev 122
+#define SYS_xstat 123
+#define SYS_ftruncate 192
+
+/* cxenix numbers are created by the formula
+ * (table index << 8) + CXENIX
+ */
+
+#define CXENIX 0x28 /* Decimal 40 */
+
+#define XLOCKING 0x0128
+#define CREATSEM 0x0228
+#define OPENSEM 0x0328
+#define SIGSEM 0x0428
+#define WAITSEM 0x0528
+#define NBWAITSEM 0x0628
+#define RDCHK 0x0728
+#define CHSIZE 0x0a28
+#define SYS_ftime 0x0b28
+#define NAP 0x0c28
+#define SDGET 0x0d28
+#define SDFREE 0x0e28
+#define SDENTER 0x0f28
+#define SDLEAVE 0x1028
+#define SDGETV 0x1128
+#define SDWAITV 0x1228
+#define PROCTL 0x2028
+#define EXECSEG 0x2128
+#define UNEXECSEG 0x2228
+#define SYS_select 0x2428
+#define SYS_eaccess 0x2528
+#define SYS_paccess 0x2628
+#define SYS_sigaction 0x2728
+#define SYS_sigprocmask 0x2828
+#define SYS_sigpending 0x2928
+#define SYS_sigsuspend 0x2a28
+#define SYS_getgroups 0x2b28
+#define SYS_setgroups 0x2c28
+#define SYS_sysconf 0x2d28
+#define SYS_pathconf 0x2e28
+#define SYS_fpathconf 0x2f28
+#define SYS_rename 0x3028
+#define SYS_setitimer 0x3828
+
+#define CLOCAL 127
+#endif
+#endif
diff --git a/mit-pthreads/machdep/sco-3.2v5/timers.h b/mit-pthreads/machdep/sco-3.2v5/timers.h
new file mode 100755
index 00000000000..cbc48ccc8d8
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/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.
+ *
+ * timers.h,v 1.50.8.1 1996/03/05 08:28:36 proven Exp
+ *
+ * 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 {
+ long 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/sco-3.2v5/trash.can b/mit-pthreads/machdep/sco-3.2v5/trash.can
new file mode 100755
index 00000000000..33edf65aab6
--- /dev/null
+++ b/mit-pthreads/machdep/sco-3.2v5/trash.can
@@ -0,0 +1 @@
+make: *** No targets specified and no makefile found. Stop.
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__math.h b/mit-pthreads/machdep/sunos-4.1.3/__math.h
new file mode 100755
index 00000000000..9de1dc6d4bd
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__math.h
@@ -0,0 +1,5 @@
+/*
+ * Posix (actually ansi C) section
+ */
+#define HUGE_VAL (__infinity()) /* Produces IEEE Infinity. */
+
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__path.h b/mit-pthreads/machdep/sunos-4.1.3/__path.h
new file mode 100755
index 00000000000..2665b5a0e8a
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__path.h
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef _SYS__PATH_H_
+#define _SYS__PATH_H_
+
+#define _PATH_PTY "/dev/"
+#define _PATH_TZDIR "/usr/share/zoneinfo"
+#define _PATH_TZFILE "localtime"
+
+#endif /* !_SYS__PATH_H_ */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__signal.h b/mit-pthreads/machdep/sunos-4.1.3/__signal.h
new file mode 100755
index 00000000000..f8b4fb8b6de
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__signal.h
@@ -0,0 +1,11 @@
+
+#include <sys/signal.h>
+#include <sys/stdtypes.h>
+
+typedef int sig_atomic_t;
+
+#define __SIGFILLSET 0xffffffff
+#define __SIGEMPTYSET 0
+#define __SIGADDSET(s,n) ((*s) |= (1 << ((n) - 1)))
+#define __SIGDELSET(s,n) ((*s) &= ~(1 << ((n) - 1)))
+#define __SIGISMEMBER(s,n) ((*s) & (1 << ((n) - 1)))
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__stdio.h b/mit-pthreads/machdep/sunos-4.1.3/__stdio.h
new file mode 100755
index 00000000000..6ca5e57396d
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__stdio.h
@@ -0,0 +1,4 @@
+
+typedef pthread_fpos_t fpos_t;
+
+#include <sys/stdtypes.h>
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__stdlib.h b/mit-pthreads/machdep/sunos-4.1.3/__stdlib.h
new file mode 100755
index 00000000000..7bb9093c51c
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__stdlib.h
@@ -0,0 +1,28 @@
+/* $Id$ */
+
+#ifndef __sys_stdtypes_h
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <sys/stdtypes.h> /* to get size_t */
+
+#if (! defined _SIZE_T_ ) && (! defined(_GCC_SIZE_T))
+#define _SIZE_T_
+#define _GCC_SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+#if (! defined _WCHAR_T_ ) && (! defined(_GCC_WCHAR_T))
+#define _WCHAR_T_
+#define _GCC_WCHAR_T
+typedef unsigned int wchar_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__string.h b/mit-pthreads/machdep/sunos-4.1.3/__string.h
new file mode 100755
index 00000000000..0859a80cf24
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__string.h
@@ -0,0 +1,14 @@
+
+#include <sys/stdtypes.h>
+
+/* 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/sunos-4.1.3/__time.h b/mit-pthreads/machdep/sunos-4.1.3/__time.h
new file mode 100755
index 00000000000..1ffa0e47d3f
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__time.h
@@ -0,0 +1,2 @@
+
+#include <sys/stdtypes.h>
diff --git a/mit-pthreads/machdep/sunos-4.1.3/__unistd.h b/mit-pthreads/machdep/sunos-4.1.3/__unistd.h
new file mode 100755
index 00000000000..3b86527252c
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/__unistd.h
@@ -0,0 +1,73 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#define _SC_ARG_MAX 1 /* space for argv & envp */
+#define _SC_CHILD_MAX 2 /* maximum children per process??? */
+#define _SC_CLK_TCK 3 /* clock ticks/sec */
+#define _SC_NGROUPS_MAX 4 /* number of groups if multple supp. */
+#define _SC_OPEN_MAX 5 /* max open files per process */
+#define _SC_JOB_CONTROL 6 /* do we have job control */
+#define _SC_SAVED_IDS 7 /* do we have saved uid/gids */
+#define _SC_VERSION 8 /* POSIX version supported */
+
+#define _POSIX_JOB_CONTROL 1
+#define _POSIX_SAVED_IDS 1
+#define _POSIX_VERSION 198808
+
+#define _PC_LINK_MAX 1 /* max links to file/dir */
+#define _PC_MAX_CANON 2 /* max line length */
+#define _PC_MAX_INPUT 3 /* max "packet" to a tty device */
+#define _PC_NAME_MAX 4 /* max pathname component length */
+#define _PC_PATH_MAX 5 /* max pathname length */
+#define _PC_PIPE_BUF 6 /* size of a pipe */
+#define _PC_CHOWN_RESTRICTED 7 /* can we give away files */
+#define _PC_NO_TRUNC 8 /* trunc or error on >NAME_MAX */
+#define _PC_VDISABLE 9 /* best char to shut off tty c_cc */
+#define _PC_LAST 9 /* highest value of any _PC_* */
+
+#ifndef NULL
+#define NULL 0 /* null pointer constant */
+#endif
+
+typedef int ssize_t;
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/cdefs.h b/mit-pthreads/machdep/sunos-4.1.3/cdefs.h
new file mode 100755
index 00000000000..a059fa3d3fc
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/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 __BEGIN_DECLS
+#define __END_DECLS
+#define __INLINE static
+#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/sunos-4.1.3/compat.h b/mit-pthreads/machdep/sunos-4.1.3/compat.h
new file mode 100755
index 00000000000..b2a846d00ee
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/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 : Basic timers header.
+ *
+ * 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/sunos-4.1.3/dirent.h b/mit-pthreads/machdep/sunos-4.1.3/dirent.h
new file mode 100755
index 00000000000..c2048b1741c
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 {
+ off_t d_off; /* offset of next disk dir entry */
+ 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/sunos-4.1.3/fcntlcom.h b/mit-pthreads/machdep/sunos-4.1.3/fcntlcom.h
new file mode 100755
index 00000000000..2b7acce7696
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/fcntlcom.h
@@ -0,0 +1,163 @@
+/* @(#)fcntlcom.h 1.13 91/06/18 SMI; from UCB fcntl.h 5.2 1/8/86 */
+
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef __sys_fcntlcom_h
+#define __sys_fcntlcom_h
+
+#include <sys/cdefs.h>
+
+/*
+ * Rewack the FXXXXX values as _FXXXX so that _POSIX_SOURCE works.
+ */
+#define _FOPEN (-1) /* from sys/file.h, kernel use only */
+#define _FREAD 0x0001 /* read enabled */
+#define _FWRITE 0x0002 /* write enabled */
+#define _FNDELAY 0x0004 /* non blocking I/O (4.2 style) */
+#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */
+#define _FSETBLK 0x0010 /* use block offsets */
+#define _FASYNC 0x0040 /* signal pgrp when data ready */
+#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */
+#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */
+#define _FCREAT 0x0200 /* open with file create */
+#define _FTRUNC 0x0400 /* open with truncation */
+#define _FEXCL 0x0800 /* error on open if file exists */
+#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */
+#define _FSYNC 0x2000 /* do all writes synchronously */
+#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */
+#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */
+#define _FMARK 0x10000 /* internal; mark during gc() */
+#define _FDEFER 0x20000 /* internal; defer for next gc pass */
+
+#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
+
+/*
+ * Flag values for open(2) and fcntl(2)
+ * The kernel adds 1 to the open modes to turn it into some
+ * combination of FREAD and FWRITE.
+ */
+#define O_RDONLY 0 /* +1 == FREAD */
+#define O_WRONLY 1 /* +1 == FWRITE */
+#define O_RDWR 2 /* +1 == FREAD|FWRITE */
+#define O_APPEND _FAPPEND
+#define O_CREAT _FCREAT
+#define O_TRUNC _FTRUNC
+#define O_EXCL _FEXCL
+/* O_SYNC _FSYNC not posix, defined below */
+/* O_NDELAY _FNDELAY set in include/fcntl.h */
+/* O_NDELAY _FNBIO set in 5include/fcntl.h */
+#define O_NONBLOCK _FNONBLOCK
+#define O_NOCTTY _FNOCTTY
+
+#ifndef _POSIX_SOURCE
+
+#define O_SYNC _FSYNC
+
+/*
+ * Flags that work for fcntl(fd, F_SETFL, FXXXX)
+ */
+#define FAPPEND _FAPPEND
+#define FSYNC _FSYNC
+#define FASYNC _FASYNC
+#define FNBIO _FNBIO
+#define FNONBIO _FNONBLOCK /* XXX fix to be NONBLOCK everywhere */
+#define FNDELAY _FNDELAY
+
+/*
+ * Flags that are disallowed for fcntl's (FCNTLCANT);
+ * used for opens, internal state, or locking.
+ */
+#define FREAD _FREAD
+#define FWRITE _FWRITE
+#define FMARK _FMARK
+#define FDEFER _FDEFER
+#define FSETBLK _FSETBLK
+#define FSHLOCK _FSHLOCK
+#define FEXLOCK _FEXLOCK
+
+/*
+ * The rest of the flags, used only for opens
+ */
+#define FOPEN _FOPEN
+#define FCREAT _FCREAT
+#define FTRUNC _FTRUNC
+#define FEXCL _FEXCL
+#define FNOCTTY _FNOCTTY
+
+#endif !_POSIX_SOURCE
+
+/* XXX close on exec request; must match UF_EXCLOSE in user.h */
+#define FD_CLOEXEC 1 /* posix */
+
+/* fcntl(2) requests */
+#define F_DUPFD 0 /* Duplicate fildes */
+#define F_GETFD 1 /* Get fildes flags (close on exec) */
+#define F_SETFD 2 /* Set fildes flags (close on exec) */
+#define F_GETFL 3 /* Get file flags */
+#define F_SETFL 4 /* Set file flags */
+#ifndef _POSIX_SOURCE
+#define F_GETOWN 5 /* Get owner - for ASYNC */
+#define F_SETOWN 6 /* Set owner - for ASYNC */
+#endif /* !_POSIX_SOURCE */
+#define F_GETLK 7 /* Get record-locking information */
+#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */
+#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */
+#ifndef _POSIX_SOURCE
+#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */
+#define F_RSETLK 11 /* Set or unlock a remote lock */
+#define F_CNVT 12 /* Convert a fhandle to an open fd */
+#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */
+#endif /* !_POSIX_SOURCE */
+
+/* fcntl(2) flags (l_type field of flock structure) */
+#define F_RDLCK 1 /* read lock */
+#define F_WRLCK 2 /* write lock */
+#define F_UNLCK 3 /* remove lock(s) */
+#ifndef _POSIX_SOURCE
+#define F_UNLKSYS 4 /* remove remote locks for a given system */
+#endif /* !_POSIX_SOURCE */
+
+#include <sys/stdtypes.h>
+
+/* file segment locking set data type - information passed to system by user */
+struct flock {
+ short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
+ short l_whence; /* flag to choose starting offset */
+ long l_start; /* relative offset, in bytes */
+ long l_len; /* length, in bytes; 0 means lock to EOF */
+ short l_pid; /* returned with F_GETLK */
+ short l_xxx; /* reserved for future use */
+};
+
+#ifndef _POSIX_SOURCE
+/* extended file segment locking set data type */
+struct eflock {
+ short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
+ short l_whence; /* flag to choose starting offset */
+ long l_start; /* relative offset, in bytes */
+ long l_len; /* length, in bytes; 0 means lock to EOF */
+ short l_pid; /* returned with F_GETLK */
+ short l_xxx; /* reserved for future use */
+ long l_rpid; /* Remote process id wanting this lock */
+ long l_rsys; /* Remote system id wanting this lock */
+};
+#endif /* !_POSIX_SOURCE */
+
+#ifndef KERNEL
+#include <sys/stat.h> /* sigh. for the mode bits for open/creat */
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+int open __P_((const char *path, int flags, ...));
+int creat __P_((const char *path, mode_t modes));
+int fcntl __P_((int fd, int cmd, ...));
+
+__END_DECLS
+
+#endif /* !KERNEL */
+#endif /* !__sys_fcntlcom_h */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/signal.h b/mit-pthreads/machdep/sunos-4.1.3/signal.h
new file mode 100755
index 00000000000..02a19860922
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/signal.h
@@ -0,0 +1,98 @@
+#ifndef __sys_signal_h
+#define __sys_signal_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) */
+#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&LTOSTOP) */
+#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 */
+
+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! */
+
+/*
+ * 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
+
+/*
+ * Macro for converting signal number to a mask suitable for sigblock().
+ */
+#define sigmask(m) (1 << ((m)-1))
+
+/*
+ * 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 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;
+};
+
+#endif /* !__sys_signal_h */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/stat.h b/mit-pthreads/machdep/sunos-4.1.3/stat.h
new file mode 100755
index 00000000000..35e7f760204
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/stat.h
@@ -0,0 +1,94 @@
+/* @(#)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/cdefs.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
+
+__BEGIN_DECLS
+int chmod __P_((const char *path, mode_t mode));
+int fstat __P_((int fd, struct stat *sbuf));
+int mkdir __P_((char *path, mode_t mode));
+int mkfifo __P_((char *path, mode_t mode));
+int stat __P_((const char *path, struct stat *sbuf));
+mode_t umask __P_((mode_t mask));
+__END_DECLS
+
+#endif /* !__sys_stat_h */
diff --git a/mit-pthreads/machdep/sunos-4.1.3/time.h b/mit-pthreads/machdep/sunos-4.1.3/time.h
new file mode 100755
index 00000000000..20bb085e4d8
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/time.h
@@ -0,0 +1,69 @@
+/* @(#)time.h 2.12 91/05/22 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_TIME_H_
+#define _SYS_TIME_H_
+
+#include <sys/cdefs.h>
+/*
+ * Structure returned by gettimeofday(2) system call,
+ * and used in other calls.
+ */
+
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+
+struct timezone {
+ int tz_minuteswest; /* minutes west of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+};
+
+#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 */
+#define DST_CAN 6 /* Canada */
+#define DST_GB 7 /* Great Britain and Eire */
+#define DST_RUM 8 /* Rumania */
+#define DST_TUR 9 /* Turkey */
+#define DST_AUSTALT 10 /* Australian style with shift in 1986 */
+
+/*
+ * 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, and structure
+ * defining a timer setting.
+ */
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+};
+
+__BEGIN_DECLS
+int gettimeofday __P_((struct timeval *, struct timezone *));
+__END_DECLS
+
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-4.1.3/timers.h b/mit-pthreads/machdep/sunos-4.1.3/timers.h
new file mode 100755
index 00000000000..3c4d057976a
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/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/sunos-4.1.3/wait.h b/mit-pthreads/machdep/sunos-4.1.3/wait.h
new file mode 100755
index 00000000000..97f5fb261f7
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-4.1.3/wait.h
@@ -0,0 +1,22 @@
+#ifndef _SYS_WAIT_H_
+#define _SYS_WAIT_H_
+
+#define WNOHANG 1 /* dont hang in wait */
+#define WUNTRACED 2 /* tell about stopped, untraced children */
+
+pid_t wait __P_((int *));
+pid_t waitpid __P_((pid_t, int *, int));
+
+#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)
+
+#endif /* _SYS_WAIT_H_ */
diff --git a/mit-pthreads/machdep/sunos-5.3/__math.h b/mit-pthreads/machdep/sunos-5.3/__math.h
new file mode 100755
index 00000000000..5404b52c661
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/__math.h
@@ -0,0 +1,16 @@
+/*
+ * ANSI/POSIX
+ */
+typedef union _h_val {
+ unsigned long _i[2];
+ double _d;
+} _h_val;
+
+#ifdef __STDC__
+extern const _h_val __huge_val;
+#else
+extern _h_val __huge_val;
+#endif
+
+#define HUGE_VAL __huge_val._d
+
diff --git a/mit-pthreads/machdep/sunos-5.3/__signal.h b/mit-pthreads/machdep/sunos-5.3/__signal.h
new file mode 100755
index 00000000000..638c1ca7331
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/__signal.h
@@ -0,0 +1,19 @@
+#include <sys/feature_tests.h>
+#include <sys/signal.h>
+
+/*
+typedef struct {
+ unsigned long __sigbits[4];
+} sigset_t;
+*/
+
+typedef int sig_atomic_t;
+
+#define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1)))
+#define sigword(n) (((unsigned int)((n) - 1))>>5)
+
+#define __SIGEMPTYSET { 0, 0, 0, 0 };
+#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff };
+#define __SIGADDSET(s, n) ((s)->__sigbits[sigword(n)] |= sigmask(n))
+#define __SIGDELSET(s, n) ((s)->__sigbits[sigword(n)] &= ~sigmask(n))
+#define __SIGISMEMBER(s, n) (sigmask(n) & (s)->__sigbits[sigword(n)])
diff --git a/mit-pthreads/machdep/sunos-5.3/__stdio.h b/mit-pthreads/machdep/sunos-5.3/__stdio.h
new file mode 100755
index 00000000000..4dd4becdbe9
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/__stdio.h
@@ -0,0 +1,6 @@
+typedef pthread_fpos_t fpos_t;
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__stdlib.h b/mit-pthreads/machdep/sunos-5.3/__stdlib.h
new file mode 100755
index 00000000000..a0717ce3c2b
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/__stdlib.h
@@ -0,0 +1,27 @@
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <sys/feature_tests.h>
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#ifndef _UID_T
+#define _UID_T
+typedef long uid_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef _WCHAR_T
+#define _WCHAR_T
+typedef long wchar_t;
+#endif
+
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__string.h b/mit-pthreads/machdep/sunos-5.3/__string.h
new file mode 100755
index 00000000000..9cb12a07bb7
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/__string.h
@@ -0,0 +1,12 @@
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+/* Non-standard NetBSD string routines. */
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+__BEGIN_DECLS
+char *strdup __P_((const char *));
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__time.h b/mit-pthreads/machdep/sunos-5.3/__time.h
new file mode 100755
index 00000000000..231e997acfa
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/__time.h
@@ -0,0 +1,69 @@
+/* ==== 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 : System specific time header.
+ *
+ * 1.00 94/11/07 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS___TIME_H_
+#define _SYS___TIME_H_
+
+#include <sys/feature_tests.h>
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned size_t;
+#endif
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef long clock_t;
+#endif
+#ifndef _TIME_T
+#define _TIME_T
+typedef long time_t;
+#endif
+#ifndef _CLOCKID_T
+#define _CLOCKID_T
+typedef int clockid_t;
+#endif
+#ifndef _TIMER_T
+#define _TIMER_T
+typedef int timer_t;
+#endif
+
+#include <sys/time.h>
+#include <sys/siginfo.h>
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/__unistd.h b/mit-pthreads/machdep/sunos-5.3/__unistd.h
new file mode 100755
index 00000000000..4e83a863735
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/__unistd.h
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+#include <sys/unistd.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/cdefs.h b/mit-pthreads/machdep/sunos-5.3/cdefs.h
new file mode 100755
index 00000000000..f95f7b36958
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/cdefs.h
@@ -0,0 +1,59 @@
+/* ==== 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
+#define const __const
+#define inline __inline
+#define signed __signed
+#define volatile __volatile
+#endif
+#else /* !__GNUC__ */
+#define __BEGIN_DECLS
+#define __END_DECLS
+#define __INLINE static
+#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/sunos-5.3/compat.h b/mit-pthreads/machdep/sunos-5.3/compat.h
new file mode 100755
index 00000000000..b2a846d00ee
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/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 : Basic timers header.
+ *
+ * 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/sunos-5.3/dirent.h b/mit-pthreads/machdep/sunos-5.3/dirent.h
new file mode 100755
index 00000000000..303d3d7df2b
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 */
+ off_t d_off; /* offset of next disk dir entry */
+ u_short d_reclen; /* length of this record */
+#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_namlen d_reclen
+#define d_ino d_fileno
+
+#endif /* !_SYS_DIRENT_H_ */
+
+
diff --git a/mit-pthreads/machdep/sunos-5.3/socket.h b/mit-pthreads/machdep/sunos-5.3/socket.h
new file mode 100755
index 00000000000..0b075622fed
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/socket.h
@@ -0,0 +1,180 @@
+/*
+ * 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
+ */
+
+#ifndef _SYS_SOCKET_H
+#define _SYS_SOCKET_H
+
+/*
+ * Types of sockets
+ */
+#define SOCK_STREAM 2 /* stream socket */
+#define SOCK_DGRAM 1 /* datagram socket */
+#define SOCK_RAW 4 /* raw-protocol interface */
+#define SOCK_RDM 5 /* reliably-delivered message */
+#define SOCK_SEQPACKET 6 /* 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_PROTOTYPE 0x1009 /* get/set protocol type */
+
+/*
+ * 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_NIT 17 /* NIT */
+#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
+#define AF_ISO 19 /* ISO protocols */
+#define AF_OSI AF_ISO
+#define AF_X25 20 /* CCITT X.25 in particular */
+#define AF_OSINET 21
+#define AF_GOSIP 22
+#define AF_MAX 22
+
+/*
+ * 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_NIT AF_NIT
+#define PF_802 AF_802
+#define PF_ISO AF_ISO
+#define PF_OSI AF_ISO
+#define PF_X25 AF_X25
+#define PF_OSINET AF_OSINET
+#define PF_GOSIP AF_GOSIP
+#define PF_MAX AF_MAX
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * 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
+
+#include <sys/cdefs.h>
+/*
+ * 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));
+int setsockopt __P_((int, int, int, const void *, int));
+int getsockname __P_((int, struct sockaddr *, int *));
+int shutdown __P_((int, int));
+int getpeername __P_((int, struct sockaddr *, int *));
+__END_DECLS
+
+#endif /* _SYS_SOCKET_H */
diff --git a/mit-pthreads/machdep/sunos-5.3/timers.h b/mit-pthreads/machdep/sunos-5.3/timers.h
new file mode 100755
index 00000000000..3ee2c78f088
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/timers.h
@@ -0,0 +1,72 @@
+/* ==== 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>
+
+#define tv_sec tv_sec
+#define tv_nsec 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
+ */
+
+#ifndef NOT_USED
+/* for sleep.h */
+/* int gettimeofday __P_((struct timeval *,struct timezone *)); */
+int gettimeofday __P_((struct timeval *,void *));
+#endif
+
+__BEGIN_DECLS
+
+__END_DECLS
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.3/uio.h b/mit-pthreads/machdep/sunos-5.3/uio.h
new file mode 100755
index 00000000000..7786142dd87
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.3/uio.h
@@ -0,0 +1,40 @@
+/* ==== uio.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Correct Solaris header file.
+ */
+
+#ifndef _PTHREAD_UIO_H_
+#define _PTHREAD_UIO_H_
+
+#include <sys/cdefs.h>
+
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+
+typedef struct iovec iovec_t;
+
+struct uio {
+ iovec_t *uio_iov; /* pointer to array of iovecs */
+ int uio_iovcnt; /* number of iovecs */
+ /* These are all bogus */
+ int _uio_offset; /* file offset */
+ int uio_segflg; /* address space (kernel or user) */
+ short uio_fmode; /* file mode flags */
+ int _uio_limit; /* u-limit (maximum "block" offset) */
+ int uio_resid; /* residual count */
+};
+
+typedef struct uio uio_t;
+
+__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/sunos-5.5/__math.h b/mit-pthreads/machdep/sunos-5.5/__math.h
new file mode 100755
index 00000000000..5404b52c661
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/__math.h
@@ -0,0 +1,16 @@
+/*
+ * ANSI/POSIX
+ */
+typedef union _h_val {
+ unsigned long _i[2];
+ double _d;
+} _h_val;
+
+#ifdef __STDC__
+extern const _h_val __huge_val;
+#else
+extern _h_val __huge_val;
+#endif
+
+#define HUGE_VAL __huge_val._d
+
diff --git a/mit-pthreads/machdep/sunos-5.5/__signal.h b/mit-pthreads/machdep/sunos-5.5/__signal.h
new file mode 100755
index 00000000000..638c1ca7331
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/__signal.h
@@ -0,0 +1,19 @@
+#include <sys/feature_tests.h>
+#include <sys/signal.h>
+
+/*
+typedef struct {
+ unsigned long __sigbits[4];
+} sigset_t;
+*/
+
+typedef int sig_atomic_t;
+
+#define sigmask(n) ((unsigned int)1 << (((n) - 1) & (32 - 1)))
+#define sigword(n) (((unsigned int)((n) - 1))>>5)
+
+#define __SIGEMPTYSET { 0, 0, 0, 0 };
+#define __SIGFILLSET { 0xffffffff,0xffffffff,0xffffffff,0xffffffff };
+#define __SIGADDSET(s, n) ((s)->__sigbits[sigword(n)] |= sigmask(n))
+#define __SIGDELSET(s, n) ((s)->__sigbits[sigword(n)] &= ~sigmask(n))
+#define __SIGISMEMBER(s, n) (sigmask(n) & (s)->__sigbits[sigword(n)])
diff --git a/mit-pthreads/machdep/sunos-5.5/__stdio.h b/mit-pthreads/machdep/sunos-5.5/__stdio.h
new file mode 100755
index 00000000000..4dd4becdbe9
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/__stdio.h
@@ -0,0 +1,6 @@
+typedef pthread_fpos_t fpos_t;
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__stdlib.h b/mit-pthreads/machdep/sunos-5.5/__stdlib.h
new file mode 100755
index 00000000000..a0717ce3c2b
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/__stdlib.h
@@ -0,0 +1,27 @@
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <sys/feature_tests.h>
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned int size_t;
+#endif
+
+#ifndef _UID_T
+#define _UID_T
+typedef long uid_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#ifndef _WCHAR_T
+#define _WCHAR_T
+typedef long wchar_t;
+#endif
+
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__string.h b/mit-pthreads/machdep/sunos-5.5/__string.h
new file mode 100755
index 00000000000..9cb12a07bb7
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/__string.h
@@ -0,0 +1,12 @@
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef pthread_size_t size_t;
+#endif
+
+/* Non-standard NetBSD string routines. */
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+__BEGIN_DECLS
+char *strdup __P_((const char *));
+__END_DECLS
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__time.h b/mit-pthreads/machdep/sunos-5.5/__time.h
new file mode 100755
index 00000000000..231e997acfa
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/__time.h
@@ -0,0 +1,69 @@
+/* ==== 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 : System specific time header.
+ *
+ * 1.00 94/11/07 proven
+ * -Started coding this file.
+ */
+
+#ifndef _SYS___TIME_H_
+#define _SYS___TIME_H_
+
+#include <sys/feature_tests.h>
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef unsigned size_t;
+#endif
+#ifndef _CLOCK_T
+#define _CLOCK_T
+typedef long clock_t;
+#endif
+#ifndef _TIME_T
+#define _TIME_T
+typedef long time_t;
+#endif
+#ifndef _CLOCKID_T
+#define _CLOCKID_T
+typedef int clockid_t;
+#endif
+#ifndef _TIMER_T
+#define _TIMER_T
+typedef int timer_t;
+#endif
+
+#include <sys/time.h>
+#include <sys/siginfo.h>
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/__unistd.h b/mit-pthreads/machdep/sunos-5.5/__unistd.h
new file mode 100755
index 00000000000..4e83a863735
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/__unistd.h
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+#include <sys/unistd.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/cdefs.h b/mit-pthreads/machdep/sunos-5.5/cdefs.h
new file mode 100755
index 00000000000..f95f7b36958
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/cdefs.h
@@ -0,0 +1,59 @@
+/* ==== 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
+#define const __const
+#define inline __inline
+#define signed __signed
+#define volatile __volatile
+#endif
+#else /* !__GNUC__ */
+#define __BEGIN_DECLS
+#define __END_DECLS
+#define __INLINE static
+#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/sunos-5.5/compat.h b/mit-pthreads/machdep/sunos-5.5/compat.h
new file mode 100755
index 00000000000..b2a846d00ee
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/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 : Basic timers header.
+ *
+ * 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/sunos-5.5/dirent.h b/mit-pthreads/machdep/sunos-5.5/dirent.h
new file mode 100755
index 00000000000..303d3d7df2b
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/dirent.h
@@ -0,0 +1,64 @@
+/*-
+ * 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 */
+ off_t d_off; /* offset of next disk dir entry */
+ u_short d_reclen; /* length of this record */
+#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_namlen d_reclen
+#define d_ino d_fileno
+
+#endif /* !_SYS_DIRENT_H_ */
+
+
diff --git a/mit-pthreads/machdep/sunos-5.5/socket.h b/mit-pthreads/machdep/sunos-5.5/socket.h
new file mode 100755
index 00000000000..0b075622fed
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/socket.h
@@ -0,0 +1,180 @@
+/*
+ * 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
+ */
+
+#ifndef _SYS_SOCKET_H
+#define _SYS_SOCKET_H
+
+/*
+ * Types of sockets
+ */
+#define SOCK_STREAM 2 /* stream socket */
+#define SOCK_DGRAM 1 /* datagram socket */
+#define SOCK_RAW 4 /* raw-protocol interface */
+#define SOCK_RDM 5 /* reliably-delivered message */
+#define SOCK_SEQPACKET 6 /* 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_PROTOTYPE 0x1009 /* get/set protocol type */
+
+/*
+ * 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_NIT 17 /* NIT */
+#define AF_802 18 /* IEEE 802.2, also ISO 8802 */
+#define AF_ISO 19 /* ISO protocols */
+#define AF_OSI AF_ISO
+#define AF_X25 20 /* CCITT X.25 in particular */
+#define AF_OSINET 21
+#define AF_GOSIP 22
+#define AF_MAX 22
+
+/*
+ * 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_NIT AF_NIT
+#define PF_802 AF_802
+#define PF_ISO AF_ISO
+#define PF_OSI AF_ISO
+#define PF_X25 AF_X25
+#define PF_OSINET AF_OSINET
+#define PF_GOSIP AF_GOSIP
+#define PF_MAX AF_MAX
+
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define SOMAXCONN 5
+
+/*
+ * 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
+
+#include <sys/cdefs.h>
+/*
+ * 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));
+int setsockopt __P_((int, int, int, const void *, int));
+int getsockname __P_((int, struct sockaddr *, int *));
+int shutdown __P_((int, int));
+int getpeername __P_((int, struct sockaddr *, int *));
+__END_DECLS
+
+#endif /* _SYS_SOCKET_H */
diff --git a/mit-pthreads/machdep/sunos-5.5/timers.h b/mit-pthreads/machdep/sunos-5.5/timers.h
new file mode 100755
index 00000000000..3aad5f80065
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/timers.h
@@ -0,0 +1,70 @@
+/* ==== 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>
+
+#define tv_sec tv_sec
+#define tv_nsec 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
+ */
+
+#ifdef NOT_USED
+int gettimeofday __P_((struct timeval *,struct timezone *)); /* for sleep.h */
+#endif
+
+__BEGIN_DECLS
+
+__END_DECLS
+
+#endif
diff --git a/mit-pthreads/machdep/sunos-5.5/uio.h b/mit-pthreads/machdep/sunos-5.5/uio.h
new file mode 100755
index 00000000000..7786142dd87
--- /dev/null
+++ b/mit-pthreads/machdep/sunos-5.5/uio.h
@@ -0,0 +1,40 @@
+/* ==== uio.h ============================================================
+ * Copyright (c) 1994 by Chris Provenzano, proven@athena.mit.edu
+ *
+ * Description : Correct Solaris header file.
+ */
+
+#ifndef _PTHREAD_UIO_H_
+#define _PTHREAD_UIO_H_
+
+#include <sys/cdefs.h>
+
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+
+typedef struct iovec iovec_t;
+
+struct uio {
+ iovec_t *uio_iov; /* pointer to array of iovecs */
+ int uio_iovcnt; /* number of iovecs */
+ /* These are all bogus */
+ int _uio_offset; /* file offset */
+ int uio_segflg; /* address space (kernel or user) */
+ short uio_fmode; /* file mode flags */
+ int _uio_limit; /* u-limit (maximum "block" offset) */
+ int uio_resid; /* residual count */
+};
+
+typedef struct uio uio_t;
+
+__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/syscall-alpha-netbsd-1.1.S b/mit-pthreads/machdep/syscall-alpha-netbsd-1.1.S
new file mode 100644
index 00000000000..5b7dd017426
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-alpha-netbsd-1.1.S
@@ -0,0 +1,206 @@
+#include <machine/asm.h>
+#define CHMK() call_pal 0x83
+#define COMPAT_43
+#include <sys/syscall.h>
+#ifndef __CONCAT
+#include <sys/cdefs.h>
+#endif
+#define CONCAT __CONCAT
+
+#undef SYSCALL
+
+/* Kernel syscall interface:
+ Input:
+ v0 - system call number
+ a* - arguments, as in C
+ Output:
+ a3 - zero iff successful
+ v0 - errno value on failure, else result
+
+ This macro is similar to SYSCALL in asm.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ This macro expansions does not include the return instruction.
+ If there's no other work to be done, use something like:
+ SYSCALL(foo) ; ret
+ If there is other work to do (in fork, maybe?), do it after the
+ SYSCALL invocation. */
+
+#define SYSCALL(x) \
+ .align 4 ;\
+ .globl CONCAT(machdep_sys_,x) ;\
+ .ent CONCAT(machdep_sys_,x), 0 ;\
+CONCAT(machdep_sys_,x): ;\
+ .frame sp,0,ra ;\
+ ldiq v0, CONCAT(SYS_,x) ;\
+ CHMK() ;\
+ beq a3, CONCAT(Lsys_noerr_,x) ;\
+ br gp, CONCAT(Lsys_err_,x) ;\
+CONCAT(Lsys_err_,x): ;\
+ /* Load gp so we can find cerror to jump to. */;\
+ ldgp gp, 0(gp) ;\
+ jmp zero, machdep_cerror ;\
+CONCAT(Lsys_noerr_,x):
+
+#define XSYSCALL(x) SYSCALL(x) ; RET ; .end CONCAT(machdep_sys_,x)
+
+ .globl machdep_cerror
+machdep_cerror:
+ br t0, Lmachdep_cerror_setgp
+Lmachdep_cerror_setgp:
+ ldgp gp, 0(t0)
+ stl v0, errno
+#if 0
+ ldiq v0, -1
+#else
+ subq zero, v0, v0
+#endif
+ RET
+
+/* The fork system call is special... */
+SYSCALL(fork)
+ cmovne a4, 0, v0
+ RET
+ .end machdep_sys_fork
+
+/* The pipe system call is special... */
+SYSCALL(pipe)
+ stl v0, 0(a0)
+ stl a4, 4(a0)
+ mov zero, v0
+ RET
+ .end machdep_sys_pipe
+
+/* The sigsuspend system call is special... */
+ .align 4
+ .globl machdep_sys_sigsuspend
+ .ent machdep_sys_sigsuspend, 0
+machdep_sys_sigsuspend:
+ ldl a0, 0(a0) /* pass *mask instead of mask */
+ ldiq v0, SYS_sigsuspend
+ CHMK()
+ mov zero, v0 /* shouldn't need; just in case... */
+ RET
+ .end machdep_sys_sigsuspend
+
+/* The sigprocmask system call is special... */
+ .align 4
+ .globl machdep_sys_sigprocmask
+ .ent machdep_sys_sigprocmask, 0
+machdep_sys_sigprocmask:
+ mov a2, a5 /* safe */
+ cmoveq a1, 1, a0 /* if set == NULL, how = SIG_BLOCK */
+ beq a1, Ldoit /* and set = 0, and do it. */
+ ldl a1, 0(a1) /* load the set from *set */
+Ldoit: ldiq v0, SYS_sigprocmask
+ CHMK()
+ beq a5, Lret /* if they don't want old mask, done */
+ stl v0, 0(a5) /* otherwise, give it to them. */
+Lret: mov zero, v0
+ RET
+ .end machdep_sys_sigprocmask
+
+/* More stuff ... */
+ .align 4
+ .global __machdep_save_int_state
+ .ent __machdep_save_int_state, 0
+__machdep_save_int_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* save integer registers */
+ stq ra, ( 0 * 8)(a0) /* return address */
+ stq s0, ( 1 * 8)(a0) /* callee-saved registers */
+ stq s1, ( 2 * 8)(a0)
+ stq s2, ( 3 * 8)(a0)
+ stq s3, ( 4 * 8)(a0)
+ stq s4, ( 5 * 8)(a0)
+ stq s5, ( 6 * 8)(a0)
+ stq s6, ( 7 * 8)(a0)
+ stq sp, ( 9 * 8)(a0)
+ stq ra, ( 8 * 8)(a0) /* RA on return */
+ stq pv, (10 * 8)(a0) /* and PV; we restore it */
+
+ mov zero, v0
+ lda sp, 16(sp)
+ RET
+ .end __machdep_save_int_state
+
+ .align 4
+ .global __machdep_restore_int_state
+ .ent __machdep_restore_int_state, 0
+__machdep_restore_int_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* restore integer registers */
+ ldq t0, ( 0 * 8)(a0) /* return address */
+ ldq s0, ( 1 * 8)(a0) /* callee-saved registers */
+ ldq s1, ( 2 * 8)(a0)
+ ldq s2, ( 3 * 8)(a0)
+ ldq s3, ( 4 * 8)(a0)
+ ldq s4, ( 5 * 8)(a0)
+ ldq s5, ( 6 * 8)(a0)
+ ldq s6, ( 7 * 8)(a0)
+ ldq ra, ( 8 * 8)(a0) /* RA after return */
+ ldq sp, ( 9 * 8)(a0)
+ ldq pv, (10 * 8)(a0) /* and PV; we restore it */
+
+ ldiq v0, 1
+ ret zero,(t0),1
+ .end __machdep_restore_int_state
+
+ .align 4
+ .global __machdep_save_fp_state
+ .ent __machdep_save_fp_state, 0
+__machdep_save_fp_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* save FP registers */
+ stt fs0, (0 * 8)(a0) /* callee-saved registers */
+ stt fs1, (1 * 8)(a0)
+ stt fs2, (2 * 8)(a0)
+ stt fs3, (3 * 8)(a0)
+ stt fs4, (4 * 8)(a0)
+ stt fs5, (5 * 8)(a0)
+ stt fs6, (6 * 8)(a0)
+ stt fs7, (7 * 8)(a0)
+ mf_fpcr ft0 /* and FP control reg */
+ stt ft0, (8 * 8)(a0)
+
+ lda sp, 16(sp)
+ RET
+ .end __machdep_save_fp_state
+
+ .align 4
+ .global __machdep_restore_fp_state
+ .ent __machdep_restore_fp_state, 0
+__machdep_restore_fp_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* restore FP registers */
+ ldt fs0, (0 * 8)(a0) /* callee-saved registers */
+ ldt fs1, (1 * 8)(a0)
+ ldt fs2, (2 * 8)(a0)
+ ldt fs3, (3 * 8)(a0)
+ ldt fs4, (4 * 8)(a0)
+ ldt fs5, (5 * 8)(a0)
+ ldt fs6, (6 * 8)(a0)
+ ldt fs7, (7 * 8)(a0)
+ ldt ft0, (8 * 8)(a0)
+ mt_fpcr ft0 /* and FP control reg */
+
+ lda sp, 16(sp)
+ RET
+ .end __machdep_restore_fp_state
diff --git a/mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S b/mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S
new file mode 100644
index 00000000000..61435a729d7
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-alpha-netbsd-1.3.S
@@ -0,0 +1,228 @@
+#include <machine/asm.h>
+#define CHMK() call_pal 0x83
+#define COMPAT_43
+#include <sys/syscall.h>
+#ifndef __CONCAT
+#include <sys/cdefs.h>
+#endif
+#define CONCAT __CONCAT
+
+#undef SYSCALL
+
+/* Kernel syscall interface:
+ Input:
+ v0 - system call number
+ a* - arguments, as in C
+ Output:
+ a3 - zero iff successful
+ v0 - errno value on failure, else result
+
+ This macro is similar to SYSCALL in asm.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ This macro expansions does not include the return instruction.
+ If there's no other work to be done, use something like:
+ SYSCALL(foo) ; ret
+ If there is other work to do (in fork, maybe?), do it after the
+ SYSCALL invocation. */
+
+#define SYSCALL(x) \
+ .align 4 ;\
+ .globl CONCAT(machdep_sys_,x) ;\
+ .ent CONCAT(machdep_sys_,x), 0 ;\
+CONCAT(machdep_sys_,x): ;\
+ .frame sp,0,ra ;\
+ ldiq v0, CONCAT(SYS_,x) ;\
+ CHMK() ;\
+ beq a3, CONCAT(Lsys_noerr_,x) ;\
+ br gp, CONCAT(Lsys_err_,x) ;\
+CONCAT(Lsys_err_,x): ;\
+ /* Load gp so we can find cerror to jump to. */;\
+ ldgp gp, 0(gp) ;\
+ jmp zero, machdep_cerror ;\
+CONCAT(Lsys_noerr_,x):
+
+#define XSYSCALL(x) SYSCALL(x) ; RET ; .end CONCAT(machdep_sys_,x)
+
+ .globl machdep_cerror
+machdep_cerror:
+ br t0, Lmachdep_cerror_setgp
+Lmachdep_cerror_setgp:
+ ldgp gp, 0(t0)
+ stl v0, errno
+#if 0
+ ldiq v0, -1
+#else
+ subq zero, v0, v0
+#endif
+ RET
+
+/* The fork system call is special... */
+SYSCALL(fork)
+ cmovne a4, 0, v0
+ RET
+ .end machdep_sys_fork
+
+/* The pipe system call is special... */
+SYSCALL(pipe)
+ stl v0, 0(a0)
+ stl a4, 4(a0)
+ mov zero, v0
+ RET
+ .end machdep_sys_pipe
+
+#ifndef SYS___sigsuspend14
+/* The sigsuspend system call is special... */
+ .align 4
+ .globl machdep_sys_sigsuspend
+ .ent machdep_sys_sigsuspend, 0
+machdep_sys_sigsuspend:
+ ldl a0, 0(a0) /* pass *mask instead of mask */
+ ldiq v0, SYS_sigsuspend
+ CHMK()
+ mov zero, v0 /* shouldn't need; just in case... */
+ RET
+ .end machdep_sys_sigsuspend
+#endif /* SYS_sigsuspend14 */
+
+#ifndef SYS___sigprocmask14
+/* The sigprocmask system call is special... */
+ .align 4
+ .globl machdep_sys_sigprocmask
+ .ent machdep_sys_sigprocmask, 0
+machdep_sys_sigprocmask:
+ mov a2, a5 /* safe */
+ cmoveq a1, 1, a0 /* if set == NULL, how = SIG_BLOCK */
+ beq a1, Ldoit /* and set = 0, and do it. */
+ ldl a1, 0(a1) /* load the set from *set */
+Ldoit: ldiq v0, SYS_sigprocmask
+ CHMK()
+ beq a5, Lret /* if they don't want old mask, done */
+ stl v0, 0(a5) /* otherwise, give it to them. */
+Lret: mov zero, v0
+ RET
+ .end machdep_sys_sigprocmask
+#endif /* SYS_sigprocmask14 */
+
+/* More stuff ... */
+ .align 4
+ .global __machdep_save_int_state
+ .ent __machdep_save_int_state, 0
+__machdep_save_int_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* save integer registers */
+ stq ra, ( 0 * 8)(a0) /* return address */
+ stq s0, ( 1 * 8)(a0) /* callee-saved registers */
+ stq s1, ( 2 * 8)(a0)
+ stq s2, ( 3 * 8)(a0)
+ stq s3, ( 4 * 8)(a0)
+ stq s4, ( 5 * 8)(a0)
+ stq s5, ( 6 * 8)(a0)
+ stq s6, ( 7 * 8)(a0)
+ stq sp, ( 9 * 8)(a0)
+ stq ra, ( 8 * 8)(a0) /* RA on return */
+ stq pv, (10 * 8)(a0) /* and PV; we restore it */
+
+ mov zero, v0
+ lda sp, 16(sp)
+ RET
+ .end __machdep_save_int_state
+
+ .align 4
+ .global __machdep_restore_int_state
+ .ent __machdep_restore_int_state, 0
+__machdep_restore_int_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* restore integer registers */
+ ldq t0, ( 0 * 8)(a0) /* return address */
+ ldq s0, ( 1 * 8)(a0) /* callee-saved registers */
+ ldq s1, ( 2 * 8)(a0)
+ ldq s2, ( 3 * 8)(a0)
+ ldq s3, ( 4 * 8)(a0)
+ ldq s4, ( 5 * 8)(a0)
+ ldq s5, ( 6 * 8)(a0)
+ ldq s6, ( 7 * 8)(a0)
+ ldq ra, ( 8 * 8)(a0) /* RA after return */
+ ldq sp, ( 9 * 8)(a0)
+ ldq pv, (10 * 8)(a0) /* and PV; we restore it */
+
+ ldiq v0, 1
+ ret zero,(t0),1
+ .end __machdep_restore_int_state
+
+ .align 4
+ .global __machdep_save_fp_state
+ .ent __machdep_save_fp_state, 0
+__machdep_save_fp_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* save FP registers */
+ stt fs0, (0 * 8)(a0) /* callee-saved registers */
+ stt fs1, (1 * 8)(a0)
+ stt fs2, (2 * 8)(a0)
+ stt fs3, (3 * 8)(a0)
+ stt fs4, (4 * 8)(a0)
+ stt fs5, (5 * 8)(a0)
+ stt fs6, (6 * 8)(a0)
+ stt fs7, (7 * 8)(a0)
+ mf_fpcr ft0 /* and FP control reg */
+ stt ft0, (8 * 8)(a0)
+
+ lda sp, 16(sp)
+ RET
+ .end __machdep_save_fp_state
+
+ .align 4
+ .global __machdep_restore_fp_state
+ .ent __machdep_restore_fp_state, 0
+__machdep_restore_fp_state:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+
+ /* restore FP registers */
+ ldt fs0, (0 * 8)(a0) /* callee-saved registers */
+ ldt fs1, (1 * 8)(a0)
+ ldt fs2, (2 * 8)(a0)
+ ldt fs3, (3 * 8)(a0)
+ ldt fs4, (4 * 8)(a0)
+ ldt fs5, (5 * 8)(a0)
+ ldt fs6, (6 * 8)(a0)
+ ldt fs7, (7 * 8)(a0)
+ ldt ft0, (8 * 8)(a0)
+ mt_fpcr ft0 /* and FP control reg */
+
+ lda sp, 16(sp)
+ RET
+ .end __machdep_restore_fp_state
+
+/* For fstat() we actually syscall fstat13. */
+ .align 4
+ .globl machdep_sys_fstat
+ .ent machdep_sys_fstat, 0
+machdep_sys_fstat:
+ .frame sp,0,ra
+ ldiq v0, SYS___fstat13
+ CHMK()
+ beq a3, Lsys_noerr_fstat
+ br gp, Lsys_err_fstat
+Lsys_err_fstat:
+ /* Load gp so we can find cerror to jump to. */
+ ldgp gp, 0(gp)
+ jmp zero, machdep_cerror
+Lsys_noerr_fstat:
+ RET
+ .end machdep_sys_fstat
diff --git a/mit-pthreads/machdep/syscall-alpha-osf1.S b/mit-pthreads/machdep/syscall-alpha-osf1.S
new file mode 100644
index 00000000000..fad823a7352
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-alpha-osf1.S
@@ -0,0 +1,97 @@
+#include <asm.h>
+#include <regdef.h>
+#define COMPAT_43
+#include <syscall.h>
+
+#undef SYSCALL
+
+/* Kernel syscall interface:
+ Input:
+ v0 - system call number
+ a* - arguments, as in C
+ Output:
+ a3 - zero iff successful
+ v0 - errno value on failure, else result
+
+ This macro is similar to SYSCALL in asm.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ This macro expansions does not include the return instruction.
+ If there's no other work to be done, use something like:
+ SYSCALL(foo) ; ret
+ If there is other work to do (in fork, maybe?), do it after the
+ SYSCALL invocation. */
+
+#define SYSCALL(x) \
+ .align 4 ;\
+ .globl machdep_sys_##x ;\
+ .ent machdep_sys_##x, 0 ;\
+machdep_sys_##x: ;\
+ .frame sp,0,ra ;\
+ ldiq v0, SYS_##x ;\
+ CHMK() ;\
+ beq a3, 2f ;\
+ br gp, 1f ;\
+1: ;\
+ /* Load gp so we can find cerror to jump to. */;\
+ ldgp gp, 0(gp) ;\
+ jmp zero, machdep_cerror ;\
+2:
+
+#define XSYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
+
+ .globl machdep_cerror
+machdep_cerror:
+ br t0, 1f
+1:
+ ldgp gp, 0(t0)
+ stl v0, errno
+#if 0
+ ldiq v0, -1
+#else
+ subq zero, v0, v0
+#endif
+ ret
+
+/* The fork system call is special... */
+SYSCALL(fork)
+ cmovne a4, 0, v0
+ ret
+ .end machdep_sys_fork
+
+/* So is the sigsuspend system call */
+ .align 4
+ .globl machdep_sys_sigsuspend
+ .ent machdep_sys_sigsuspend, 0
+machdep_sys_sigsuspend:
+ .frame sp,0,ra
+
+ bis a0, a0, a1
+ ldq a0, 0(a1)
+ ldiq v0, SYS_sigsuspend
+ CHMK()
+ ret
+ .end machdep_sys_sigsuspend
+
+/* More stuff ... */
+ .align 4
+ .globl machdep_restore_from_setjmp
+ .ent machdep_restore_from_setjmp, 0
+machdep_restore_from_setjmp:
+ .frame sp, 16, ra
+ ldgp gp, 0(t12)
+ lda sp, -16(sp)
+ stq ra, 0(sp)
+ ldq v0, 280(a0)
+ subq v0, 0x00000000acedbade, t0
+ bne t0, botch
+ cmoveq a1, 0x1, a1
+ stq a1, 32(a0)
+ ldiq v0, 0x67
+ call_pal 0x83
+botch:
+ /* This should cause the program to crash. Eventually, fix it
+ up to print a message first. */
+ jsr abort
+ .end machdep_restore_from_setjmp
diff --git a/mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S b/mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S
new file mode 100644
index 00000000000..5914674b508
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-arm32-netbsd-1.3.S
@@ -0,0 +1,193 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 0
+
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _C_LABEL(machdep_sys_fork);
+
+_C_LABEL(machdep_sys_fork):;
+
+ swi SYS_fork
+ bcs 1f
+ sub r1, r1, #0x00000001
+ and r0, r0, r1
+ mov r15, r14
+
+
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+ .globl _C_LABEL(machdep_sys_fstat);
+
+_C_LABEL(machdep_sys_fstat):;
+
+ swi SYS___fstat13
+ bcs 1f
+ mov r15, r14
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+_machdep_sys___syscall:;
+
+ swi SYS___syscall
+ bcs 1f
+ mov r15, r14
+
+
+#ifndef SYS___sigsuspend14
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _C_LABEL(machdep_sys_sigsuspend);
+
+_C_LABEL(machdep_sys_sigsuspend):;
+
+ ldr r0, [r0]
+ swi SYS_sigsuspend
+ bcs 1f
+ mov r0, #0x00000000
+ mov r15, r14
+
+#endif
+
+#ifndef SYS___sigprocmask14
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl _C_LABEL(machdep_sys_sigprocmask);
+
+_C_LABEL(machdep_sys_sigprocmask):;
+
+ teq r1, #0x00000000
+ moveq r0, #0x00000001
+ moveq r1, #0x00000000
+ ldrne r1, [r1]
+ swi SYS_sigprocmask
+ bcs 1f
+ teq r2, #0x00000000
+ strne r0, [r2]
+ mov r0, #0x00000000
+ mov r15, r14
+#endif
+
+/* ==========================================================================
+ * machdep_sys_ftruncate()
+ */
+ .global _C_LABEL(machdep_sys_ftruncate)
+_C_LABEL(machdep_sys_ftruncate):
+ mov r12, r13
+ stmfd r13!, {r11, r12, r14, r15}
+ sub r13, r13, #8
+ stmia r13, {r1-r2}
+ mov r3, #0
+ sub r11, r12, #4
+ mov r2, r0
+ mov r1, #0
+ mov r0, #201
+ bl _machdep_sys___syscall
+ ldmea r11, {r11, r13, r15}
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .global _C_LABEL(machdep_sys_lseek)
+
+_C_LABEL(machdep_sys_lseek):
+ mov r12, r13
+ stmfd r13!, {r11, r12, r14, r15}
+ str r3, [r13, #-4]!
+ sub r13, r13, #8
+ stmia r13, {r1-r2}
+ sub r11, r12, #4
+ mov r3, #0
+ mov r2, r0
+ mov r1, #0
+ mov r0, #SYS_lseek
+ bl _machdep_sys___syscall
+ ldmea r11, {r11, r13, r15}
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _C_LABEL(machdep_sys_pipe);
+
+_C_LABEL(machdep_sys_pipe):;
+
+ mov r2, r0
+ swi SYS_pipe
+ bcs 1f
+ str r0, [r2, #0x0000]
+ str r1, [r2, #0x0004]
+ mov r0, #0x00000000
+ mov r15, r14
+
+
+1:
+ rsb r0, r0, #0x00000000
+ mvn r1, #0x00000000
+ mov r15, r14
diff --git a/mit-pthreads/machdep/syscall-hppa-hpux-10.20.S b/mit-pthreads/machdep/syscall-hppa-hpux-10.20.S
new file mode 100644
index 00000000000..c63d845bae5
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-hppa-hpux-10.20.S
@@ -0,0 +1,23 @@
+ .CODE
+
+machdep_error
+ sub %r0,%r28,%r28
+ bv,n %r0(%r2)
+
+machdep_sys_fork
+
+ .PROC
+ .CALLINFO NO_CALLS,FRAME=0
+
+ ldil -0x80000,%r1
+ ble 4(%sr7,%r1)
+ ldi 2 ,%r22
+ or,= %r0,%r22,%r0
+ b,n machdep_error
+ or,= %r29,%r0,%r0
+ copy %r0,%r28
+ bv,n %r0(%r2)
+
+ .PROCEND
+ .EXPORT machdep_sys_fork,ENTRY
+
diff --git a/mit-pthreads/machdep/syscall-hppa-hpux-9.03.S b/mit-pthreads/machdep/syscall-hppa-hpux-9.03.S
new file mode 100644
index 00000000000..c63d845bae5
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-hppa-hpux-9.03.S
@@ -0,0 +1,23 @@
+ .CODE
+
+machdep_error
+ sub %r0,%r28,%r28
+ bv,n %r0(%r2)
+
+machdep_sys_fork
+
+ .PROC
+ .CALLINFO NO_CALLS,FRAME=0
+
+ ldil -0x80000,%r1
+ ble 4(%sr7,%r1)
+ ldi 2 ,%r22
+ or,= %r0,%r22,%r0
+ b,n machdep_error
+ or,= %r29,%r0,%r0
+ copy %r0,%r28
+ bv,n %r0(%r2)
+
+ .PROCEND
+ .EXPORT machdep_sys_fork,ENTRY
+
diff --git a/mit-pthreads/machdep/syscall-i386-bsdi-1.1.S b/mit-pthreads/machdep/syscall-i386-bsdi-1.1.S
new file mode 100644
index 00000000000..e54cd0d0773
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-bsdi-1.1.S
@@ -0,0 +1,288 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+_machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_write()
+ */
+SYSCALL(write)
+
+/* ==========================================================================
+ * machdep_sys_read()
+ */
+SYSCALL(read)
+
+/* ==========================================================================
+ * machdep_sys_open()
+ */
+SYSCALL(open)
+
+/* ==========================================================================
+ * machdep_sys_close()
+ */
+SYSCALL(close)
+
+/* ==========================================================================
+ * machdep_sys_fcntl()
+ */
+SYSCALL(fcntl)
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+SYSCALL(lseek)
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+SYSCALL(pipe)
+
+/* ==========================================================================
+ * machdep_sys_dup()
+ */
+SYSCALL(dup)
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+SYSCALL(dup2)
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys_execve()
+ */
+SYSCALL(execve)
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+SYSCALL(fstat)
+
+/* ==========================================================================
+ * machdep_sys_fchown()
+ */
+SYSCALL(fchown)
+
+/* ==========================================================================
+ * machdep_sys_fchmod()
+ */
+SYSCALL(fchmod)
+
+/* ==========================================================================
+ * machdep_sys_chown()
+ */
+SYSCALL(chown)
+
+/* ==========================================================================
+ * machdep_sys_chmod()
+ */
+SYSCALL(chmod)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(chdir)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(link)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(unlink)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(rename)
+
+/* ==========================================================================
+ * Nonstandard calls used to make the system work
+ *
+ * ==========================================================================
+ * machdep_sys_select()
+ */
+SYSCALL(select)
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+SYSCALL(getdirentries)
+
+/* ==========================================================================
+ * machdep_sys_wait4()
+ */
+SYSCALL(wait4)
+
+/* ==========================================================================
+ * Berkeley socket stuff
+ *
+ * ==========================================================================
+ * machdep_sys_socket()
+ */
+SYSCALL(socket)
+
+/* ==========================================================================
+ * machdep_sys_bind()
+ */
+SYSCALL(bind)
+
+/* ==========================================================================
+ * machdep_sys_connect()
+ */
+SYSCALL(connect)
+
+/* ==========================================================================
+ * machdep_sys_accept()
+ */
+SYSCALL(accept)
+
+/* ==========================================================================
+ * machdep_sys_listen()
+ */
+SYSCALL(listen)
+
+/* ==========================================================================
+ * machdep_sys_getsockopt()
+ */
+SYSCALL(getsockopt)
+
+/* ==========================================================================
+ * machdep_sys_readv()
+ */
+SYSCALL(readv)
+
+/* ==========================================================================
+ * machdep_sys_writev()
+ */
+SYSCALL(writev)
+
+/* ==========================================================================
+ * machdep_sys_getpeername()
+ */
+SYSCALL(getpeername)
+
+/* ==========================================================================
+ * machdep_sys_getsockname()
+ */
+SYSCALL(getsockname)
+
+/* ==========================================================================
+ * machdep_sys_sendto()
+ */
+SYSCALL(sendto)
+
+/* ==========================================================================
+ * machdep_sys_recvfrom()
+ */
+SYSCALL(recvfrom)
+
+/* ==========================================================================
+ * machdep_sys_sendmsg()
+ */
+SYSCALL(sendmsg)
+
+/* ==========================================================================
+ * machdep_sys_recvmsg()
+ */
+SYSCALL(recvmsg)
+
+/* ==========================================================================
+ * machdep_sys_shutdown() - Is this correct?
+ */
+SYSCALL(shutdown)
+
diff --git a/mit-pthreads/machdep/syscall-i386-bsdi-2.0.S b/mit-pthreads/machdep/syscall-i386-bsdi-2.0.S
new file mode 100644
index 00000000000..8a56717da31
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-bsdi-2.0.S
@@ -0,0 +1,294 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "syscall-i386-netbsd-1.0.S,v 1.56 1995/09/26 21:04:05 raeburn Exp";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <sys/syscall.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+_machdep_sys___syscall:;
+
+ movl $(SYS___syscall), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ jb 3f;
+ ret
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _machdep_sys_sigsuspend;
+
+_machdep_sys_sigsuspend:;
+
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ jb 3f;
+ ret
+
+3:
+
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .globl _machdep_sys_lseek;
+
+_machdep_sys_lseek:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x14(%ebp);
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0;
+ pushl 0x8(%ebp);
+ pushl $0x0;
+ pushl $(SYS_lseek);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+/* ==========================================================================
+ * machdep_sys_ftruncate() ; Added by Monty
+ */
+ .globl _machdep_sys_ftruncate;
+
+_machdep_sys_ftruncate:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0; # Why this?
+ pushl 0x8(%ebp);
+ pushl $0x0; # And this?
+ pushl $(SYS_ftruncate);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+
+/* BSDI DEFS.h,v 2.1 1995/02/03 06:28:24 polk Exp */
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * @(#)DEFS.h 8.1 (Berkeley) 6/4/93
+ */
+
+#ifdef PROF
+#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: \
+ .data; 1:; .long 0; .text; \
+ pushl %ebp; movl %esp,%ebp; \
+ leal 1b,%eax; call mcount; leave
+#define ASENTRY(x) .globl x; .align 2; x: \
+ .data; 1:; .long 0; .text; \
+ pushl %ebp; movl %esp,%ebp; \
+ leal 1b,%eax; call mcount; leave
+#else
+#define ENTRY(x) .globl _/**/x; .align 2; _/**/x:
+#define ASENTRY(x) .globl x; .align 2; x:
+#endif
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+ .asciz "@(#)_setjmp.s 8.1 (Berkeley) 6/4/93"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * C library -- _setjmp, _longjmp
+ *
+ * _longjmp(a,v)
+ * will generate a "return(v)" from the last call to
+ * _setjmp(a)
+ * by restoring registers from the stack.
+ * The previous signal state is NOT restored.
+ */
+
+
+.globl __setjmp; /* Patch by Jan Legenhausen (monty) */
+.align 2;
+__setjmp:
+ movl 4(%esp),%eax
+ movl 0(%esp),%edx
+ movl %edx, 0(%eax) /* rta */
+ movl %ebx, 4(%eax)
+ movl %esp, 8(%eax)
+ movl %ebp,12(%eax)
+ movl %esi,16(%eax)
+ movl %edi,20(%eax)
+ movl $0,%eax
+ ret
+
+.globl __longjmp; /* Patch by Jan Legenhausen ? (monty) */
+.align 2;
+__longjmp:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ movl 0(%edx),%ecx
+ movl 4(%edx),%ebx
+ movl 8(%edx),%esp
+ movl 12(%edx),%ebp
+ movl 16(%edx),%esi
+ movl 20(%edx),%edi
+ cmpl $0,%eax
+ jne 1f
+ movl $1,%eax
+1: movl %ecx,0(%esp)
+ ret
diff --git a/mit-pthreads/machdep/syscall-i386-freebsd-1.1.S b/mit-pthreads/machdep/syscall-i386-freebsd-1.1.S
new file mode 100644
index 00000000000..5777cc5e06d
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-freebsd-1.1.S
@@ -0,0 +1,293 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+_machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_write()
+ */
+SYSCALL(write)
+
+/* ==========================================================================
+ * machdep_sys_read()
+ */
+SYSCALL(read)
+
+/* ==========================================================================
+ * machdep_sys_open()
+ */
+SYSCALL(open)
+
+/* ==========================================================================
+ * machdep_sys_close()
+ */
+SYSCALL(close)
+
+/* ==========================================================================
+ * machdep_sys_fcntl()
+ */
+SYSCALL(fcntl)
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+SYSCALL(lseek)
+
+/* ==========================================================================
+ * machdep_sys_stat()
+ */
+SYSCALL(stat)
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+SYSCALL(pipe)
+
+/* ==========================================================================
+ * machdep_sys_dup()
+ */
+SYSCALL(dup)
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+SYSCALL(dup2)
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys_execve()
+ */
+SYSCALL(execve)
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+SYSCALL(fstat)
+
+/* ==========================================================================
+ * machdep_sys_fchown()
+ */
+SYSCALL(fchown)
+
+/* ==========================================================================
+ * machdep_sys_fchmod()
+ */
+SYSCALL(fchmod)
+
+/* ==========================================================================
+ * machdep_sys_chown()
+ */
+SYSCALL(chown)
+
+/* ==========================================================================
+ * machdep_sys_chmod()
+ */
+SYSCALL(chmod)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(chdir)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(link)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(unlink)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL(rename)
+
+/* ==========================================================================
+ * Nonstandard calls used to make the system work
+ *
+ * ==========================================================================
+ * machdep_sys_select()
+ */
+SYSCALL(select)
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+SYSCALL(getdirentries)
+
+/* ==========================================================================
+ * machdep_sys_wait4()
+ */
+SYSCALL(wait4)
+
+/* ==========================================================================
+ * Berkeley socket stuff
+ *
+ * ==========================================================================
+ * machdep_sys_socket()
+ */
+SYSCALL(socket)
+
+/* ==========================================================================
+ * machdep_sys_bind()
+ */
+SYSCALL(bind)
+
+/* ==========================================================================
+ * machdep_sys_connect()
+ */
+SYSCALL(connect)
+
+/* ==========================================================================
+ * machdep_sys_accept()
+ */
+SYSCALL(accept)
+
+/* ==========================================================================
+ * machdep_sys_listen()
+ */
+SYSCALL(listen)
+
+/* ==========================================================================
+ * machdep_sys_getsockopt()
+ */
+SYSCALL(getsockopt)
+
+/* ==========================================================================
+ * machdep_sys_readv()
+ */
+SYSCALL(readv)
+
+/* ==========================================================================
+ * machdep_sys_writev()
+ */
+SYSCALL(writev)
+
+/* ==========================================================================
+ * machdep_sys_getpeername()
+ */
+SYSCALL(getpeername)
+
+/* ==========================================================================
+ * machdep_sys_getsockname()
+ */
+SYSCALL(getsockname)
+
+/* ==========================================================================
+ * machdep_sys_sendto()
+ */
+SYSCALL(sendto)
+
+/* ==========================================================================
+ * machdep_sys_recvfrom()
+ */
+SYSCALL(recvfrom)
+
+/* ==========================================================================
+ * machdep_sys_sendmsg()
+ */
+SYSCALL(sendmsg)
+
+/* ==========================================================================
+ * machdep_sys_recvmsg()
+ */
+SYSCALL(recvmsg)
+
+/* ==========================================================================
+ * machdep_sys_shutdown()
+ */
+SYSCALL(shutdown)
+
diff --git a/mit-pthreads/machdep/syscall-i386-freebsd-2.0.S b/mit-pthreads/machdep/syscall-i386-freebsd-2.0.S
new file mode 100644
index 00000000000..b713bcac344
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-freebsd-2.0.S
@@ -0,0 +1,240 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1995 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "syscall-i386-freebsd-2.0.S,v 1.2 1995/05/26 07:44:29 proven Exp";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+
+#ifdef __ELF__
+#define NAME(X) machdep_sys_##X
+#else
+#define NAME(X) _machdep_sys_##X
+#endif
+
+#else
+
+#ifdef __ELF__
+#define NAME(X) machdep_sys_/**/X
+#else
+#define NAME(X) _machdep_sys_/**/X
+#endif
+
+#endif
+
+#ifdef __ELF__
+#define END(X) 5: ; .type NAME(X),@function ; .size NAME(X),5b - NAME(X)
+#define KERNCALL int $0x80
+#else
+#define END(X)
+#define KERNCALL .byte 0x9a; .long 0; .word 7;
+#endif
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl NAME(fork);
+
+NAME(fork):;
+
+ movl $(SYS_fork), %eax;
+ KERNCALL;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+ END(fork)
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+_machdep_sys___syscall:;
+
+ movl $(SYS___syscall), %eax;
+ KERNCALL;
+ jb 3f;
+ ret
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl NAME(sigsuspend);
+
+NAME(sigsuspend):;
+
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend), %eax;
+ KERNCALL;
+ jb 3f;
+ ret
+3:
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+ END(sigsuspend)
+
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl NAME(sigprocmask);
+
+NAME(sigprocmask):;
+
+ movl 8(%esp),%ecx
+ movl (%ecx),%ecx
+ movl %ecx,8(%esp)
+ movl $ SYS_sigprocmask , %eax
+ KERNCALL;
+ jb 4f;
+ ret
+4:
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+ END(sigprocmask)
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .globl NAME(lseek);
+
+NAME(lseek):;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x14(%ebp);
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0;
+ pushl 0x8(%ebp);
+ pushl $0x0;
+ pushl $(SYS_lseek);
+ call _machdep_sys___syscall;
+ leave
+ ret
+ END(lseek)
+
+/* ==========================================================================
+ * machdep_sys_ftruncate() ; Added by Monty
+ */
+ .globl NAME(ftruncate);
+
+NAME(ftruncate):;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0; # Why this?
+ pushl 0x8(%ebp);
+ pushl $0x0; # And this?
+ pushl $(SYS_ftruncate);
+ call _machdep_sys___syscall;
+ leave
+ ret
+ END(ftruncate)
+
+/* ==========================================================================
+ * machdep_sys_setjmp()
+ */
+ .globl NAME(setjmp);
+
+NAME(setjmp):;
+ movl 4(%esp),%eax
+ movl 0(%esp),%edx
+ movl %edx, 0(%eax) /* rta */
+ movl %ebx, 4(%eax)
+ movl %esp, 8(%eax)
+ movl %ebp,12(%eax)
+ movl %esi,16(%eax)
+ movl %edi,20(%eax)
+ xorl %eax,%eax
+ ret
+ END(setjmp)
+
+/* ==========================================================================
+ * machdep_sys_longjmp()
+ */
+ .globl NAME(longjmp);
+
+NAME(longjmp):;
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ movl 0(%edx),%ecx
+ movl 4(%edx),%ebx
+ movl 8(%edx),%esp
+ movl 12(%edx),%ebp
+ movl 16(%edx),%esi
+ movl 20(%edx),%edi
+ testl %eax,%eax
+ jnz 1f
+ incl %eax
+1:
+ movl %ecx,0(%esp)
+ ret
+ END(longjmp)
diff --git a/mit-pthreads/machdep/syscall-i386-linux-1.0.S b/mit-pthreads/machdep/syscall-i386-linux-1.0.S
new file mode 100644
index 00000000000..1399c812e2f
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-linux-1.0.S
@@ -0,0 +1,406 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ *
+ * 1.16 94/01/30 proven
+ * -This file now requires gas version 2.0 or greater.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#include <sys/syscall.h>
+#include <config.h>
+
+#ifdef __ELF__
+
+#define NAME(X) machdep_sys_##X
+#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
+
+#else
+
+#define NAME(X) _machdep_sys_##X
+#define END(X)
+
+#endif
+
+#define SYSCALL0(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ \
+ END(x)
+
+#define SYSCALL1(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ mov 8(%esp), %ebx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ \
+ END(x)
+
+#define SYSCALL2(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ mov 8(%esp), %ebx; \
+ mov 12(%esp), %ecx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ \
+ END(x)
+
+#define STATCALL2(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ mov 8(%esp), %ebx; \
+ mov 12(%esp), %ecx; \
+ lea SYS_prev_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ END(x)
+
+#define SYSCALL3(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ mov 8(%esp), %ebx; \
+ mov 12(%esp), %ecx; \
+ mov 16(%esp), %edx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ END(x)
+
+
+#define SYSCALL4(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ push %esi; \
+ mov 12(%esp), %ebx; \
+ mov 16(%esp), %ecx; \
+ mov 20(%esp), %edx; \
+ mov 24(%esp), %esi; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %esi; \
+ pop %ebx; \
+ ret; \
+ END(x)
+
+#define SYSCALL5(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ push %esi; \
+ push %edi; \
+ mov 16(%esp), %ebx; \
+ mov 20(%esp), %ecx; \
+ mov 24(%esp), %edx; \
+ mov 28(%esp), %esi; \
+ mov 32(%esp), %edi; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %edi; \
+ pop %esi; \
+ pop %ebx; \
+ ret; \
+ END(x)
+
+/* =========================================================================
+ * exit 1 select 82
+ * fork 2 fstatfs 100
+ * read 3 socketcall 102
+ * write 4 flock 143
+ * open 5 readv 145
+ * creat 8 writev 146
+ * link 9
+ * unlink 10
+ * execve 11
+ * chdir 12
+ * chmod 15
+ * chown 16
+ * lseek 19
+ * rename 38
+ * dup 41
+ * pipe 42
+ * ioctl 54
+ * fcntl 55
+ * dup2 63
+ * readdir 89
+ * ftruncate 93
+ * fchmod 94
+ * fchown 95
+ */
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * machdep_sys_read()
+ */
+SYSCALL3(read)
+
+/* ==========================================================================
+ * machdep_sys_write()
+ */
+SYSCALL3(write)
+
+/* ==========================================================================
+ * machdep_sys_open()
+ */
+SYSCALL3(open)
+
+/* ==========================================================================
+ * machdep_sys_close()
+ */
+SYSCALL1(close)
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+SYSCALL2(creat)
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+SYSCALL2(dup2)
+
+/* ==========================================================================
+ * machdep_sys_fcntl()
+ */
+SYSCALL3(fcntl)
+
+/* ==========================================================================
+ * machdep_sys_fchown()
+ */
+SYSCALL3(fchown)
+
+/* ==========================================================================
+ * machdep_sys_fchmod()
+ */
+SYSCALL2(fchmod)
+
+/* ==========================================================================
+ * machdep_sys_ioctl()
+ */
+SYSCALL3(ioctl)
+
+/* ==========================================================================
+ * machdep_sys_chown()
+ */
+SYSCALL3(chown)
+
+/* ==========================================================================
+ * machdep_sys_chmod()
+ */
+SYSCALL2(chmod)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL1(chdir)
+
+/* ==========================================================================
+ * machdep_sys_unlink()
+ */
+SYSCALL1(unlink)
+
+/* ==========================================================================
+ * machdep_sys_link()
+ */
+SYSCALL2(link)
+
+/* ==========================================================================
+ * machdep_sys_rename()
+ */
+SYSCALL2(rename)
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+SYSCALL3(lseek)
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+SYSCALL1(pipe)
+
+/* ==========================================================================
+ * machdep_sys_dup()
+ */
+SYSCALL1(dup)
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+SYSCALL0(fork)
+
+/* ==========================================================================
+ * machdep_sys_execve()
+ */
+SYSCALL3(execve)
+
+/* ==========================================================================
+ * machdep_sys_stat()
+ */
+#ifdef __ELF__
+STATCALL2(stat)
+#else
+SYSCALL2(stat)
+#endif
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+#ifdef __ELF__
+STATCALL2(fstat)
+#else
+SYSCALL2(fstat)
+#endif
+
+/* ==========================================================================
+ * machdep_sys_lstat()
+ */
+#ifdef __ELF__
+STATCALL2(lstat)
+#else
+SYSCALL2(lstat)
+#endif
+
+/* ==========================================================================
+ * machdep_sys_fstatfs()
+ */
+SYSCALL2(fstatfs)
+
+
+/* ==========================================================================
+ * machdep_sys_ftruncate()
+ */
+SYSCALL2(ftruncate)
+
+/* ==========================================================================
+ * Nonstandard calls used to make the system work
+ *
+ * ==========================================================================
+ * machdep_sys_select()
+ */
+
+ .globl NAME(select)
+
+NAME(select):
+
+ push %ebx
+ lea 8(%esp), %ebx
+ lea SYS_select, %eax
+ int $0x80
+ pop %ebx
+ ret
+ END(select)
+
+/* ==========================================================================
+ * machdep_sys_wait4()
+ */
+SYSCALL4(wait4)
+
+/* ==========================================================================
+ * machdep_sys_readdir()
+ */
+SYSCALL3(readdir)
+
+/* ==========================================================================
+ * machdep_sys_socketcall()
+ */
+SYSCALL2(socketcall)
+
+
+SYSCALL1(exit)
+SYSCALL3(sigprocmask)
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+
+ .globl NAME(sigsuspend)
+
+NAME(sigsuspend):
+
+ push %ebp
+ mov %esp,%ebp
+ push %edi
+ push %esi
+ push %ebx
+ mov 8(%ebp), %edx
+ mov (%edx), %edx
+ lea SYS_sigsuspend, %eax
+ int $0x80
+ pop %ebx
+ pop %esi
+ pop %edi
+ mov %ebp,%esp
+ pop %ebp
+ ret
+ END(sigsuspend)
+
+/* ==========================================================================
+ * machdep_sys_readv()
+ */
+#ifdef HAVE_SYSCALL_READV
+SYSCALL3(readv)
+#endif
+
+/* ==========================================================================
+ * machdep_sys_writev()
+ */
+#ifdef HAVE_SYSCALL_WRITEV
+SYSCALL3(writev)
+#endif
+
+/* ==========================================================================
+ * machdep_sys_flock()
+ */
+#ifdef HAVE_SYSCALL_FLOCK
+SYSCALL2(flock)
+#endif
diff --git a/mit-pthreads/machdep/syscall-i386-linux-2.0.S b/mit-pthreads/machdep/syscall-i386-linux-2.0.S
new file mode 100644
index 00000000000..d5807b2d9b4
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-linux-2.0.S
@@ -0,0 +1,389 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ *
+ * 1.16 94/01/30 proven
+ * -This file now requires gas version 2.0 or greater.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#include <sys/syscall.h>
+#include <config.h>
+
+#ifdef __ELF__
+
+#define NAME(X) machdep_sys_##X
+#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
+
+#else
+
+#define NAME(X) _machdep_sys_##X
+#define END(X)
+
+#endif
+
+#define SYSCALL0(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ \
+ END(x)
+
+#define SYSCALL1(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ mov 8(%esp), %ebx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ \
+ END(x)
+
+#define SYSCALL2(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ mov 8(%esp), %ebx; \
+ mov 12(%esp), %ecx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ \
+ END(x)
+
+#define SYSCALL3(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ mov 8(%esp), %ebx; \
+ mov 12(%esp), %ecx; \
+ mov 16(%esp), %edx; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %ebx; \
+ ret; \
+ END(x)
+
+
+#define SYSCALL4(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ push %esi; \
+ mov 12(%esp), %ebx; \
+ mov 16(%esp), %ecx; \
+ mov 20(%esp), %edx; \
+ mov 24(%esp), %esi; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %esi; \
+ pop %ebx; \
+ ret; \
+ END(x)
+
+#define SYSCALL5(x) \
+ .globl NAME(x) ; \
+ \
+NAME(x): \
+ \
+ push %ebx; \
+ push %esi; \
+ push %edi; \
+ mov 16(%esp), %ebx; \
+ mov 20(%esp), %ecx; \
+ mov 24(%esp), %edx; \
+ mov 28(%esp), %esi; \
+ mov 32(%esp), %edi; \
+ lea SYS_##x, %eax; \
+ int $0x80; \
+ pop %edi; \
+ pop %esi; \
+ pop %ebx; \
+ ret; \
+ END(x)
+
+/* =========================================================================
+ * exit 1 select 82
+ * fork 2 fstatfs 100
+ * read 3 socketcall 102
+ * write 4 flock 143
+ * open 5 readv 145
+ * creat 8 writev 146
+ * link 9
+ * unlink 10
+ * execve 11
+ * chdir 12
+ * chmod 15
+ * chown 16
+ * lseek 19
+ * rename 38
+ * dup 41
+ * pipe 42
+ * ioctl 54
+ * fcntl 55
+ * dup2 63
+ * readdir 89
+ * ftruncate 93
+ * fchmod 94
+ * fchown 95
+ */
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * machdep_sys_read()
+ */
+SYSCALL3(read)
+
+/* ==========================================================================
+ * machdep_sys_write()
+ */
+SYSCALL3(write)
+
+/* ==========================================================================
+ * machdep_sys_open()
+ */
+SYSCALL3(open)
+
+/* ==========================================================================
+ * machdep_sys_close()
+ */
+SYSCALL1(close)
+
+/* ==========================================================================
+ * machdep_sys_creat()
+ */
+SYSCALL2(creat)
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+SYSCALL2(dup2)
+
+/* ==========================================================================
+ * machdep_sys_fcntl()
+ */
+SYSCALL3(fcntl)
+
+/* ==========================================================================
+ * machdep_sys_fchown()
+ */
+SYSCALL3(fchown)
+
+/* ==========================================================================
+ * machdep_sys_fchmod()
+ */
+SYSCALL2(fchmod)
+
+/* ==========================================================================
+ * machdep_sys_ioctl()
+ */
+SYSCALL3(ioctl)
+
+/* ==========================================================================
+ * machdep_sys_chown()
+ */
+SYSCALL3(chown)
+
+/* ==========================================================================
+ * machdep_sys_chmod()
+ */
+SYSCALL2(chmod)
+
+/* ==========================================================================
+ * machdep_sys_chdir()
+ */
+SYSCALL1(chdir)
+
+/* ==========================================================================
+ * machdep_sys_unlink()
+ */
+SYSCALL1(unlink)
+
+/* ==========================================================================
+ * machdep_sys_link()
+ */
+SYSCALL2(link)
+
+/* ==========================================================================
+ * machdep_sys_rename()
+ */
+SYSCALL2(rename)
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+SYSCALL3(lseek)
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+SYSCALL1(pipe)
+
+/* ==========================================================================
+ * machdep_sys_dup()
+ */
+SYSCALL1(dup)
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+SYSCALL0(fork)
+
+/* ==========================================================================
+ * machdep_sys_execve()
+ */
+SYSCALL3(execve)
+
+/* ==========================================================================
+ * machdep_sys_stat()
+ */
+SYSCALL2(stat)
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+SYSCALL2(fstat)
+
+/* ==========================================================================
+ * machdep_sys_lstat()
+ */
+SYSCALL2(lstat)
+
+/* ==========================================================================
+ * machdep_sys_fstatfs()
+ */
+SYSCALL2(fstatfs)
+
+/* ==========================================================================
+ * machdep_sys_ftruncate()
+ */
+SYSCALL2(ftruncate)
+
+/* ==========================================================================
+ * machdep_sys_chroot()
+ */
+SYSCALL1(chroot)
+
+/* ==========================================================================
+ * machdep_sys_uname()
+ */
+SYSCALL1(uname)
+
+/* ==========================================================================
+ * Nonstandard calls used to make the system work
+ *
+ * ==========================================================================
+ * machdep_sys_select()
+ */
+
+ .globl NAME(select)
+
+NAME(select):
+
+ push %ebx
+ lea 8(%esp), %ebx
+ lea SYS_select, %eax
+ int $0x80
+ pop %ebx
+ ret
+ END(select)
+
+/* ==========================================================================
+ * machdep_sys_wait4()
+ */
+SYSCALL4(wait4)
+
+/* ==========================================================================
+ * machdep_sys_readdir()
+ */
+SYSCALL3(readdir)
+
+/* ==========================================================================
+ * machdep_sys_socketcall()
+ */
+SYSCALL2(socketcall)
+
+
+SYSCALL1(exit)
+SYSCALL3(sigprocmask)
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+
+ .globl NAME(sigsuspend)
+
+NAME(sigsuspend):
+
+ push %ebp
+ mov %esp,%ebp
+ push %edi
+ push %esi
+ push %ebx
+ mov 8(%ebp), %edx
+ mov (%edx), %edx
+ lea SYS_sigsuspend, %eax
+ int $0x80
+ pop %ebx
+ pop %esi
+ pop %edi
+ mov %ebp,%esp
+ pop %ebp
+ ret
+ END(sigsuspend)
+
+/* ==========================================================================
+ * machdep_sys_readv()
+ */
+#ifdef HAVE_SYSCALL_READV
+SYSCALL3(readv)
+#endif
+
+/* ==========================================================================
+ * machdep_sys_writev()
+ */
+#ifdef HAVE_SYSCALL_WRITEV
+SYSCALL3(writev)
+#endif
+
+/* ==========================================================================
+ * machdep_sys_flock()
+ */
+#ifdef HAVE_SYSCALL_FLOCK
+SYSCALL2(flock)
+#endif
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-0.9.S b/mit-pthreads/machdep/syscall-i386-netbsd-0.9.S
new file mode 100644
index 00000000000..8d768a673d3
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-netbsd-0.9.S
@@ -0,0 +1,229 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+_machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_write()
+ */
+SYSCALL(write)
+
+/* ==========================================================================
+ * machdep_sys_read()
+ */
+SYSCALL(read)
+
+/* ==========================================================================
+ * machdep_sys_open()
+ */
+SYSCALL(open)
+
+/* ==========================================================================
+ * machdep_sys_close()
+ */
+SYSCALL(close)
+
+/* ==========================================================================
+ * machdep_sys_fcntl()
+ */
+SYSCALL(fcntl)
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+SYSCALL(lseek)
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+SYSCALL(pipe)
+
+/* ==========================================================================
+ * machdep_sys_dup()
+ */
+SYSCALL(dup)
+
+/* ==========================================================================
+ * machdep_sys_dup2()
+ */
+SYSCALL(dup2)
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys_execve()
+ */
+SYSCALL(execve)
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+SYSCALL(fstat)
+
+/* ==========================================================================
+ * Nonstandard calls used to make the system work
+ *
+ * ==========================================================================
+ * machdep_sys_select()
+ */
+SYSCALL(select)
+
+/* ==========================================================================
+ * machdep_sys_getdirentries()
+ */
+SYSCALL(getdirentries)
+
+/* ==========================================================================
+ * Berkeley socket stuff
+ *
+ * ==========================================================================
+ * machdep_sys_socket()
+ */
+SYSCALL(socket)
+
+/* ==========================================================================
+ * machdep_sys_bind()
+ */
+SYSCALL(bind)
+
+/* ==========================================================================
+ * machdep_sys_connect()
+ */
+SYSCALL(connect)
+
+/* ==========================================================================
+ * machdep_sys_accept()
+ */
+SYSCALL(accept)
+
+/* ==========================================================================
+ * machdep_sys_listen()
+ */
+SYSCALL(listen)
+
+/* ==========================================================================
+ * machdep_sys_getsockopt()
+ */
+SYSCALL(getsockopt)
+
+/* ==========================================================================
+ * machdep_sys_readv()
+ */
+SYSCALL(readv)
+
+/* ==========================================================================
+ * machdep_sys_writev()
+ */
+SYSCALL(writev)
+
+/* ==========================================================================
+ * machdep_sys_getpeername()
+ */
+SYSCALL(getpeername)
+
+/* ==========================================================================
+ * machdep_sys_getsockname()
+ */
+SYSCALL(getsockname)
+
+/* ==========================================================================
+ * machdep_sys_sendto()
+ */
+SYSCALL(sendto)
+
+/* ==========================================================================
+ * machdep_sys_recvfrom()
+ */
+SYSCALL(recvfrom)
+
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-1.0.S b/mit-pthreads/machdep/syscall-i386-netbsd-1.0.S
new file mode 100644
index 00000000000..da535dd2f80
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-netbsd-1.0.S
@@ -0,0 +1,158 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+_machdep_sys___syscall:;
+
+ movl $(SYS___syscall), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ jb 3f;
+ ret
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _machdep_sys_sigsuspend;
+
+_machdep_sys_sigsuspend:;
+
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ jb 3f;
+ ret
+
+3:
+
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .globl _machdep_sys_lseek;
+
+_machdep_sys_lseek:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x14(%ebp);
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0;
+ pushl 0x8(%ebp);
+ pushl $0x0;
+ pushl $(SYS_lseek);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+/* ==========================================================================
+ * machdep_sys_ftruncate() ; Added by Monty
+ */
+ .globl _machdep_sys_ftruncate;
+
+_machdep_sys_ftruncate:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0; # Why this?
+ pushl 0x8(%ebp);
+ pushl $0x0; # And this?
+ pushl $(SYS_ftruncate);
+ call _machdep_sys___syscall;
+ leave
+ ret
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-1.1.S b/mit-pthreads/machdep/syscall-i386-netbsd-1.1.S
new file mode 100644
index 00000000000..a74d2ac1af6
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-netbsd-1.1.S
@@ -0,0 +1,181 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+_machdep_sys___syscall:;
+
+ movl $(SYS___syscall), %eax;
+ int $0x80;
+ jb 3f;
+ ret
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _machdep_sys_sigsuspend;
+
+_machdep_sys_sigsuspend:;
+
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend), %eax;
+ int $0x80;
+ jb 3f;
+ ret
+
+3:
+
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .globl _machdep_sys_lseek;
+
+_machdep_sys_lseek:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x14(%ebp);
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0;
+ pushl 0x8(%ebp);
+ pushl $0x0;
+ pushl $(SYS_lseek);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+/* ==========================================================================
+ * machdep_sys_ftruncate() ; Added by Monty
+ */
+ .globl _machdep_sys_ftruncate;
+
+_machdep_sys_ftruncate:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0; # Why this?
+ pushl 0x8(%ebp);
+ pushl $0x0; # And this?
+ pushl $(SYS_ftruncate);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl _machdep_sys_sigprocmask;
+
+_machdep_sys_sigprocmask:;
+
+ movl 8(%esp),%ecx
+ movl (%ecx),%ecx
+ movl %ecx,8(%esp)
+ movl $(SYS_sigprocmask), %eax;
+ int $0x80;
+ jb 3b;
+ ret
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _machdep_sys_pipe;
+
+_machdep_sys_pipe:;
+
+ movl $(SYS_pipe), %eax;
+ int $0x80;
+ jb 3b;
+ movl 4(%esp),%ecx
+ movl %eax,(%ecx)
+ movl %edx,4(%ecx)
+ xorl %eax,%eax
+ ret
+
diff --git a/mit-pthreads/machdep/syscall-i386-netbsd-1.3.S b/mit-pthreads/machdep/syscall-i386-netbsd-1.3.S
new file mode 100644
index 00000000000..85dc6b3e5bc
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-netbsd-1.3.S
@@ -0,0 +1,200 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1993 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ * 1.00 93/08/26 proven
+ * -Started coding this file.
+ *
+ * 1.01 93/11/13 proven
+ * -The functions readv() and writev() added.
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _C_LABEL(machdep_sys_fork);
+
+_C_LABEL(machdep_sys_fork):;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+_machdep_sys___syscall:;
+
+ movl $(SYS___syscall), %eax;
+ int $0x80;
+ jb 3f;
+ ret
+
+#ifndef SYS___sigsuspend14
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _C_LABEL(machdep_sys_sigsuspend);
+
+_C_LABEL(machdep_sys_sigsuspend):;
+
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend), %eax;
+ int $0x80;
+ jb 3f;
+ ret
+#endif
+
+3:
+
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .globl _C_LABEL(machdep_sys_lseek);
+
+_C_LABEL(machdep_sys_lseek):;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x14(%ebp);
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0;
+ pushl 0x8(%ebp);
+ pushl $0x0;
+ pushl $(SYS_lseek);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+/* ==========================================================================
+ * machdep_sys_ftruncate() ; Added by Monty
+ */
+ .globl _C_LABEL(machdep_sys_ftruncate);
+
+_C_LABEL(machdep_sys_ftruncate):;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0; # Why this?
+ pushl 0x8(%ebp);
+ pushl $0x0; # And this?
+ pushl $(SYS_ftruncate);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+#ifndef SYS___sigprocmask14
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl _C_LABEL(machdep_sys_sigprocmask);
+
+_C_LABEL(machdep_sys_sigprocmask):;
+
+ movl 8(%esp),%ecx
+ movl (%ecx),%ecx
+ movl %ecx,8(%esp)
+ movl $(SYS_sigprocmask), %eax;
+ int $0x80;
+ jb 3b;
+ ret
+#endif
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _C_LABEL(machdep_sys_pipe);
+
+_C_LABEL(machdep_sys_pipe):;
+
+ movl $(SYS_pipe), %eax;
+ int $0x80;
+ jb 3b;
+ movl 4(%esp),%ecx
+ movl %eax,(%ecx)
+ movl %edx,4(%ecx)
+ xorl %eax,%eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+ .globl _C_LABEL(machdep_sys_fstat);
+
+_C_LABEL(machdep_sys_fstat):;
+ movl $(SYS___fstat13), %eax;
+ int $0x80;
+ jb 4f;
+ ret
+4:
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
diff --git a/mit-pthreads/machdep/syscall-i386-openbsd-2.0.S b/mit-pthreads/machdep/syscall-i386-openbsd-2.0.S
new file mode 100644
index 00000000000..cfdbbc77f73
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-openbsd-2.0.S
@@ -0,0 +1,237 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1995 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "syscall-i386-freebsd-2.0.S,v 1.2 1995/05/26 07:44:29 proven Exp";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x##; \
+ \
+_machdep_sys_##x##:; \
+ \
+ movl $(SYS_##x##), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#else
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+_machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ movl $(SYS_fork), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ cmpl $0, %edx
+ je 2f
+ movl $0, %eax
+2:
+ ret;
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+
+_machdep_sys___syscall:;
+
+ movl $(SYS___syscall), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ jb 3f;
+ ret
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _machdep_sys_sigsuspend;
+
+_machdep_sys_sigsuspend:;
+
+ movl 4(%esp),%eax # fetch mask arg
+ movl (%eax),%eax # indirect to mask arg
+ movl %eax,4(%esp)
+ movl $(SYS_sigsuspend), %eax;
+ .byte 0x9a; .long 0; .word 7;
+ jb 3f;
+ ret
+
+3:
+
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl _machdep_sys_sigprocmask;
+
+_machdep_sys_sigprocmask:;
+
+ movl 8(%esp),%ecx
+ movl (%ecx),%ecx
+ movl %ecx,8(%esp)
+ movl $ SYS_sigprocmask , %eax
+ .byte 0x9a; .long 0; .word 7;
+ jb 4f;
+ ret
+
+4:
+ neg %eax
+ movl $0xffffffff,%edx
+ ret
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .globl _machdep_sys_lseek;
+
+_machdep_sys_lseek:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x14(%ebp);
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0;
+ pushl 0x8(%ebp);
+ pushl $0x0;
+ pushl $(SYS_lseek);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+/* ==========================================================================
+ * machdep_sys_ftruncate() ; Added by Monty
+ */
+ .globl _machdep_sys_ftruncate;
+
+_machdep_sys_ftruncate:;
+
+ pushl %ebp;
+ movl %esp,%ebp;
+ pushl 0x10(%ebp);
+ pushl 0xc(%ebp);
+ pushl $0x0; # Why this?
+ pushl 0x8(%ebp);
+ pushl $0x0; # And this?
+ pushl $(SYS_ftruncate);
+ call _machdep_sys___syscall;
+ leave
+ ret
+
+/* ==========================================================================
+ * machdep_sys_setjmp()
+ */
+ .globl _machdep_sys_setjmp;
+
+_machdep_sys_setjmp:;
+ movl 4(%esp),%eax
+ movl 0(%esp),%edx
+ movl %edx, 0(%eax) /* rta */
+ movl %ebx, 4(%eax)
+ movl %esp, 8(%eax)
+ movl %ebp,12(%eax)
+ movl %esi,16(%eax)
+ movl %edi,20(%eax)
+ xorl %eax,%eax
+ ret
+
+/* ==========================================================================
+ * machdep_sys_longjmp()
+ */
+ .globl _machdep_sys_longjmp;
+
+_machdep_sys_longjmp:;
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ movl 0(%edx),%ecx
+ movl 4(%edx),%ebx
+ movl 8(%edx),%esp
+ movl 12(%edx),%ebp
+ movl 16(%edx),%esi
+ movl 20(%edx),%edi
+ testl %eax,%eax
+ jnz 1f
+ incl %eax
+1: movl %ecx,0(%esp)
+ ret
+
diff --git a/mit-pthreads/machdep/syscall-i386-sco-3.2v5.S b/mit-pthreads/machdep/syscall-i386-sco-3.2v5.S
new file mode 100644
index 00000000000..0a60dcdd866
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-i386-sco-3.2v5.S
@@ -0,0 +1,442 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1990 The Regents of the University of California.
+ * Copyright (c) 1995 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ *
+ * Description : Machine dependent syscalls for i386/i486/i586
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "syscall-i386-sco-3.2v5.S,v 1.2 1995/05/26 07:44:29 proven Exp";
+#endif
+
+#if defined(SYSLIBC_SCCS) && !defined(lint)
+ .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90"
+#endif /* SYSLIBC_SCCS and not lint */
+
+#include <sys/errno.h>
+#include <sys/syscall.h>
+
+#ifdef _SCO_ELF
+
+#define NAME(X) machdep_sys_##X
+#define GETADDR(X) \
+ call 1f; \
+1: \
+ popl %ebx; \
+ addl $NAME(X)+[.-1b], %ebx
+
+#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
+
+#else
+
+#define NAME(X) _machdep_sys_##X
+#define END(X)
+
+#endif
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl NAME(x); \
+ \
+NAME(x): \
+ movl $(SYS_##x##), %eax; \
+ lcall $7, $0; \
+ jae 1f; \
+ cmp $(ERESTART), %eax; \
+ je NAME(x); \
+ neg %eax; \
+1: \
+ ret; \
+\
+ END(x)
+
+
+#else
+
+#define SYSCALL(x) \
+ .globl NAME(x); \
+ \
+NAME(x): \
+ \
+ movl $(SYS_/**/x), %eax; \
+ lcall $7, $0; \
+ jb 1b; \
+ ret; \
+ END(x)
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl NAME(fork);
+
+NAME(fork):;
+ movl $(SYS_fork), %eax
+ lcall $7, $0
+ jae 1f
+ neg %eax
+ ret
+1:
+ test %edx, %edx
+ je 2f
+ xor %eax, %eax
+2:
+ ret;
+ END(fork)
+
+/* ==========================================================================
+ * NAME(getdents)
+ */
+ .globl NAME(getdents);
+
+NAME(getdents):
+ movl $(SYS_getdents), %eax;
+ lcall $7, $0
+ jae 1f
+ neg %eax
+1:
+ ret;
+ END(getdents)
+
+/* ==========================================================================
+ * NAME(fxstat)
+ */
+ .globl NAME(fxstat);
+
+NAME(fxstat):;
+ movl $(SYS_fxstat), %eax;
+ lcall $7, $0
+ jae 1f
+ neg %eax;
+ ret;
+1:
+ xor %eax, %eax;
+ ret;
+ END(fxstat)
+
+/* ==========================================================================
+ * NAME(signal)
+ */
+ .globl NAME(signal);
+
+NAME(signal):;
+ movl 4(%esp), %ecx
+ movl $(SYS_signal),%eax
+#if 0
+ call .L1
+.L1:
+ popl %edx
+ addl $(NAME(sigreturn)+[.-.L1]), %edx
+#else
+ movl $NAME(sigreturn), %edx
+#endif
+ lcall $7,$0
+ jae 1f
+# movl %eax, 12(%esp)
+ neg %eax
+ ret
+1:
+# xor %eax, %eax
+# movl %eax, 12(%esp)
+ ret
+ END(signal)
+
+/* ==========================================================================
+ * NAME(sigaction)
+ */
+ .globl NAME(sigaction);
+
+NAME(sigaction):
+ movl $(SYS_sigaction),%eax
+#if 0
+ call .L2
+.L2:
+ popl %edx
+ addl $(NAME(sigreturn)+[.-.L2]), %edx
+#else
+ movl $NAME(sigreturn), %edx
+#endif
+ lcall $7, $0
+ jb 1f
+ xor %eax, %eax
+ ret
+1:
+ neg %eax
+ ret
+ END(sigaction)
+
+ .globl NAME(sigreturn)
+NAME(sigreturn):
+ addl $4,%esp
+ lcall $0xf, $0
+ nop
+ nop
+ END(sigreturn)
+
+/* ==========================================================================
+ * NAME(waitpid)
+ */
+ .globl NAME(waitpid);
+
+NAME(waitpid):
+ .byte 0x9c
+ popl %eax
+ orl $0x8c4, %eax
+ pushl %eax
+ .byte 0x9d
+ movl $(SYS_wait), %eax
+ lcall $7, $0
+ jae 2f
+ cmpl $(ERESTART), %al
+ je NAME(waitpid)
+ neg %eax
+3:
+ ret
+2:
+ movl 8(%esp), %ecx
+ test %ecx,%ecx
+ je 3b
+ mov %edx, (%ecx)
+ ret
+ END(waitpid)
+
+/* ==========================================================================
+ * NAME(uname)
+ */
+ .globl NAME(uname);
+
+NAME(uname):
+ pushl $0
+ pushl $0
+ pushl 12(%esp)
+ subl $4, %esp
+ movl $(SYS_utssys), %eax
+ .byte 0x9a; .long 0; .word 7;
+ jb 1f
+ addl $16, %esp
+ ret
+1:
+ addl $16, %esp
+ neg %eax
+ ret
+ END(uname)
+
+
+/* ==========================================================================
+ * machdep_sys_ftruncate
+ */
+
+SYSCALL(ftruncate)
+
+/* ==========================================================================
+ * machdep_sys_ftime
+ */
+
+SYSCALL(ftime)
+
+/* ==========================================================================
+ * machdep_sys_gettimeofday()
+ */
+
+SYSCALL(gettimeofday)
+
+/* ==========================================================================
+ * machdep_sys_kill()
+ */
+
+SYSCALL(kill)
+
+/* ==========================================================================
+ * pthread_sys_setitimer
+ */
+ .globl NAME(setitimer);
+
+NAME(setitimer):;
+ movl $(SYS_setitimer), %eax;
+ lcall $7, $0
+ jae 1f
+ neg %eax
+ ret
+1:
+ xor %eax, %eax
+ ret;
+ END(setitimer)
+
+/* ==========================================================================
+ * pthread_sys_sysconf
+ */
+ .globl NAME(sysconf);
+
+NAME(sysconf):;
+ movl $(SYS_sysconf), %eax;
+ lcall $7, $0
+ jae 1f
+ neg %eax
+1:
+ ret;
+ END(sysconf)
+
+/* ==========================================================================
+ * pthread_sys_sysi86()
+ */
+ .globl NAME(sysi86);
+
+NAME(sysi86):;
+ movl $(SYS_sysi86), %eax
+ lcall $7, $0
+ jae 1f
+ neg %eax
+1:
+ ret;
+ END(sysi86)
+
+
+/* ==========================================================================
+ * machdep_sys_brk()
+ */
+ .globl NAME(brk);
+
+NAME(brk):;
+ movl $(SYS_break), %eax
+ lcall $7, $0
+ jae 1f
+ neg %eax
+ ret
+1:
+ xor %eax, %eax
+ ret;
+ END(brk)
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl NAME(pipe);
+
+NAME(pipe):;
+ movl $(SYS_pipe), %eax;
+ lcall $7, $0
+ jae 1f
+ neg %eax
+ ret
+1:
+ movl 4(%esp), %ecx
+ movl %eax, (%ecx)
+ movl %edx, 4(%ecx)
+ xor %eax, %eax
+ ret;
+ END(brk)
+
+/* ==========================================================================
+ * machdep_sys_fcntl()
+ */
+ .globl NAME(fcntl);
+
+NAME(fcntl):;
+ movl $(SYS_fcntl), %eax
+ lcall $7, $0
+ jae 1f
+ neg %eax
+1:
+ ret
+ END(fcntl)
+
+
+/* ==========================================================================
+ * machdep_sys_select()
+ */
+ .globl NAME(select);
+
+NAME(select):;
+ movl $(SYS_select), %eax
+ lcall $7, $0
+ jae 1f
+ cmp $(ERESTART), %eax
+ jne 2f
+ movl $(EINTR), %eax
+2:
+ neg %eax
+1:
+ ret
+ END(select)
+
+
+/* ==========================================================================
+ * setjmp()
+ */
+ .globl setjmp;
+
+setjmp:
+ movl 4(%esp),%eax
+ movl %ebx,(%eax)
+ movl %esi,4(%eax)
+ movl %edi,8(%eax)
+ movl %ebp,12(%eax)
+ popl %edx
+ movl %esp,16(%eax)
+ movl %edx,20(%eax)
+ subl %eax,%eax
+ jmp *%edx
+1: ; .type setjmp,@function ; .size setjmp,1b - setjmp
+
+/* ==========================================================================
+ * longjmp()
+ */
+ .globl longjmp;
+
+longjmp:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ movl 0(%edx),%ebx
+ movl 4(%edx),%esi
+ movl 8(%edx),%edi
+ movl 12(%edx),%ebp
+ movl 16(%edx),%esp
+ test %eax,%eax
+ jne 1f
+ inc %eax
+1:
+ jmp *20(%edx)
+1: ; .type longjmp,@function ; .size longjmp,1b - longjmp
diff --git a/mit-pthreads/machdep/syscall-ip22-irix-5.2.S b/mit-pthreads/machdep/syscall-ip22-irix-5.2.S
new file mode 100644
index 00000000000..ded0fc55e38
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-ip22-irix-5.2.S
@@ -0,0 +1,106 @@
+#include <sys.s>
+#include <sys/regdef.h>
+
+/*
+ Kernel syscall interface:
+ Input:
+ v0 syscall number
+ Output:
+
+ This macro is similar to SYSCALL in sys/syscall.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ Compile with -DPIC for pic code.
+*/
+
+#ifdef PIC
+#define PICOPT .option pic2
+#else
+#define PICOPT
+#endif
+
+
+#define YSYSCALL(x) \
+ PICOPT; \
+ .globl machdep_sys_##x; \
+ .ent machdep_sys_##x, 0; \
+machdep_sys_##x:; \
+ .frame sp,0,ra; \
+ .set noreorder; \
+ li v0, SYS_##x; \
+ syscall; \
+ bne a3, zero, 1b; \
+ nop; \
+ j ra; \
+ nop; \
+ .end machdep_sys_##x
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ subu v0,zero,v0;
+ j ra;
+
+/* ==========================================================================
+ * lstat
+ */
+ PICOPT;
+ .globl machdep_sys_lstat;
+ .ent machdep_sys_lstat, 0;
+machdep_sys_lstat:;
+ .frame sp,0,ra;
+ .set noreorder;
+ move a2, a1
+ move a1, a0
+ li a0, 2
+ li v0, SYS_lxstat;
+ syscall;
+ bne a3, zero, 1b;
+ nop;
+ j ra;
+ nop;
+ .end machdep_sys_lstat
+
+/* ==========================================================================
+ * fstat
+ */
+ PICOPT;
+ .globl machdep_sys_fstat;
+ .ent machdep_sys_fstat, 0;
+machdep_sys_fstat:;
+ .frame sp,0,ra;
+ .set noreorder;
+ move a2, a1
+ move a1, a0
+ li a0, 2
+ li v0, SYS_fxstat;
+ syscall;
+ bne a3, zero, 1b;
+ nop;
+ j ra;
+ nop;
+ .end machdep_sys_fstat
+
+/* ==========================================================================
+ * stat
+ */
+ PICOPT;
+ .globl machdep_sys_stat;
+ .ent machdep_sys_stat, 0;
+machdep_sys_stat:;
+ .frame sp,0,ra;
+ .set noreorder;
+ move a2, a1
+ move a1, a0
+ li a0, 2
+ li v0, SYS_xstat;
+ syscall;
+ bne a3, zero, 1b;
+ nop;
+ j ra;
+ nop;
+ .end machdep_sys_stat
diff --git a/mit-pthreads/machdep/syscall-m68000-netbsd.S b/mit-pthreads/machdep/syscall-m68000-netbsd.S
new file mode 100644
index 00000000000..f36286770a2
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-m68000-netbsd.S
@@ -0,0 +1,83 @@
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+#define IMM #
+#define SYSCALL(x) .even; ENTRY(machdep_sys_ ## x); \
+ movl IMM SYS_ ## x,d0; trap IMM 0; jcs err; rts
+#else /* !__STDC__ */
+#define SYSCALL(x) .even; ENTRY(machdep_sys_/**/x); \
+ movl #SYS_/**/x,d0; trap #0; jcs err; rts
+#endif /* !__STDC__ */
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .even
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+err:
+ negl d0
+ rts
+
+/* ==========================================================================
+ * machdep_sys_pipe
+ */
+ .even
+ENTRY(machdep_sys_pipe);
+ movl #SYS_pipe,d0
+ trap #0
+ jcs err
+ movl sp@(4),a0
+ movl d0,a0@+
+ movl d1,a0@
+ clrl d0
+ rts
+
+#ifndef SYS___sigsuspend14
+ .even
+ENTRY(machdep_sys_sigsuspend)
+ movl sp@(4),a0
+ movl a0@,sp@(4)
+ movl #SYS_compat_13_sigsuspend13,d0
+ trap #0
+ jcs err
+ clrl d0
+ rts
+#endif
+
+#ifndef SYS___sigprocmask14
+ .even
+ENTRY(machdep_sys_sigprocmask)
+ tstl sp@(8)
+ jne gotptr
+/* movl #0,sp@(8) /* null mask pointer; block empty set */
+ movl #1,sp@(4)
+ jra doit
+gotptr:
+ movl sp@(8),a0
+ movl a0@,sp@(8)
+doit:
+ movl #SYS_compat_13_sigprocmask13,d0
+ trap #0
+ jcs err
+ tstl sp@(12)
+ jeq out
+ movl sp@(12),a0
+ movl d0,a0@
+out:
+ clrl d0
+ rts
+#endif
diff --git a/mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S b/mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S
new file mode 100644
index 00000000000..dc891dc37bd
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-r2000-ultrix-4.2.S
@@ -0,0 +1,166 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent syscalls for decstation with r2000/r3000
+ *
+ * 1.00 93/08/14 proven
+ * -Started coding this file.
+ */
+
+ .text
+ .ascii "$Id$";
+
+#include <syscall.h>
+#include <machine/regdef.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value. Eventually I want to load the errno value directly
+ * into pthread_run->error but until then ...
+ */
+machdep_error:
+ negu v0, v0 /* Return negative of errno value. */
+ j ra
+
+/* ==========================================================================
+ * Syscalls already done,
+ * Standard Other important BSD sockets
+ * fork = 2 select = 93 socket = 97
+ * read = 3 readv = 120 connect = 98
+ * write = 4 writev = 121 accept = 99
+ * open = 5 getdirentries = send = 101
+ * close = 6 recv = 102
+ * creat = 8 bind = 104
+ * link = 9 listen = 106
+ * unlink = 10 recvmsg = 113
+ * chdir = 12 sendmsg = 114
+ * chmod = 15 getsockopt = 118
+ * chown = 16 recvfrom = 125
+ * lseek = 19 sendto = 133
+ * stat = 38 shutdown = 134
+ * dup = 41 getpeername = 141
+ * pipe = 42
+ * execve = 59
+ * fstat = 62
+ * wait3 = 84
+ * dup2 = 90
+ * fcntl = 92
+ * fchown = 123
+ * fchmod = 124
+ * rename = 128
+ * waitpid = 189
+ * ======================================================================= */
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl machdep_sys_fork
+ .ent machdep_sys_fork
+
+machdep_sys_fork:
+
+ .frame sp,0,ra /* No frame, return address in ra */
+
+ li v0,SYS_fork /* Load fork syscall # into v0 */
+ syscall
+ bne a3,zero,machdep_error /* Error if a3 != 0 */
+ beqz v1,__fork_parent /* Second return value = 0, if parent */
+ li v0,0
+__fork_parent:
+ j ra
+
+ .end machdep_sys_fork
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl machdep_sys_pipe
+ .ent machdep_sys_pipe
+
+machdep_sys_pipe:
+
+ .frame sp,0,ra /* No frame, return address in ra */
+
+ li v0,SYS_pipe /* Load pipe syscall # into v0 */
+ syscall
+ bne a3,zero,machdep_error /* Error if a3 != 0 */
+ sw v0, 0(a0)
+ sw v1, 4(a0)
+ li v0, 0
+ j ra
+
+ .end machdep_sys_pipe
+
+/* ==========================================================================
+ * Other important asm routines.
+ * ======================================================================= */
+/* ==========================================================================
+ * fake_setjmp()
+ */
+ .globl fake_setjmp
+ .ent fake_setjmp
+
+fake_setjmp:
+
+ .frame sp,0,ra /* No frame, return address in ra */
+
+ /* Save all the important registers */
+ sw ra,8(a0)
+ sw gp,124(a0)
+ sw sp,128(a0)
+ sw s0,76(a0)
+ /* More registers needed. */
+ j ra
+
+ .end fake_longjmp
+
+/* ==========================================================================
+ * machdep_sys_longjmp()
+ */
+ .globl machdep_sys_longjmp
+ .ent machdep_sys_longjmp
+
+machdep_sys_longjmp:
+
+ .frame sp,0,ra /* No frame, return address in ra */
+ li a1,1 /* Load 1 into reg a1 */
+ sw a1, 20(a0); /* Load a1 into address a0 + 20 */
+ li v0,SYS_sigreturn /* Load sigreturn syscall # into v0 */
+ syscall /* Do syscall to do longjmp */
+ j ra
+
+ .end machdep_sys_longjmp
diff --git a/mit-pthreads/machdep/syscall-romp-bsd.S b/mit-pthreads/machdep/syscall-romp-bsd.S
new file mode 100644
index 00000000000..233f0b9430b
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-romp-bsd.S
@@ -0,0 +1,327 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1993 by John F. Carr, jfc@mit.edu
+ *
+ * 1.00 93/09/xx proven
+ * -Started coding this file.
+ */
+
+#ifndef lint
+static const char rcsid[] = "$Id$";
+#endif
+
+/* DO NOT USE COLONS IN THIS FILE, GCC CAN'T HANDLE THEM */
+/* #include <copyright.h> */
+
+ .globl .oVncs
+ .text
+ .align 2
+
+/* ==========================================================================
+ * machdep_sys_write()
+ */
+ .globl _machdep_sys_write
+ .globl _.machdep_sys_write
+
+ .text 2
+_machdep_sys_write:
+ .long _.machdep_sys_write
+
+ .text
+_.machdep_sys_write:
+ lcs r0,0(r3)
+ svc 4(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+
+/* ==========================================================================
+ * machdep_sys_read()
+ */
+ .globl _machdep_sys_read
+ .globl _.machdep_sys_read
+
+ .text 2
+_machdep_sys_read:
+ .long _.machdep_sys_read
+
+ .text
+_.machdep_sys_read:
+ lcs r0,0(r3)
+ svc 3(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+
+/* ==========================================================================
+ * machdep_sys_open()
+ */
+ .globl _machdep_sys_open
+ .globl _.machdep_sys_open
+
+ .text 2
+_machdep_sys_open:
+ .long _.machdep_sys_open
+
+ .text
+_.machdep_sys_open:
+ lcs r0,0(r2)
+ svc 5(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+
+/* ==========================================================================
+ * machdep_sys_bind()
+ */
+ .globl _machdep_sys_bind
+ .globl _.machdep_sys_bind
+
+ .text 2
+_machdep_sys_bind:
+ .long _.machdep_sys_bind
+
+ .text
+_.machdep_sys_bind:
+ ls r0,0(r3)
+ svc 104(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+
+/* ==========================================================================
+ * machdep_sys_socket()
+ */
+ .globl _machdep_sys_socket
+ .globl _.machdep_sys_socket
+
+ .text 2
+_machdep_sys_socket:
+ .long _.machdep_sys_socket
+
+ .text
+ .align 2
+_.machdep_sys_socket:
+ svc 97(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+
+/* ==========================================================================
+ * machdep_sys_close()
+ */
+ .globl _machdep_sys_close
+ .globl _.machdep_sys_close
+
+ .text 2
+_machdep_sys_close:
+ .long _.machdep_sys_close
+
+ .text
+ .align 2
+_.machdep_sys_close:
+ svc 6(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+
+/* ==========================================================================
+ * machdep_sys_connect()
+ */
+ .globl _machdep_sys_connect
+ .globl _.machdep_sys_connect
+
+ .text 2
+_machdep_sys_connect:
+ .long _.machdep_sys_connect
+
+ .text
+_.machdep_sys_connect:
+ lcs r0,0(r3)
+ svc 98(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+/* ==========================================================================
+ * machdep_sys_accept()
+ */
+ .globl _machdep_sys_accept
+ .globl _.machdep_sys_accept
+
+ .text 2
+_machdep_sys_accept:
+ .long _.machdep_sys_accept
+
+ .text
+_.machdep_sys_accept:
+ lcs r0,0(r3)
+ svc 99(r0)
+ bntbr r15
+ store r2,_errno,r5
+ cal r2,-1(r0)
+
+/* ==========================================================================
+ * machdep_sys_listen()
+ */
+ .globl _machdep_sys_listen
+ .globl _.machdep_sys_listen
+
+ .text 2
+ .align 2
+_machdep_sys_listen:
+ .long _.machdep_sys_listen
+
+ .text
+ .align 2
+_.machdep_sys_listen:
+ svc 106(r0)
+ bntbr r15
+ brx r15
+ twoc r2,r2
+
+/* ==========================================================================
+ * machdep_sys_fcntl()
+ */
+ .globl _.machdep_sys_fcntl
+ .globl _machdep_sys_fcntl
+
+ .text 2
+_machdep_sys_fcntl:
+ .long _.machdep_sys_fcntl
+ .text
+_.machdep_sys_fcntl:
+ lcs r0,0(sp)
+ svc 92(r0)
+ bntbr r15
+ store r2,_errno,r5
+ brx r15
+ cal r2,-1(r0)
+
+/* ==========================================================================
+ * machdep_sys_getpeername()
+ */
+ .globl _machdep_sys_getpeername
+ .globl _.machdep_sys_getpeername
+
+ .text 2
+_machdep_sys_getpeername:
+ .long _.machdep_sys_getpeername
+
+ .text
+_.machdep_sys_getpeername:
+ ls r0,0(sp)
+ svc 141(r0)
+ bntbr r15
+ brx r15
+ twoc r2,r2
+
+
+/* ==========================================================================
+ * machdep_sys_getsockopt()
+ */
+ .globl _machdep_sys_getsockopt
+ .globl _.machdep_sys_getsockopt
+
+ .text 2
+_machdep_sys_getsockopt:
+ .long _.machdep_sys_getsockopt
+
+ .text
+_.machdep_sys_getsockopt:
+ ls r0,0(sp)
+ svc 118(r0)
+ bntbr r15
+ brx r15
+ twoc r2,r2
+
+
+/* ==========================================================================
+ * machdep_sys_select()
+ */
+
+ .globl _.machdep_sys_select
+ .globl _machdep_sys_select
+
+ .text 2
+_machdep_sys_select:
+ .long _.machdep_sys_select
+ .text
+_.machdep_sys_select:
+ svc 93(r0)
+ bntbr r15
+ brx r15
+ twoc r2,r2
+
+/* ==========================================================================
+ * __tsh()
+ */
+ .globl _._tsh
+ .globl __tsh
+ .text 2
+__tsh: .long _._tsh
+ .text
+ .align 2
+_._tsh:
+ brx r15
+ tsh r2,0(r2)
+
+
+/* ==========================================================================
+ * __pthread_save()
+ */
+ .globl __pthread_save
+ .globl _._pthread_save
+ .text 2
+__pthread_save:
+ .long _._pthread_save
+ .text
+ .align 2
+_._pthread_save:
+ ail r5,r4,0
+ jne 1f
+ mr r4,sp
+ lis r5,0
+ stm r4,0(r2)
+ brx r15
+ lis r2,0
+1:
+ mr r0,r15 # save old return address
+ ls r15,0(r4) # new return address
+ mr r5,r4 # r0 to restore
+ mr r4,r3 # sp to restore
+ stm r4,0(r2)
+ brx r0
+ lis r2,0
+
+
+/* ==========================================================================
+ * __pthread_restore()
+ */
+ .globl __pthread_restore
+ .globl _._pthread_restore
+ .text 2
+__pthread_restore:
+ .long _._pthread_restore
+ .text
+ .align 2
+_._pthread_restore:
+ lm r4,0(r2)
+ mr r0,r5
+ lis r2,1
+ brx r15
+ mr sp,r4
+
+
diff --git a/mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S b/mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S
new file mode 100644
index 00000000000..9c4da4b1325
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-sparc-netbsd-1.1.S
@@ -0,0 +1,102 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+_machdep_sys_##x:; \
+ \
+ mov SYS_##x, %g1; \
+ ta 0; \
+ bcs,a 2b; \
+ sub %r0,%o0,%o0; \
+ retl
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _machdep_sys_pipe
+
+_machdep_sys_pipe:
+ mov %o0, %o2
+ mov SYS_pipe, %g1
+ ta 0
+ bcs 1b
+ nop
+ st %o0, [ %o2 ]
+ st %o1, [ %o2 + 4 ]
+ retl
+ mov %g0, %o0
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ mov SYS_fork, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ dec %o1;
+ retl;
+ and %o0, %o1, %o0; ! return 0 in child, pid in parent
+
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl _machdep_sys_sigprocmask;
+
+_machdep_sys_sigprocmask:;
+
+ ld [%o1], %o1;
+ mov SYS_sigprocmask, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _machdep_sys_sigsuspend;
+
+_machdep_sys_sigsuspend:;
+
+ ld [%o0], %o0;
+ mov SYS_sigsuspend, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ retl
+ nop
diff --git a/mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S b/mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S
new file mode 100644
index 00000000000..74a51e756b7
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-sparc-netbsd-1.3.S
@@ -0,0 +1,172 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _C_LABEL(machdep_sys_##x); \
+ \
+_C_LABEL(machdep_sys_##x):; \
+ \
+ mov SYS_##x, %g1; \
+ ta 0; \
+ bcs,a 2b; \
+ sub %r0,%o0,%o0; \
+ retl
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _C_LABEL(machdep_sys_pipe)
+
+_C_LABEL(machdep_sys_pipe):
+ mov %o0, %o2
+ mov SYS_pipe, %g1
+ ta 0
+ bcs 1b
+ nop
+ st %o0, [ %o2 ]
+ st %o1, [ %o2 + 4 ]
+ retl
+ mov %g0, %o0
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _C_LABEL(machdep_sys_fork);
+
+_C_LABEL(machdep_sys_fork):;
+
+ mov SYS_fork, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ dec %o1;
+ retl;
+ and %o0, %o1, %o0; ! return 0 in child, pid in parent
+
+#ifndef SYS___sigprocmask14
+/* ==========================================================================
+ * machdep_sys_sigprocmask()
+ */
+ .globl _C_LABEL(machdep_sys_sigprocmask);
+
+_C_LABEL(machdep_sys_sigprocmask):;
+
+ ld [%o1], %o1;
+ mov SYS_sigprocmask, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ retl
+ nop
+#endif
+
+#ifndef SYS___sigsuspend14
+/* ==========================================================================
+ * machdep_sys_sigsuspend()
+ */
+ .globl _C_LABEL(machdep_sys_sigsuspend);
+
+_C_LABEL(machdep_sys_sigsuspend):;
+
+ ld [%o0], %o0;
+ mov SYS_sigsuspend, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ retl
+ nop
+#endif
+
+/* ==========================================================================
+ * machdep_sys_fstat()
+ */
+ .globl _C_LABEL(machdep_sys_fstat);
+
+_C_LABEL(machdep_sys_fstat):;
+
+ mov SYS___fstat13, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys___syscall()
+ */
+_machdep_sys___syscall:;
+
+ mov SYS___syscall, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys_lseek()
+ */
+ .global _C_LABEL(machdep_sys_lseek)
+
+_C_LABEL(machdep_sys_lseek):
+ save %sp,-112,%sp
+ mov %i1,%o4
+ mov %i2,%o5
+ st %i3,[%sp+92]
+ mov 0,%o0
+ mov SYS_lseek,%o1
+ mov %i0,%o2
+ call _machdep_sys___syscall,0
+ mov 0,%o3
+ mov %o0,%i0
+ mov %o1,%i1
+ ret
+ restore
+
+/* ==========================================================================
+ * machdep_sys_ftruncate()
+ */
+ .global _C_LABEL(machdep_sys_ftruncate)
+
+_C_LABEL(machdep_sys_ftruncate):
+ save %sp,-104,%sp
+ mov %i1,%o4
+ mov %i2,%o5
+ mov 0,%o0
+ mov SYS_ftruncate,%o1
+ mov %i0,%o2
+ call _machdep_sys___syscall,0
+ mov 0,%o3
+ mov %o0,%o1
+ sra %o0,31,%o0
+ ret
+ restore %g0,%o1,%o0
diff --git a/mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S b/mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S
new file mode 100644
index 00000000000..ec293b0ca3f
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-sparc-sunos-4.1.3.S
@@ -0,0 +1,113 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+_machdep_sys_##x:; \
+ \
+ mov SYS_##x, %g1; \
+ ta 0; \
+ bcs,a 2b; \
+ sub %r0,%o0,%o0; \
+ retl
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _machdep_sys_pipe
+
+_machdep_sys_pipe:
+ mov %o0, %o2
+ mov SYS_pipe, %g1
+ ta 0
+ bcs 1b
+ nop
+ st %o0, [ %o2 ]
+ st %o1, [ %o2 + 4 ]
+ retl
+ mov %g0, %o0
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ mov SYS_fork, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ tst %o1
+ bne,a __fork_parent
+ mov %g0, %o0
+__fork_parent:;
+ retl
+
+/* POSIX-compliant getpgrp() takes no arguments. The SunOS syscall wants
+ one, and gives the POSIXy result if that argument is zero. */
+ .globl _getpgrp
+_getpgrp:
+ mov SYS_getpgrp, %g1
+ mov 0, %i0
+ ta 0
+ bcs 1b
+ nop
+ retl
+ nop
+
+#if 0
+/* I think this bit of magic will do the right thing for other syscalls.
+ We get here with the new `errno' code in %o0. It should get stored in
+ *__error(), and -1 returned to the caller. */
+ .globl cerror
+cerror:
+ save %sp,-104,%sp
+ /* Now value is in %i0. Store it in *__error(). */
+ call ___error
+ nop
+ st %i0,[%o0]
+
+ /* Now also store a copy in global variable errno, for routines
+ like isatty that want to examine it and which haven't been
+ converted yet. */
+ sethi %hi(_errno), %o0
+ st %i0,[%o0+%lo(_errno)]
+
+#if 0 /* use this if you want -errno returned */
+ sub %r0,%i0,%i0
+#else /* return -1 */
+ mov -1,%i0
+#endif
+ retl
+ restore
+#endif
diff --git a/mit-pthreads/machdep/syscall-sparc-sunos-5.3.S b/mit-pthreads/machdep/syscall-sparc-sunos-5.3.S
new file mode 100644
index 00000000000..822055ad04e
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-sparc-sunos-5.3.S
@@ -0,0 +1,65 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#define _ASM
+#include <sys/syscall.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl machdep_sys_fork;
+
+machdep_sys_fork:;
+
+ mov SYS_fork, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ tst %o1
+ bne,a __fork_parent
+ mov %g0, %o0
+__fork_parent:;
+ retl
+ nop; /* Added by monty to keep sparc assembler happy */
+
+/* ==========================================================================
+ * Berkeley socket stuff
+ *
+ * ==========================================================================
+ * machdep_sys_socketcall()
+ */
+ .globl machdep_sys_socketcall;
+
+machdep_sys_socketcall:;
+
+ mov 83, %g1;
+ ta 0;
+ bcs,a 2b;
+ sub %r0,%o0,%o0;
+ retl
+ nop; /* Added by monty to keep sparc assembler happy */
diff --git a/mit-pthreads/machdep/syscall-sparc-sunos4.S b/mit-pthreads/machdep/syscall-sparc-sunos4.S
new file mode 100644
index 00000000000..ec293b0ca3f
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-sparc-sunos4.S
@@ -0,0 +1,113 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+_machdep_sys_##x:; \
+ \
+ mov SYS_##x, %g1; \
+ ta 0; \
+ bcs,a 2b; \
+ sub %r0,%o0,%o0; \
+ retl
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+/* ==========================================================================
+ * machdep_sys_pipe()
+ */
+ .globl _machdep_sys_pipe
+
+_machdep_sys_pipe:
+ mov %o0, %o2
+ mov SYS_pipe, %g1
+ ta 0
+ bcs 1b
+ nop
+ st %o0, [ %o2 ]
+ st %o1, [ %o2 + 4 ]
+ retl
+ mov %g0, %o0
+
+/* ==========================================================================
+ * machdep_sys_fork()
+ */
+ .globl _machdep_sys_fork;
+
+_machdep_sys_fork:;
+
+ mov SYS_fork, %g1;
+ ta 0;
+ bcs 1b;
+ nop;
+ tst %o1
+ bne,a __fork_parent
+ mov %g0, %o0
+__fork_parent:;
+ retl
+
+/* POSIX-compliant getpgrp() takes no arguments. The SunOS syscall wants
+ one, and gives the POSIXy result if that argument is zero. */
+ .globl _getpgrp
+_getpgrp:
+ mov SYS_getpgrp, %g1
+ mov 0, %i0
+ ta 0
+ bcs 1b
+ nop
+ retl
+ nop
+
+#if 0
+/* I think this bit of magic will do the right thing for other syscalls.
+ We get here with the new `errno' code in %o0. It should get stored in
+ *__error(), and -1 returned to the caller. */
+ .globl cerror
+cerror:
+ save %sp,-104,%sp
+ /* Now value is in %i0. Store it in *__error(). */
+ call ___error
+ nop
+ st %i0,[%o0]
+
+ /* Now also store a copy in global variable errno, for routines
+ like isatty that want to examine it and which haven't been
+ converted yet. */
+ sethi %hi(_errno), %o0
+ st %i0,[%o0+%lo(_errno)]
+
+#if 0 /* use this if you want -errno returned */
+ sub %r0,%i0,%i0
+#else /* return -1 */
+ mov -1,%i0
+#endif
+ retl
+ restore
+#endif
diff --git a/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S b/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S
new file mode 100644
index 00000000000..a2941ece7c9
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.1.S
@@ -0,0 +1,46 @@
+#include <machine/asm.h>
+#define COMPAT_43
+#include <sys/syscall.h>
+#define CHMK() call_pal 0x83
+
+#undef SYSCALL
+
+/* Kernel syscall interface:
+ Input:
+ v0 - system call number
+ a* - arguments, as in C
+ Output:
+ a3 - zero iff successful
+ v0 - errno value on failure, else result
+
+ This macro is similar to SYSCALL in asm.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ This macro expansions does not include the return instruction.
+ If there's no other work to be done, use something like:
+ SYSCALL(foo) ; ret
+ If there is other work to do (in fork, maybe?), do it after the
+ SYSCALL invocation. */
+
+#define SYSCALL(x) \
+ .align 4 ;\
+ .globl machdep_sys_##x ;\
+ .ent machdep_sys_##x, 0 ;\
+machdep_sys_##x: ;\
+ .frame sp,0,ra ;\
+ ldiq v0, SYS_##x ;\
+ CHMK() ;\
+ beq a3, Lsys_noerr_##x ;\
+ br gp, Lsys_err_##x ;\
+Lsys_err_##x: ;\
+ /* Load gp so we can find cerror to jump to. */;\
+ ldgp gp, 0(gp) ;\
+ jmp zero, machdep_cerror ;\
+Lsys_noerr_##x:
+
+#define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
+
+#define XSYSCALL(x) SIMPLE_SYSCALL(x)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S
new file mode 100644
index 00000000000..12595feabc1
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-alpha-netbsd-1.3.S
@@ -0,0 +1,53 @@
+#include <machine/asm.h>
+#define COMPAT_43
+#include <sys/syscall.h>
+#define CHMK() call_pal 0x83
+
+#ifdef SYS___sigsuspend14
+#define SYS_sigsuspend SYS___sigsuspend14
+#endif
+#ifdef SYS___sigprocmask14
+#define SYS_sigprocmask SYS___sigprocmask14
+#endif
+
+#undef SYSCALL
+
+/* Kernel syscall interface:
+ Input:
+ v0 - system call number
+ a* - arguments, as in C
+ Output:
+ a3 - zero iff successful
+ v0 - errno value on failure, else result
+
+ This macro is similar to SYSCALL in asm.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ This macro expansions does not include the return instruction.
+ If there's no other work to be done, use something like:
+ SYSCALL(foo) ; ret
+ If there is other work to do (in fork, maybe?), do it after the
+ SYSCALL invocation. */
+
+#define SYSCALL(x) \
+ .align 4 ;\
+ .globl machdep_sys_##x ;\
+ .ent machdep_sys_##x, 0 ;\
+machdep_sys_##x: ;\
+ .frame sp,0,ra ;\
+ ldiq v0, SYS_##x ;\
+ CHMK() ;\
+ beq a3, Lsys_noerr_##x ;\
+ br gp, Lsys_err_##x ;\
+Lsys_err_##x: ;\
+ /* Load gp so we can find cerror to jump to. */;\
+ ldgp gp, 0(gp) ;\
+ jmp zero, machdep_cerror ;\
+Lsys_noerr_##x:
+
+#define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
+
+#define XSYSCALL(x) SIMPLE_SYSCALL(x)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-alpha-osf1.S b/mit-pthreads/machdep/syscall-template-alpha-osf1.S
new file mode 100644
index 00000000000..bc4653b5f9e
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-alpha-osf1.S
@@ -0,0 +1,46 @@
+#include <asm.h>
+#include <regdef.h>
+#define COMPAT_43
+#include <syscall.h>
+
+#undef SYSCALL
+
+/* Kernel syscall interface:
+ Input:
+ v0 - system call number
+ a* - arguments, as in C
+ Output:
+ a3 - zero iff successful
+ v0 - errno value on failure, else result
+
+ This macro is similar to SYSCALL in asm.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ This macro expansions does not include the return instruction.
+ If there's no other work to be done, use something like:
+ SYSCALL(foo) ; ret
+ If there is other work to do (in fork, maybe?), do it after the
+ SYSCALL invocation. */
+
+#define SYSCALL(x) \
+ .align 4 ;\
+ .globl machdep_sys_##x ;\
+ .ent machdep_sys_##x, 0 ;\
+machdep_sys_##x: ;\
+ .frame sp,0,ra ;\
+ ldiq v0, SYS_##x ;\
+ CHMK() ;\
+ beq a3, 2f ;\
+ br gp, 1f ;\
+1: ;\
+ /* Load gp so we can find cerror to jump to. */;\
+ ldgp gp, 0(gp) ;\
+ jmp zero, machdep_cerror ;\
+2:
+
+#define SIMPLE_SYSCALL(x) SYSCALL(x) ; ret ; .end machdep_sys_##x
+
+#define XSYSCALL(x) SIMPLE_SYSCALL(x)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S
new file mode 100644
index 00000000000..923d2c03a75
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-arm32-netbsd-1.3.S
@@ -0,0 +1,55 @@
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef SYS___sigsuspend14
+#define SYS_sigsuspend SYS___sigsuspend14
+#endif
+#ifdef SYS___sigprocmask14
+#define SYS_sigprocmask SYS___sigprocmask14
+#endif
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl _C_LABEL(machdep_sys_##x); \
+ \
+_C_LABEL(machdep_sys_##x):; \
+ \
+ swi SYS_##x; \
+ bcs 1b; \
+ mov r15, r14;
+
+#else
+
+#define SYSCALL(x) \
+ .globl _C_LABEL(_machdep_sys_/**/x); \
+ \
+_C_LABEL(machdep_sys_/**/x):; \
+ \
+ swi SYS_/**/x; \
+ bcs 1b; \
+ mov r15, r14;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 0
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ rsb r0, r0, #0x00000000
+ mvn r1, #0x00000000
+ mov r15, r14
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S b/mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S
new file mode 100644
index 00000000000..0123b1deee7
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-hppa-hpux-10.20.S
@@ -0,0 +1,27 @@
+/* ==== syscall.S ============================================================
+ * Written 1996 by Stefan Grefen, grefen@convex.com
+ */
+
+#include <sys/syscall.h>
+
+#define _CAT(a,b)a##b
+#define CAT(a,b)_CAT(a,b)
+
+#define MKNAME(a)CAT(a,SYSCALL_NAME)
+
+ .CODE
+machdep_error
+ sub %r0,%r28,%r28
+ bv,n %r0(%r2)
+
+ .label MKNAME(machdep_sys_)
+ .PROC
+ .CALLINFO NO_CALLS,FRAME=0
+ ldil -0x80000,%r1
+ ble 4(%sr7,%r1)
+ ldi MKNAME(SYS_),%r22
+ or,= %r0,%r22,%r0
+ b,n machdep_error
+ bv,n %r0(%r2)
+ .PROCEND
+ .EXPORT MKNAME(machdep_sys_)
diff --git a/mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S b/mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S
new file mode 100644
index 00000000000..0123b1deee7
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-hppa-hpux-9.03.S
@@ -0,0 +1,27 @@
+/* ==== syscall.S ============================================================
+ * Written 1996 by Stefan Grefen, grefen@convex.com
+ */
+
+#include <sys/syscall.h>
+
+#define _CAT(a,b)a##b
+#define CAT(a,b)_CAT(a,b)
+
+#define MKNAME(a)CAT(a,SYSCALL_NAME)
+
+ .CODE
+machdep_error
+ sub %r0,%r28,%r28
+ bv,n %r0(%r2)
+
+ .label MKNAME(machdep_sys_)
+ .PROC
+ .CALLINFO NO_CALLS,FRAME=0
+ ldil -0x80000,%r1
+ ble 4(%sr7,%r1)
+ ldi MKNAME(SYS_),%r22
+ or,= %r0,%r22,%r0
+ b,n machdep_error
+ bv,n %r0(%r2)
+ .PROCEND
+ .EXPORT MKNAME(machdep_sys_)
diff --git a/mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S b/mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S
new file mode 100644
index 00000000000..3299f49195f
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-i386-bsdi-2.0.S
@@ -0,0 +1,48 @@
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x##; \
+ \
+_machdep_sys_##x##:; \
+ \
+ movl $(SYS_##x##), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#else
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x/**/; \
+ \
+_machdep_sys_/**/x/**/:; \
+ \
+ movl $(SYS_/**/x/**/), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S b/mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S
new file mode 100644
index 00000000000..1906a949c8b
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-i386-freebsd-2.0.S
@@ -0,0 +1,59 @@
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+
+#define SYS(X) SYS_##X
+#ifdef __ELF__
+#define NAME(X) machdep_sys_##X
+#else
+#define NAME(X) _machdep_sys_##X
+#endif
+
+#else
+
+#define SYS(X) SYS_/**/X
+#ifdef __ELF__
+#define NAME(X) machdep_sys_/**/X
+#else
+#define NAME(X) _machdep_sys_/**/X
+#endif
+
+#endif
+
+#ifdef __ELF__
+#define END(X) 5: ; .type NAME(X),@function ; .size NAME(X),5b - NAME(X)
+#define KERNCALL int $0x80
+#else
+#define END(X)
+#define KERNCALL .byte 0x9a; .long 0; .word 7;
+#endif
+
+#define SYSCALL(x) \
+ .globl NAME(x); \
+ \
+NAME(x):; \
+ movl $(SYS(x)), %eax; \
+ KERNCALL; \
+ jb 1b; \
+ ret; \
+ END(x)
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S b/mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S
new file mode 100644
index 00000000000..c5e76bb4538
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-i386-netbsd-1.1.S
@@ -0,0 +1,49 @@
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+_machdep_sys_##x:; \
+ \
+ movl $(SYS_##x), %eax; \
+ int $0x80; \
+ jb 1b; \
+ ret;
+
+#else
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+_machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ int $0x80; \
+ jb 1b; \
+ ret;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S
new file mode 100644
index 00000000000..d6dffc35132
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-i386-netbsd-1.3.S
@@ -0,0 +1,56 @@
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef SYS___sigsuspend14
+#define SYS_sigsuspend SYS___sigsuspend14
+#endif
+#ifdef SYS___sigprocmask14
+#define SYS_sigprocmask SYS___sigprocmask14
+#endif
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl _C_LABEL(machdep_sys_##x); \
+ \
+_C_LABEL(machdep_sys_##x):; \
+ \
+ movl $(SYS_##x), %eax; \
+ int $0x80; \
+ jb 1b; \
+ ret;
+
+#else
+
+#define _SYSCALL(x) \
+ .globl _C_LABEL(machdep_sys_/**/x); \
+ \
+_C_LABEL(machdep_sys_/**/x):; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ int $0x80; \
+ jb 1b; \
+ ret;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S b/mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S
new file mode 100644
index 00000000000..83a2405ed51
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-i386-netbsd1.0.S
@@ -0,0 +1,49 @@
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+_machdep_sys_##x:; \
+ \
+ movl $(SYS_##x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#else
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+_machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S b/mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S
new file mode 100644
index 00000000000..34fb5caaa43
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-i386-openbsd-2.0.S
@@ -0,0 +1,48 @@
+#include <sys/syscall.h>
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x##; \
+ \
+_machdep_sys_##x:##; \
+ \
+ movl $(SYS_##x##), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#else
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+_machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jb 1b; \
+ ret;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ neg %eax
+ ret
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S b/mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S
new file mode 100644
index 00000000000..753475b5c3d
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-i386-sco-3.2v5.S
@@ -0,0 +1,67 @@
+#include <sys/errno.h>
+#include <sys/syscall.h>
+
+#ifdef _SCO_ELF
+
+#define NAME(X) machdep_sys_##X
+#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X)
+#define GETBX(X) \
+ push %ebx; \
+ call 1f; \
+1: \
+ popl %ebx;
+#else
+
+#define NAME(X) _machdep_sys_##X
+#define END(X)
+
+#endif
+
+#ifdef __STDC__
+
+#define SYSCALL(x) \
+ .globl NAME(x); \
+ \
+NAME(x):; \
+ movl $(SYS_##x##), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jae 1f; \
+ cmp $(ERESTART), %eax; \
+ je NAME(x); \
+ neg %eax; \
+1: \
+ ret; \
+ END(x)
+
+#else
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_/**/x; \
+ \
+machdep_sys_/**/x:; \
+ \
+ movl $(SYS_/**/x), %eax; \
+ .byte 0x9a; .long 0; .word 7; \
+ jae 1f; \
+ neg %eax;
+1: \
+ ret;
+
+#endif
+
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S b/mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S
new file mode 100644
index 00000000000..722b001671b
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-ip22-irix-5.2.S
@@ -0,0 +1,51 @@
+#include <sys.s>
+#include <sys/regdef.h>
+/* #include <sys/asm.h> */
+
+/*
+ Kernel syscall interface:
+ Input:
+ v0 syscall number
+ Output:
+
+ This macro is similar to SYSCALL in sys/syscall.h, but not completely.
+ There's room for optimization, if we assume this will continue to
+ be assembled as one file.
+
+ Compile with -DPIC for pic code.
+*/
+
+#ifdef PIC
+#define PICOPT .option pic2
+#else
+#define PICOPT
+#endif
+
+
+#define YSYSCALL(x) \
+ PICOPT; \
+ .globl machdep_sys_##x; \
+ .ent machdep_sys_##x, 0; \
+machdep_sys_##x:; \
+ .frame sp,0,ra; \
+ .set noreorder; \
+ li v0, SYS_##x; \
+ syscall; \
+ bne a3, zero, 1b; \
+ nop; \
+ j ra; \
+ nop; \
+ .end machdep_sys_##x
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ subu v0,zero,v0;
+ j ra;
+
+#define XSYSCALL(x) YSYSCALL(x)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-m68000-netbsd.S b/mit-pthreads/machdep/syscall-template-m68000-netbsd.S
new file mode 100644
index 00000000000..ce16bb5523c
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-m68000-netbsd.S
@@ -0,0 +1,43 @@
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef SYS___sigsuspend14
+#define SYS_sigsuspend SYS___sigsuspend14
+#endif
+#ifdef SYS___sigprocmask14
+#define SYS_sigprocmask SYS___sigprocmask14
+#endif
+
+
+#ifdef __STDC__
+#define IMM #
+#define SYSCALL(x) .even; \
+ ENTRY(machdep_sys_ ## x); \
+ movl IMM SYS_ ## x,d0; \
+ trap IMM 0; \
+ jcs err; \
+ rts
+#else /* !__STDC__ */
+#define SYSCALL(x) .even; ENTRY(machdep_sys_/**/x); \
+ movl #SYS_/**/x,d0; trap #0; jcs err; rts
+#endif /* !__STDC__ */
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .even
+
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+err:
+ negl d0
+ rts
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S b/mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S
new file mode 100644
index 00000000000..575fe3c3d74
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-r2000-ultrix-4.2.S
@@ -0,0 +1,77 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1993 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.
+ *
+ * Description : Machine dependent syscalls for decstation with r2000/r3000
+ *
+ * 1.00 93/08/14 proven
+ * -Started coding this file.
+ */
+
+ .text
+ .ascii "$Id$";
+
+#include <syscall.h>
+#include <machine/regdef.h>
+
+#define SYSCALL(x) \
+ \
+ .globl machdep_sys_##x; \
+ .ent machdep_sys_##x; \
+ \
+machdep_sys_##x:; \
+ \
+ .frame sp,0,ra; /* No frame, return address in ra */ \
+ \
+ li v0,SYS_##x; /* Load syscall # into v0 */ \
+ syscall; \
+ bne a3,zero,machdep_error; /* Error if a3 != 0 */ \
+ j ra; \
+ \
+ .end machdep_sys_##x
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 2
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value. Eventually I want to load the errno value directly
+ * into pthread_run->error but until then ...
+ */
+machdep_error:
+ negu v0, v0 /* Return negative of errno value. */
+ j ra
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S b/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S
new file mode 100644
index 00000000000..2d07892a315
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.1.S
@@ -0,0 +1,40 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+_machdep_sys_##x:; \
+ \
+ mov SYS_##x, %g1; \
+ ta 0; \
+ bcs,a 2b; \
+ sub %r0,%o0,%o0; \
+ retl; \
+ nop
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S b/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S
new file mode 100644
index 00000000000..2caad5c3437
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-sparc-netbsd-1.3.S
@@ -0,0 +1,48 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#include <machine/asm.h>
+#include <sys/syscall.h>
+
+#ifdef SYS___sigsuspend14
+#define SYS_sigsuspend SYS___sigsuspend14
+#endif
+#ifdef SYS___sigprocmask14
+#define SYS_sigprocmask SYS___sigprocmask14
+#endif
+
+#define SYSCALL(x) \
+ .globl _C_LABEL(machdep_sys_##x); \
+ \
+_C_LABEL(machdep_sys_##x):; \
+ \
+ mov SYS_##x, %g1; \
+ ta 0; \
+ bcs,a 2b; \
+ sub %r0,%o0,%o0; \
+ retl; \
+ nop
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S b/mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S
new file mode 100644
index 00000000000..65a796a057d
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-sparc-sunos-5.3.S
@@ -0,0 +1,45 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#ifndef lint
+ .text
+ .asciz "$Id$";
+#endif
+
+#define _ASM
+#include <sys/syscall.h>
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+#define concat2(a,b) a ## b
+#define concat(a,b) concat2(a,b)
+#define SYSval concat(SYS_,SYSCALL_NAME)
+#define procname concat(machdep_sys_,SYSCALL_NAME)
+
+ .globl procname
+
+procname:
+ mov SYSval, %g1
+ ta 0
+ bcs,a 2b
+ sub %r0,%o0,%o0
+ retl
+ nop
diff --git a/mit-pthreads/machdep/syscall-template-sparc-sunos4.S b/mit-pthreads/machdep/syscall-template-sparc-sunos4.S
new file mode 100644
index 00000000000..2d07892a315
--- /dev/null
+++ b/mit-pthreads/machdep/syscall-template-sparc-sunos4.S
@@ -0,0 +1,40 @@
+/* ==== syscall.S ============================================================
+ * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
+ * All rights reserved.
+ *
+ */
+
+#include <sys/syscall.h>
+
+#define SYSCALL(x) \
+ .globl _machdep_sys_##x; \
+ \
+_machdep_sys_##x:; \
+ \
+ mov SYS_##x, %g1; \
+ ta 0; \
+ bcs,a 2b; \
+ sub %r0,%o0,%o0; \
+ retl; \
+ nop
+
+/*
+ * Initial asm stuff for all functions.
+ */
+ .text
+ .align 4
+
+/* ==========================================================================
+ * error code for all syscalls. The error value is returned as the negative
+ * of the errno value.
+ */
+
+1:
+ sub %r0, %o0, %o0
+2:
+ retl
+ nop
+
+#define XSYSCALL(NAME) SYSCALL(NAME)
+
+XSYSCALL(SYSCALL_NAME)
diff --git a/mit-pthreads/machdep/ultrix-4.2/__math.h b/mit-pthreads/machdep/ultrix-4.2/__math.h
new file mode 100755
index 00000000000..6249d720039
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/__math.h
@@ -0,0 +1,2 @@
+#define HUGE_VAL 1.8e+308
+
diff --git a/mit-pthreads/machdep/ultrix-4.2/__signal.h b/mit-pthreads/machdep/ultrix-4.2/__signal.h
new file mode 100755
index 00000000000..68364772a6a
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/__signal.h
@@ -0,0 +1,66 @@
+#include <ansi_compat.h>
+
+#define NSIG 32
+
+#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 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 SIGTTIN 21 /* to readers pgrp upon background tty read */
+#define SIGTTOU 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
+#define SIGIO 23 /* input/output possible signal */
+#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 size changes */
+#define SIGLOST 29 /* Sys-V rec lock: notify user upon server crash */
+#define SIGUSR1 30 /* User signal 1 (from SysV) */
+#define SIGUSR2 31 /* User signal 2 (from SysV) */
+
+/* Add System V signal definitions (DLB001) */
+#define SIGCLD SIGCHLD /* System V name for SIGCHLD */
+#define SIGABRT SIGIOT
+
+typedef long sig_atomic_t;
+typedef unsigned int sigset_t;
+
+struct sigaction {
+ void (*sa_handler)(); /* signal handler */
+ sigset_t sa_mask; /* signal mask to apply */
+ int sa_flags; /* see signal options below */
+};
+
+/* Defines for sigprocmask() call. POSIX.
+ */
+#define SIG_BLOCK 1 /* Add these signals to block mask */
+#define SIG_UNBLOCK 2 /* Remove these signals from block mask */
+#define SIG_SETMASK 3 /* Set block mask to this mask */
+
+#define SIG_ERR ((void (*)())(-1))
+#define SIG_DFL ((void (*)())( 0))
+#define SIG_IGN ((void (*)())( 1))
+
+
+#define __SIGFILLSET 0xffffffff
+#define __SIGEMPTYSET 0
+#define __SIGADDSET(s,n) ((*s) |= (1 << ((n) - 1)))
+#define __SIGDELSET(s,n) ((*s) &= ~(1 << ((n) - 1)))
+#define __SIGISMEMBER(s,n) ((*s) & (1 << ((n) - 1)))
+
diff --git a/mit-pthreads/machdep/ultrix-4.2/__stdio.h b/mit-pthreads/machdep/ultrix-4.2/__stdio.h
new file mode 100755
index 00000000000..3f6aee47de3
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/__stdio.h
@@ -0,0 +1,7 @@
+
+#if ! defined(_SIZE_T_)
+#define _SIZE_T_
+typedef pthread_size_t size_t;
+#endif
+
+typedef pthread_fpos_t fpos_t;
diff --git a/mit-pthreads/machdep/ultrix-4.2/__stdlib.h b/mit-pthreads/machdep/ultrix-4.2/__stdlib.h
new file mode 100755
index 00000000000..e2e52cc41c9
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/__stdlib.h
@@ -0,0 +1,21 @@
+
+#ifndef _SYS___STDLIB_H_
+#define _SYS___STDLIB_H_
+
+#include <ansi_compat.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
diff --git a/mit-pthreads/machdep/ultrix-4.2/__string.h b/mit-pthreads/machdep/ultrix-4.2/__string.h
new file mode 100755
index 00000000000..03039b5cf73
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/__string.h
@@ -0,0 +1,17 @@
+
+#if ! defined(_SIZE_T_)
+#define _SIZE_T_
+typedef pthread_size_t size_t;
+#endif
+
+/* Non-standard Ultrix 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));
+__END_DECLS
+#endif
+
diff --git a/mit-pthreads/machdep/ultrix-4.2/__time.h b/mit-pthreads/machdep/ultrix-4.2/__time.h
new file mode 100755
index 00000000000..dddc54430bc
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/__time.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS__TIME_H_
+#define _SYS__TIME_H_
+
+#include <ansi_compat.h>
+
+#ifndef _CLOCK_T_
+#define _CLOCK_T_
+typedef int clock_t;
+#endif
+
+#ifndef _TIME_T_
+#define _TIME_T_
+typedef int time_t;
+#endif
+
+#ifndef _SIZE_T_
+#define _SIZE_T_
+typedef unsigned int size_t;
+#endif
+
+#define CLOCKS_PER_SEC 1000000
+
+#if !defined(_ANSI_SOURCE)
+#define CLK_TCK 60
+#endif /* not ANSI */
+
+#endif /* !_SYS__TIME_H_ */
diff --git a/mit-pthreads/machdep/ultrix-4.2/__unistd.h b/mit-pthreads/machdep/ultrix-4.2/__unistd.h
new file mode 100755
index 00000000000..f570242ef0d
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/__unistd.h
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 1990 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: @(#)stdlib.h 5.13 (Berkeley) 6/4/91
+ * $Id$
+ */
+
+#ifndef _SYS___UNISTD_H_
+#define _SYS___UNISTD_H_
+
+#include <sys/types.h>
+
+#ifndef _SSIZE_T_
+#define _SSIZE_T_
+typedef int ssize_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/cdefs.h b/mit-pthreads/machdep/ultrix-4.2/cdefs.h
new file mode 100755
index 00000000000..4e1dc1c280d
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/cdefs.h
@@ -0,0 +1,66 @@
+/* ==== 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
+
+#ifndef _SSIZE_T_
+#define _SSIZE_T_
+typedef int ssize_t;
+#endif
+
+#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/compat.h b/mit-pthreads/machdep/ultrix-4.2/compat.h
new file mode 100755
index 00000000000..b2a846d00ee
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/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 : Basic timers header.
+ *
+ * 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/ultrix-4.2/dirent.h b/mit-pthreads/machdep/ultrix-4.2/dirent.h
new file mode 100755
index 00000000000..5f17af345db
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/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/ultrix-4.2/errno.h b/mit-pthreads/machdep/ultrix-4.2/errno.h
new file mode 100755
index 00000000000..b47633a9456
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/errno.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 1982, 1986, 1989 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: @(#)errno.h 7.13 (Berkeley) 2/19/91
+ * errno.h,v 1.3 1993/05/20 16:22:09 cgd Exp
+ */
+
+#ifndef _SYS_ERRNO_H_
+#define _SYS_ERRNO_H_
+
+#define EPERM 1 /* Operation not permitted */
+#define ENOENT 2 /* No such file or directory */
+#define ESRCH 3 /* No such process */
+#define EINTR 4 /* Interrupted system call */
+#define EIO 5 /* Input/output error */
+#define ENXIO 6 /* Device not configured */
+#define E2BIG 7 /* Argument list too long */
+#define ENOEXEC 8 /* Exec format error */
+#define EBADF 9 /* Bad file descriptor */
+#define ECHILD 10 /* No child processes */
+#define EAGAIN 11 /* No more processes */
+#define ENOMEM 12 /* Cannot allocate memory */
+#define EACCES 13 /* Permission denied */
+#define EFAULT 14 /* Bad address */
+/* 15 Non POSIX */
+/* 16 Non POSIX */
+#define EEXIST 17 /* File exists */
+#define EXDEV 18 /* Cross-device link */
+#define ENODEV 19 /* Operation not supported by device */
+#define ENOTDIR 20 /* Not a directory */
+#define EISDIR 21 /* Is a directory */
+#define EINVAL 22 /* Invalid argument */
+#define ENFILE 23 /* Too many open files in system */
+#define EMFILE 24 /* Too many open files */
+#define ENOTTY 25 /* Inappropriate ioctl for device */
+/* 26 Non POSIX */
+#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 /* Numerical argument out of domain */
+#define ERANGE 34 /* Result too large */
+/* 35 Non POSIX */
+/* 36 Non POSIX */
+/* 37 Non POSIX */
+/* 38 Non POSIX */
+/* 39 Non POSIX */
+/* 40 Non POSIX */
+/* 41 Non POSIX */
+/* 42 Non POSIX */
+/* 43 Non POSIX */
+/* 44 Non POSIX */
+/* 45 Non POSIX */
+/* 46 Non POSIX */
+/* 47 Non POSIX */
+/* 48 Non POSIX */
+/* 49 Non POSIX */
+/* 50 Non POSIX */
+/* 51 Non POSIX */
+/* 52 Non POSIX */
+/* 53 Non POSIX */
+/* 54 Non POSIX */
+/* 55 Non POSIX */
+/* 56 Non POSIX */
+/* 57 Non POSIX */
+/* 58 Non POSIX */
+/* 59 Non POSIX */
+/* 60 Non POSIX */
+/* 61 Non POSIX */
+/* 62 Non POSIX */
+#define ENAMETOOLONG 63 /* File name too long */
+/* 64 Non POSIX */
+/* 65 Non POSIX */
+#define ENOTEMPTY 66 /* Directory not empty */
+/* 67 Non POSIX */
+/* 68 Non POSIX */
+/* 69 Non POSIX */
+/* 70 Non POSIX */
+/* 71 Non POSIX */
+/* 72 Non POSIX */
+/* 73 Non POSIX */
+/* 74 Non POSIX */
+#define ENOLCK 75 /* No locks available */
+#define ENOSYS 76 /* Function not implemented */
+
+#ifndef _POSIX_SOURCE
+#define ENOTBLK 15 /* Block device required */
+#define EBUSY 16 /* Device busy */
+#define ETXTBSY 26 /* Text file busy */
+
+/* non-blocking and interrupt i/o */
+#define EWOULDBLOCK 35 /* Operation would block */
+#define EDEADLK EWOULDBLOCK /* Resource deadlock avoided */
+#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 */
+
+/* ipc/network software -- 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 EHOSTDOWN 64 /* Host is down */
+#define EHOSTUNREACH 65 /* No route to host */
+
+/* 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 */
+
+/* IPC errors */
+#define ENOMSG 72 /* RPC struct is bad */
+#define EIDRM 73 /* RPC version wrong */
+
+/* Alignment error of some type (i.e., cluster, page, block ...) */
+#define EALIGN 74 /* RPC prog. not avail */
+#endif /* _POSIX_SOURCE */
+
+#endif /* _SYS_ERRNO_H_ */
diff --git a/mit-pthreads/machdep/ultrix-4.2/time.h b/mit-pthreads/machdep/ultrix-4.2/time.h
new file mode 100755
index 00000000000..1dbb32b67a4
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/time.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * 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: @(#)time.h 5.12 (Berkeley) 3/9/91
+ * $Id$
+ */
+
+#ifndef _SYS_TIME_H_
+#define _SYS_TIME_H_
+
+#include <time.h>
+#include <sys/cdefs.h>
+
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* microseconds */
+};
+
+struct timezone {
+ int tz_minuteswest; /* minutes west of Greenwich */
+ int tz_dsttime; /* dst correction */
+};
+#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 */
+
+
+struct itimerval {
+ struct timeval it_interval; /* timer interval */
+ struct timeval it_value; /* current value */
+};
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+/*
+ * Functions
+ */
+__BEGIN_DECLS
+
+int gettimeofday __P_((struct timeval *, struct timezone *));
+
+__END_DECLS
+
+#endif
diff --git a/mit-pthreads/machdep/ultrix-4.2/timers.h b/mit-pthreads/machdep/ultrix-4.2/timers.h
new file mode 100755
index 00000000000..3c4d057976a
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/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/ultrix-4.2/wait.h b/mit-pthreads/machdep/ultrix-4.2/wait.h
new file mode 100755
index 00000000000..8114f7e461d
--- /dev/null
+++ b/mit-pthreads/machdep/ultrix-4.2/wait.h
@@ -0,0 +1,121 @@
+
+#ifndef _SYS_WAIT_H_
+#define _SYS_WAIT_H_
+
+#include <ansi_compat.h>
+#include <sys/cdefs.h>
+
+#if !defined(_POSIX_SOURCE)
+union wait {
+#else
+union __wait {
+#endif /* !defined(_POSIX_SOURCE) */
+#ifdef __vax
+ int w_status; /* used in syscall */
+#endif /* __vax */
+#ifdef __mips__
+ unsigned int w_status; /* used in syscall */
+#endif /* __mips */
+ /*
+ * Terminated process status.
+ */
+ struct {
+#ifdef __vax
+ unsigned short w_Termsig:7; /* termination signal */
+ unsigned short w_Coredump:1; /* core dump indicator */
+ unsigned short w_Retcode:8; /* exit code if w_termsig==0 */
+#endif /* __vax */
+#ifdef __mips__
+#ifdef __MIPSEL__
+ unsigned int w_Termsig:7; /* termination signal */
+ unsigned int w_Coredump:1; /* core dump indicator */
+ unsigned int w_Retcode:8; /* exit code if w_termsig==0 */
+ unsigned int w_Filler:16; /* pad to word boundary */
+#endif /* __MIPSEL */
+#ifdef __MIPSEB__
+ unsigned int w_Filler:16; /* pad to word boundary */
+ unsigned int w_Retcode:8; /* exit code if w_termsig==0 */
+ unsigned int w_Coredump:1; /* core dump indicator */
+ unsigned int w_Termsig:7; /* termination signal */
+#endif /* __MIPSEB */
+#endif /* __mips */
+ } w_T;
+ /*
+ * Stopped process status. Returned
+ * only for traced children unless requested
+ * with the WUNTRACED option bit.
+ */
+ struct {
+#ifdef __vax
+ unsigned short w_Stopval:8; /* == W_STOPPED if stopped */
+ unsigned short w_Stopsig:8; /* signal that stopped us */
+#endif /* __vax */
+#ifdef __mips__
+#ifdef __MIPSEL__
+ unsigned int w_Stopval:8; /* == W_STOPPED if stopped */
+ unsigned int w_Stopsig:8; /* signal that stopped us */
+ unsigned int w_Filler:16; /* pad to word boundary */
+#endif /* __MIPSEL */
+#ifdef __MIPSEB__
+ unsigned int w_Filler:16; /* pad to word boundary */
+ unsigned int w_Stopsig:8; /* signal that stopped us */
+ unsigned int w_Stopval:8; /* == W_STOPPED if stopped */
+#endif /* __MIPSEB */
+#endif /* __mips */
+ } w_S;
+};
+
+#if !defined(_POSIX_SOURCE)
+#define w_termsig w_T.w_Termsig
+#define w_coredump w_T.w_Coredump
+#define w_retcode w_T.w_Retcode
+#define w_stopval w_S.w_Stopval
+#define w_stopsig w_S.w_Stopsig
+#define WSTOPPED 0177 /* value of s.stopval if process is stopped */
+#endif /* !defined(_POSIX_SOURCE) */
+
+#ifdef WSTOPPED
+#define _WSTOPPED WSTOPPED
+#else
+#define _WSTOPPED 0177
+#endif
+
+/*
+ * Option bits for the second argument of wait3. WNOHANG causes the
+ * wait to not hang if there are no stopped or terminated processes, rather
+ * returning an error indication in this case (pid==0). WUNTRACED
+ * indicates that the caller should receive status about untraced children
+ * which stop due to signals. If children are stopped and a wait without
+ * this option is done, it is as though they were still running... nothing
+ * about them is returned.
+ */
+#define WNOHANG 1 /* dont hang in wait */
+#define WUNTRACED 2 /* tell about stopped, untraced children */
+
+/*
+ * Must cast as union wait * because POSIX defines the input to these macros
+ * as int.
+ */
+
+#ifdef _POSIX_SOURCE
+#define WIFSTOPPED(x) (((union __wait *)&(x))->w_S.w_Stopval == _WSTOPPED)
+#define WIFSIGNALED(x) (((union __wait *)&(x))->w_S.w_Stopval != _WSTOPPED && ((union __wait *)&(x))->w_T.w_Termsig != 0)
+#define WIFEXITED(x) (((union __wait *)&(x))->w_S.w_Stopval != _WSTOPPED && ((union __wait *)&(x))->w_T.w_Termsig == 0)
+#define WEXITSTATUS(x) (((union __wait *)&(x))->w_T.w_Retcode)
+#define WTERMSIG(x) (((union __wait *)&(x))->w_T.w_Termsig)
+#define WSTOPSIG(x) (((union __wait *)&(x))->w_S.w_Stopsig)
+#endif /* _POSIX_SOURCE */
+
+#if !defined(_POSIX_SOURCE)
+#define WIFSTOPPED(x) (((union wait *)&(x))->w_stopval == WSTOPPED)
+#define WIFSIGNALED(x) (((union wait *)&(x))->w_stopval != WSTOPPED && ((union wait *)&(x))->w_termsig != 0)
+#define WIFEXITED(x) (((union wait *)&(x))->w_stopval != WSTOPPED && ((union wait *)&(x))->w_termsig == 0)
+#define WEXITSTATUS(x) (((union wait *)&(x))->w_retcode)
+#define WTERMSIG(x) (((union wait *)&(x))->w_termsig)
+#define WSTOPSIG(x) (((union wait *)&(x))->w_stopsig)
+#endif /* !defined(_POSIX_SOURCE) */
+
+pid_t wait __P_((int *));
+pid_t waitpid __P_((pid_t, int *, int));
+
+#endif /* _SYS_WAIT_H_ */
diff --git a/mit-pthreads/machdep/unistd-i386-freebsd-1.1.h b/mit-pthreads/machdep/unistd-i386-freebsd-1.1.h
new file mode 100644
index 00000000000..033e70de5e5
--- /dev/null
+++ b/mit-pthreads/machdep/unistd-i386-freebsd-1.1.h
@@ -0,0 +1,178 @@
+/*-
+ * Copyright (c) 1991 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.
+ *
+ * @(#)unistd.h 5.13 (Berkeley) 6/17/91
+ */
+
+#ifndef _UNISTD_H_
+#define _UNISTD_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/unistd.h>
+
+#define STDIN_FILENO 0 /* standard input file descriptor */
+#define STDOUT_FILENO 1 /* standard output file descriptor */
+#define STDERR_FILENO 2 /* standard error file descriptor */
+
+#ifndef NULL
+#define NULL 0 /* null pointer constant */
+#endif
+
+typedef int ssize_t; /* count of bytes or error indication */
+
+__BEGIN_DECLS
+void _exit __P_((int));
+int access __P_((const char *, int));
+u_int alarm __P_((u_int));
+int chdir __P_((const char *));
+int chown __P_((const char *, uid_t, gid_t));
+int close __P_((int));
+char *cuserid __P_((char *));
+int dup __P_((int));
+int dup2 __P_((int, int));
+int execl __P_((const char *, const char *, ...));
+int execle __P_((const char *, const char *, ...));
+int execlp __P_((const char *, const char *, ...));
+int execv __P_((const char *, char * const *));
+int execve __P_((const char *, char * const *, char * const *));
+int execvp __P_((const char *, char * const *));
+pid_t fork __P_((void));
+long fpathconf __P_((int, int)); /* not yet */
+char *getcwd __P_((char *, size_t));
+gid_t getegid __P_((void));
+uid_t geteuid __P_((void));
+gid_t getgid __P_((void));
+int getgroups __P_((int, int *)); /* XXX (gid_t *) */
+char *getlogin __P_((void));
+pid_t getpgrp __P_((void));
+pid_t getpid __P_((void));
+pid_t getppid __P_((void));
+uid_t getuid __P_((void));
+int isatty __P_((int));
+int link __P_((const char *, const char *));
+off_t lseek __P_((int, off_t, int));
+long pathconf __P_((const char *, int)); /* not yet */
+int pause __P_((void));
+int pipe __P_((int *));
+ssize_t read __P_((int, void *, size_t));
+int rmdir __P_((const char *));
+int setgid __P_((gid_t));
+int setpgid __P_((pid_t, pid_t));
+pid_t setsid __P_((void));
+int setuid __P_((uid_t));
+u_int sleep __P_((u_int));
+long sysconf __P_((int)); /* not yet */
+pid_t tcgetpgrp __P_((int));
+int tcsetpgrp __P_((int, pid_t));
+char *ttyname __P_((int));
+int unlink __P_((const char *));
+ssize_t write __P_((int, const void *, size_t));
+
+#ifndef _POSIX_SOURCE
+
+/* structure timeval required for select() */
+#include <sys/time.h>
+
+int acct __P_((const char *));
+int async_daemon __P_((void));
+char *brk __P_((const char *));
+int chflags __P_((const char *, long));
+int chroot __P_((const char *));
+char *crypt __P_((const char *, const char *));
+int des_cipher __P_((const char *, char *, long, int));
+int des_setkey __P_((const char *key));
+int encrypt __P_((char *, int));
+void endusershell __P_((void));
+int exect __P_((const char *, char * const *, char * const *));
+int fchdir __P_((int));
+int fchflags __P_((int, long));
+int fchown __P_((int, uid_t, gid_t));
+int fsync __P_((int));
+int ftruncate __P_((int, off_t));
+int getdtablesize __P_((void));
+long gethostid __P_((void));
+int gethostname __P_((char *, int));
+mode_t getmode __P_((const void *, mode_t));
+int getpagesize __P_((void));
+char *getpass __P_((const char *));
+char *getusershell __P_((void));
+char *getwd __P_((char *)); /* obsoleted by getcwd() */
+int initgroups __P_((const char *, int));
+int mknod __P_((const char *, mode_t, dev_t));
+int mkstemp __P_((char *));
+char *mktemp __P_((char *));
+int nfssvc __P_((int));
+int nice __P_((int));
+void psignal __P_((u_int, const char *));
+extern char *sys_siglist[];
+int profil __P_((char *, int, int, int));
+int rcmd __P_((char **, int, const char *,
+ const char *, const char *, int *));
+char *re_comp __P_((const char *));
+int re_exec __P_((const char *));
+int readlink __P_((const char *, char *, int));
+int reboot __P_((int));
+int revoke __P_((const char *));
+int rresvport __P_((int *));
+int ruserok __P_((const char *, int, const char *, const char *));
+char *sbrk __P_((int));
+int select __P_((int, fd_set *, fd_set *, fd_set *, struct timeval *));
+int setegid __P_((gid_t));
+int seteuid __P_((uid_t));
+int setgroups __P_((int, const int *));
+void sethostid __P_((long));
+int sethostname __P_((const char *, int));
+int setkey __P_((const char *));
+int setlogin __P_((const char *));
+void *setmode __P_((const char *));
+int setpgrp __P_((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */
+int setregid __P_((int, int));
+int setreuid __P_((int, int));
+int setrgid __P_((gid_t));
+int setruid __P_((uid_t));
+void setusershell __P_((void));
+int swapon __P_((const char *));
+int symlink __P_((const char *, const char *));
+void sync __P_((void));
+int syscall __P_((int, ...));
+int truncate __P_((const char *, off_t));
+int ttyslot __P_((void));
+u_int ualarm __P_((u_int, u_int));
+void usleep __P_((u_int));
+void *valloc __P_((size_t)); /* obsoleted by malloc() */
+int vfork __P_((void));
+
+#endif /* !_POSIX_SOURCE */
+__END_DECLS
+
+#endif /* !_UNISTD_H_ */
diff --git a/mit-pthreads/machdep/unistd-i386-linux-1.0.h b/mit-pthreads/machdep/unistd-i386-linux-1.0.h
new file mode 100644
index 00000000000..e7a3c5de1e4
--- /dev/null
+++ b/mit-pthreads/machdep/unistd-i386-linux-1.0.h
@@ -0,0 +1,59 @@
+/*-
+ * Copyright (c) 1991 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.
+ *
+ * @(#)unistd.h 5.13 (Berkeley) 6/17/91
+ */
+
+#ifndef _UNISTD_H_
+#define _UNISTD_H_
+
+#include <features.h>
+
+/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
+#define _POSIX_VERSION 199009L
+#define _POSIX2_C_BIND 1
+#define _POSIX2_C_DEV 1
+#define _POSIX2_SW_DEV 1
+
+#define __need_size_t
+
+#include <posix_opt.h>
+#include <sys/types.h>
+#include <stddef.h>
+
+#define STDIN_FILENO 0 /* standard input file descriptor */
+#define STDOUT_FILENO 1 /* standard output file descriptor */
+#define STDERR_FILENO 2 /* standard error file descriptor */
+
+#include <pthread/unistd.h>
+
+#endif /* !_UNISTD_H_ */
diff --git a/mit-pthreads/machdep/unistd-i386-linux-2.0.h b/mit-pthreads/machdep/unistd-i386-linux-2.0.h
new file mode 100644
index 00000000000..e7a3c5de1e4
--- /dev/null
+++ b/mit-pthreads/machdep/unistd-i386-linux-2.0.h
@@ -0,0 +1,59 @@
+/*-
+ * Copyright (c) 1991 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.
+ *
+ * @(#)unistd.h 5.13 (Berkeley) 6/17/91
+ */
+
+#ifndef _UNISTD_H_
+#define _UNISTD_H_
+
+#include <features.h>
+
+/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988. */
+#define _POSIX_VERSION 199009L
+#define _POSIX2_C_BIND 1
+#define _POSIX2_C_DEV 1
+#define _POSIX2_SW_DEV 1
+
+#define __need_size_t
+
+#include <posix_opt.h>
+#include <sys/types.h>
+#include <stddef.h>
+
+#define STDIN_FILENO 0 /* standard input file descriptor */
+#define STDOUT_FILENO 1 /* standard output file descriptor */
+#define STDERR_FILENO 2 /* standard error file descriptor */
+
+#include <pthread/unistd.h>
+
+#endif /* !_UNISTD_H_ */
diff --git a/mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h b/mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h
new file mode 100644
index 00000000000..4d2161b628f
--- /dev/null
+++ b/mit-pthreads/machdep/unistd-sparc-sunos-4.1.3.h
@@ -0,0 +1,215 @@
+/*-
+ * Copyright (c) 1991 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: @(#)unistd.h 5.13 (Berkeley) 6/17/91
+ * $Id$
+ */
+
+#ifndef _UNISTD_H_
+#define _UNISTD_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#define _NO_STDIO_SIZE_T
+
+#define _SC_ARG_MAX 1 /* space for argv & envp */
+#define _SC_CHILD_MAX 2 /* maximum children per process??? */
+#define _SC_CLK_TCK 3 /* clock ticks/sec */
+#define _SC_NGROUPS_MAX 4 /* number of groups if multple supp. */
+#define _SC_OPEN_MAX 5 /* max open files per process */
+#define _SC_JOB_CONTROL 6 /* do we have job control */
+#define _SC_SAVED_IDS 7 /* do we have saved uid/gids */
+#define _SC_VERSION 8 /* POSIX version supported */
+
+#define _POSIX_JOB_CONTROL 1
+#define _POSIX_SAVED_IDS 1
+#define _POSIX_VERSION 198808
+
+#define _PC_LINK_MAX 1 /* max links to file/dir */
+#define _PC_MAX_CANON 2 /* max line length */
+#define _PC_MAX_INPUT 3 /* max "packet" to a tty device */
+#define _PC_NAME_MAX 4 /* max pathname component length */
+#define _PC_PATH_MAX 5 /* max pathname length */
+#define _PC_PIPE_BUF 6 /* size of a pipe */
+#define _PC_CHOWN_RESTRICTED 7 /* can we give away files */
+#define _PC_NO_TRUNC 8 /* trunc or error on >NAME_MAX */
+#define _PC_VDISABLE 9 /* best char to shut off tty c_cc */
+#define _PC_LAST 9 /* highest value of any _PC_* */
+
+
+#define STDIN_FILENO 0 /* standard input file descriptor */
+#define STDOUT_FILENO 1 /* standard output file descriptor */
+#define STDERR_FILENO 2 /* standard error file descriptor */
+
+#ifndef NULL
+#define NULL 0 /* null pointer constant */
+#endif
+
+typedef int ssize_t;
+
+__BEGIN_DECLS
+void _exit __P_((int));
+int access __P_((const char *, int));
+unsigned alarm __P_((unsigned));
+int chdir __P_((const char *));
+int chown __P_((const char *, uid_t, gid_t));
+int close __P_((int));
+size_t confstr __P_((int, char *, size_t));
+char *cuserid __P_((char *));
+int dup __P_((int));
+int dup2 __P_((int, int));
+int execl __P_((const char *, const char *, ...));
+int execle __P_((const char *, const char *, ...));
+int execlp __P_((const char *, const char *, ...));
+int execv __P_((const char *, char * const *));
+int execve __P_((const char *, char * const *, char * const *));
+int execvp __P_((const char *, char * const *));
+pid_t fork __P_((void));
+long fpathconf __P_((int, int)); /* not yet */
+char *getcwd __P_((char *, size_t));
+gid_t getegid __P_((void));
+uid_t geteuid __P_((void));
+gid_t getgid __P_((void));
+int getgroups __P_((int, int *)); /* XXX (gid_t *) */
+char *getlogin __P_((void));
+pid_t getpgrp __P_((void));
+pid_t getpid __P_((void));
+pid_t getppid __P_((void));
+uid_t getuid __P_((void));
+int isatty __P_((int));
+int link __P_((const char *, const char *));
+off_t lseek __P_((int, off_t, int));
+long pathconf __P_((const char *, int)); /* not yet */
+int pause __P_((void));
+int pipe __P_((int *));
+ssize_t read __P_((int, void *, size_t));
+int rmdir __P_((const char *));
+int setgid __P_((gid_t));
+int setpgid __P_((pid_t, pid_t));
+pid_t setsid __P_((void));
+int setuid __P_((uid_t));
+unsigned sleep __P_((unsigned));
+long sysconf __P_((int)); /* not yet */
+pid_t tcgetpgrp __P_((int));
+int tcsetpgrp __P_((int, pid_t));
+char *ttyname __P_((int));
+int unlink __P_((const char *));
+ssize_t write __P_((int, const void *, size_t));
+
+#ifndef _POSIX_SOURCE
+
+/* structure timeval required for select() */
+#include <sys/time.h>
+
+int acct __P_((const char *));
+int async_daemon __P_((void));
+char *brk __P_((const char *));
+int chflags __P_((const char *, long));
+int chroot __P_((const char *));
+char *crypt __P_((const char *, const char *));
+int des_cipher __P_((const char *, char *, long, int));
+int des_setkey __P_((const char *key));
+int encrypt __P_((char *, int));
+void endusershell __P_((void));
+int exect __P_((const char *, char * const *, char * const *));
+int fchdir __P_((int));
+int fchflags __P_((int, long));
+int fchown __P_((int, uid_t, gid_t));
+int fsync __P_((int));
+int ftruncate __P_((int, off_t));
+int getdomainname __P_((char *, int));
+int getdtablesize __P_((void));
+long gethostid __P_((void));
+int gethostname __P_((char *, int));
+mode_t getmode __P_((const void *, mode_t));
+int getpagesize __P_((void));
+char *getpass __P_((const char *));
+char *getusershell __P_((void));
+char *getwd __P_((char *)); /* obsoleted by getcwd() */
+int initgroups __P_((const char *, int));
+int mknod __P_((const char *, mode_t, dev_t));
+int mkstemp __P_((char *));
+char *mktemp __P_((char *));
+int nfssvc __P_((int));
+int nice __P_((int));
+void psignal __P_((u_int, const char *));
+extern const char *const sys_siglist[];
+int profil __P_((char *, int, int, int));
+int rcmd __P_((char **, int, const char *,
+ const char *, const char *, int *));
+char *re_comp __P_((const char *));
+int re_exec __P_((const char *));
+int readlink __P_((const char *, char *, int));
+int reboot __P_((int));
+int revoke __P_((const char *));
+int rresvport __P_((int *));
+int ruserok __P_((const char *, int, const char *, const char *));
+char *sbrk __P_((int));
+int select __P_((int, fd_set *, fd_set *, fd_set *, struct timeval *));
+int setdomainname __P_((const char *, int));
+int setegid __P_((gid_t));
+int seteuid __P_((uid_t));
+int setgroups __P_((int, const int *));
+void sethostid __P_((long));
+int sethostname __P_((const char *, int));
+int setkey __P_((const char *));
+int setlogin __P_((const char *));
+void *setmode __P_((const char *));
+int setpgrp __P_((pid_t pid, pid_t pgrp)); /* obsoleted by setpgid() */
+int setregid __P_((int, int));
+int setreuid __P_((int, int));
+int setrgid __P_((gid_t));
+int setruid __P_((uid_t));
+void setusershell __P_((void));
+int swapon __P_((const char *));
+int symlink __P_((const char *, const char *));
+void sync __P_((void));
+int syscall __P_((int, ...));
+int truncate __P_((const char *, off_t));
+int ttyslot __P_((void));
+u_int ualarm __P_((u_int, u_int));
+void usleep __P_((u_int));
+void *valloc __P_((size_t)); /* obsoleted by malloc() */
+pid_t vfork __P_((void));
+
+int getopt __P_((int, char * const *, const char *));
+extern char *optarg; /* getopt(3) external variables */
+extern int opterr;
+extern int optind;
+extern int optopt;
+int getsubopt __P_((char **, char * const *, char **));
+extern char *suboptarg; /* getsubopt(3) external variable */
+#endif /* !_POSIX_SOURCE */
+__END_DECLS
+
+#endif /* !_UNISTD_H_ */