summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWichert Akkerman <wichert@deephackmode.org>1999-02-19 00:21:36 +0000
committerWichert Akkerman <wichert@deephackmode.org>1999-02-19 00:21:36 +0000
commit76baf7c9f6dd61a15524ad43c1b690c252cf5b7c (patch)
treec54cba971a5ca31d262dbf292fdae19601b7833d
downloadstrace-76baf7c9f6dd61a15524ad43c1b690c252cf5b7c.tar.gz
Initial revision
-rw-r--r--COPYRIGHT30
-rw-r--r--CREDITS33
-rw-r--r--ChangeLog595
-rw-r--r--INSTALL181
-rw-r--r--Makefile.in105
-rw-r--r--NEWS45
-rw-r--r--PORTING70
-rw-r--r--README37
-rw-r--r--README-linux52
-rw-r--r--README-sunos485
-rw-r--r--README-svr412
-rw-r--r--TODO25
-rw-r--r--acconfig.h46
-rw-r--r--aclocal.m4211
-rw-r--r--bjm.c61
-rwxr-xr-xconfig.guess940
-rw-r--r--config.h.in169
-rwxr-xr-xconfig.sub955
-rwxr-xr-xconfigure2674
-rw-r--r--configure.in133
-rw-r--r--defs.h378
-rw-r--r--desc.c390
-rw-r--r--errnoent.sh42
-rw-r--r--file.c1302
-rwxr-xr-xinstall-sh238
-rw-r--r--io.c228
-rw-r--r--ioctl.c171
-rw-r--r--ioctlsort.c74
-rw-r--r--ipc.c354
-rw-r--r--linux/Makefile.in57
-rw-r--r--linux/alpha/Makefile.in57
-rw-r--r--linux/alpha/errnoent.h516
-rw-r--r--linux/alpha/ioctlent.h546
-rw-r--r--linux/alpha/ioctlent.sh98
-rw-r--r--linux/alpha/signalent.h32
-rw-r--r--linux/alpha/syscallent.h380
-rw-r--r--linux/dummy.h214
-rw-r--r--linux/errnoent.h516
-rw-r--r--linux/ioctlent.h519
-rw-r--r--linux/ioctlent.sh98
-rw-r--r--linux/powerpc/Makefile.in57
-rw-r--r--linux/powerpc/errnoent.h516
-rw-r--r--linux/powerpc/ioctlent.h668
-rw-r--r--linux/powerpc/ioctlent.sh98
-rw-r--r--linux/powerpc/signalent.h32
-rw-r--r--linux/powerpc/syscallent.h338
-rw-r--r--linux/powerpc/syscallent.sh73
-rw-r--r--linux/signalent.h32
-rw-r--r--linux/sparc/Makefile.in57
-rw-r--r--linux/sparc/dummy2.h282
-rw-r--r--linux/sparc/errnoent.h125
-rw-r--r--linux/sparc/errnoent1.h1
-rw-r--r--linux/sparc/gen.pl38
-rw-r--r--linux/sparc/ioctlent.h600
-rw-r--r--linux/sparc/ioctlent1.h1
-rw-r--r--linux/sparc/signalent.h32
-rw-r--r--linux/sparc/signalent1.h1
-rw-r--r--linux/sparc/syscall.h176
-rw-r--r--linux/sparc/syscall.h.2142
-rw-r--r--linux/sparc/syscall1.h501
-rw-r--r--linux/sparc/syscallent.h357
-rw-r--r--linux/sparc/syscallent1.h439
-rw-r--r--linux/syscall.h155
-rw-r--r--linux/syscallent.h284
-rw-r--r--mem.c338
-rw-r--r--net.c836
-rw-r--r--proc.c252
-rw-r--r--process.c1645
-rw-r--r--resource.c318
-rw-r--r--signal.c1528
-rw-r--r--signalent.sh55
-rw-r--r--sock.c83
-rw-r--r--strace.1544
-rw-r--r--strace.c1653
-rw-r--r--stream.c822
-rw-r--r--sunos4/Makefile.in56
-rw-r--r--sunos4/dummy.h212
-rw-r--r--sunos4/errnoent.h91
-rw-r--r--sunos4/ioctlent.h493
-rw-r--r--sunos4/ioctlent.sh124
-rw-r--r--sunos4/signalent.h32
-rw-r--r--sunos4/syscall.h175
-rw-r--r--sunos4/syscallent.h241
-rw-r--r--svr4/Makefile.in58
-rw-r--r--svr4/dummy.h276
-rw-r--r--svr4/errnoent.h152
-rw-r--r--svr4/ioctlent.h429
-rw-r--r--svr4/ioctlent.sh52
-rw-r--r--svr4/signalent.h36
-rw-r--r--svr4/syscall.h430
-rw-r--r--svr4/syscallent.h628
-rw-r--r--syscall.c1431
-rw-r--r--syscallent.sh73
-rw-r--r--system.c886
-rw-r--r--term.c380
-rw-r--r--test/Makefile9
-rw-r--r--test/fork.c10
-rw-r--r--test/procpollable.c33
-rw-r--r--test/sfd.c32
-rw-r--r--test/sig.c16
-rw-r--r--time.c232
-rw-r--r--util.c1381
-rw-r--r--version.c1
-rw-r--r--xlate.el80
104 files changed, 33797 insertions, 0 deletions
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644
index 000000000..671257f09
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,30 @@
+Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net>
+Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+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. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
diff --git a/CREDITS b/CREDITS
new file mode 100644
index 000000000..b3d1baa30
--- /dev/null
+++ b/CREDITS
@@ -0,0 +1,33 @@
+The primary authors of strace are:
+
+ Paul Kranenburg <pk@cs.few.eur.nl>
+ Branko Lankester <branko@hacktic.nl>
+ Rick Sladkey <jrs@world.std.com>
+
+Thanks to the follow people for contributing to strace by reporting
+bugs, providing fixes, providing information, providing resources or
+porting to new systems:
+
+ Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+ Marty Leisner <leisner@sdsp.mc.xerox.com>
+ Lupe Christoph <lupe@alanya.isar.muc.de>
+ Thanh Ma <tma@encore.com>
+ Keith Thompson <kst@alsys.com>
+ Roland Borde <bo@uebemc.siemens.de>
+ Matt Day <mday@artisoft.com>
+ Joe Ilacqua <spike@world.std.com>
+ Ju"rgen Fluk <louis@marco.de>
+ Bo Kullmar <bk@kullmar.se>
+ Leonard N. Zubkoff <lnz@dandelion.com>
+ Reuben Sumner <rasumner@undergrad.math.uwaterloo.ca>
+ Juergen Weigert <jnweiger@immd4.informatik.uni-erlangen.de>
+ Linus Torvalds <Linus.Torvalds@cs.Helsinki.FI>
+ Michael E Chastain <mec@duracef.shout.net>
+ Aaron Ucko <UCKO@VAX1.ROCKHURST.EDU>
+ David S. Miller <davem@caip.rutgers.edu>
+ Matthias Pfaller <leo@dachau.marco.de>
+ Thomas Bogendoerfer <tsbogend@bigbug.franken.de>
+ Richard Henderson <richard@twiddle.tamu.edu>
+ Tom Dyas <tdyas@eden.rutgers.edu>
+ Henrik Storner <storner@osiris.ping.dk>
+ David Mosberger-Tang <davidm@AZStarNet.com>
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 000000000..a239d0158
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,595 @@
+Sun Oct 27 22:28:00 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * util.c (umovestr) [LINUX]: Handle Linux like SunOS4
+ instead of SVR4. That is, read a few bytes at a time
+ to avoid overrunning the end of the stack.
+
+Fri May 31 01:48:49 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.1 is released.
+
+Thu May 23 01:04:43 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * aclocal.m4 (AC_DECL_SYS_ERRLIST): Try looking in stdio.h
+ as well since that's where glibc declares it. Go figure.
+ * signal.c (sys_sigreturn) [ALPHA]: Use sigcontext
+ instead of sigcontext_struct since glibc v5+ apparently
+ plays games with the native OS namespace.
+ From David Mosberger-Tang <davidm@AZStarNet.com>.
+
+Mon May 20 23:17:14 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.14 is released.
+
+ * aclocal.m4 (AC_STRUCT_MSG_CONTROL): New macro.
+ * configure.in: Add call to AC_STRUCT_MSG_CONTROL.
+ * net.c (printmsghdr): Handle BSD 4.3 and 4.4 msghdr members
+ differently.
+ Reported by Henrik Storner <storner@osiris.ping.dk>.
+
+ * configure.in: (AC_CHECK_{HEADERS,FUNCS}): Add checks for
+ sys/filio.h and sys/stream.h and remove check for poll.
+ * desc.c (decode_select, sys_select, sys_oldselect) [LINUX]:
+ Handle old and new styles of argument passing for select on Linux.
+ * ioctl.c, stream.c: Conditionalize stream code on presence of
+ sys/stream.h instead of poll because glibc implements poll but
+ not the rest of the stream interface.
+ * signal.c [LINUX]: Standardize on the name sigcontext_struct.
+ (sys_sigprocmask) [ALPHA]: Handle OSF flavor which is more like
+ sigsetmask.
+ * term.c (term_ioctl): Use _VMIN, if present, for TC{G,S}ETA*.
+ * util.c (umoven, umovestr): Move data in long-sized chunks
+ at a time, instead of hard coding it to be 4.
+ From David Mosberger-Tang <davidm@AZStarNet.com>.
+
+Mon May 20 01:19:36 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.13 is released.
+
+ * configure.in (AC_CHECK_HEADERS): Add check for asm/sigcontext.h.
+ * signal.c [HAVE_ASM_SIGCONTEXT_H]: Conditionally include
+ asm/sigcontext.h to define sigcontext_struct and don't define it
+ locally if the header is present.
+
+ * syscall.c (nerrnos{0,2}): Correct size computation.
+
+ * Makefile.in: Remove dependencies and rules relating to files
+ normally found in the os directory. Because of the new scheme we
+ don't know precisely where they come from. Sigh.
+ * signalent.sh: Make it work for sunos4, linux, and svr4.
+ * {sunos4,linux{,/alpha},svr4}/Makefile.in: Make rules correspond
+ to traditional make syntax. Add signalent.h to files which can
+ unconditionally be rebuilt. Prevent signalent.h from being
+ unconditionally being rebuilt since it's customized.
+ * {sunos4,linux{,/alpha},svr4}/{ioctlent,errnoent,signalent}.h:
+ Use versions built by {ioctlent,errnoent,signaltent}.sh.
+ * sunos4/ioctlent.sh: Work around sprintf troubles with SunOS
+ 4.1.4 and gcc 2.7.2.
+
+Sun May 19 17:14:09 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * configure.in, Makefile.in: Add OSARCH concept to finish
+ build support for the alpha.
+ * Makefile.in, linux/Makefile.in: Rewrite clean, distclean,
+ and maintainer-clean rules.
+ * defs.h, ioctlsort.c: Make ioctl code member unsigned.
+ * ioctl.c, ioctlsort.c (compare): Perform explicit checking
+ for less, greater, and equal since subtraction on two's
+ complement numbers isn't an order relation (it isn't transitive)!
+ * linux/Makefile.in: Add rules for the signalent.h file.
+ * linux/alpha/Makefile.in: New file.
+
+Sun May 19 01:12:28 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.12 is released.
+
+ * linux{,alpha}/ioctlent.sh: Tweak for recent kernels.
+ From Michael E Chastain <mec@duracef.shout.net>.
+
+ * defs.h (SUPPORTED_PERSONALITES, DEFAULT_PERSONALITY): New.
+ * syscall.c (set_personality): New.
+ * strace.c (main): Call set_personality.
+ * defs.h, syscall.c, ioctl.c, signal.c: Make sysent, errnoent,
+ ioctlent, and signalent indirect pointers and redirect them
+ based on personality.
+ * {sunos4,svr4,linux{,/alpha}}/signalent.h: New files.
+ Suggested by Tom Dyas <tdyas@eden.rutgers.edu>.
+
+ * util.c (upeek): Handle case where ptrace returns a long
+ and sizeof(long) != sizeof(int).
+ From Richard Henderson <richard@twiddle.tamu.edu>
+
+Fri May 17 21:03:36 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.11 is released.
+
+ * many files: Fix more printf warnings for other platforms.
+
+ * ipc.c (sys_msgrcv) [LINUX]: Conditionalize definition of ipc_wrapper.
+
+ * linux/dummy.h: Handle missing library support for {send,recv}msg.
+ Reported by Thomas Bogendoerfer <tsbogend@bigbug.franken.de>.
+
+ * linux/syscall.h (sys_utimes): Fix a typo in the declaration.
+ From Thomas Bogendoerfer <tsbogend@bigbug.franken.de>.
+
+Fri May 17 00:50:06 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.10 is released.
+
+ * Makfile.in: Add os/arch to includes so that a given arch
+ (like alpha) can override the native arch (like i386).
+ * configure.in: Check for sendmsg.
+
+ * net.c: Make sendmsg and recvmsg dependent on an autoconf
+ test. Reported by Michael E Chastain <mec@duracef.shout.net>.
+
+ * acconfig.h, configure.in: Detect the alpha.
+ * ioctl.c: Handle the alpha.
+ * defs.h: Make some members long for the alpha. Define
+ some register nicknames. Add support for WAITEXECVE.
+ * file.c [ALPHA]: Support the alpha for statfs. Add
+ osf_statfs and osf_fstatfs for the alpha. Make damn sure
+ major and minor results are suitable for passing to printf.
+ * signal.c, syscall.c: Support the alpha.
+ * process.c: Add alpha user offsets.
+ * most files: Use %l? for printf arguments since
+ most are now longs for the alpha.
+ * linux/alpha/{errnoent.h,ioctlent.{h,sh},syscallent.h}:
+ New for the alpha.
+ From Thomas Bogendoerfer <tsbogend@bigbug.franken.de>.
+
+Wed May 15 00:29:37 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.9 is released.
+
+ * config.in, config.sub, install-sh: Upgrade to autoconf 2.10.
+
+ * linux/dummy.h, linux/syscallent.h, linux/syscall.h: Add recent
+ Linux kernel version system calls.
+
+Wed Mar 13 01:03:38 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * ipc.c [SUNOS4]: Add SunOS support for decoding IPC calls.
+ * syscall.c [SUNOS4]: Compile decode_subcall on SunOS and
+ decode IPC calls using it.
+ * sunos4/dummy.h: Alias sys_semop to printargs.
+ * sunos4/syscall.h: Add new pseudo syscalls for IPC.
+ * sunos4/syscallent.h: Include new subcalls for IPC.
+ From Matthias Pfaller <leo@dachau.marco.de>.
+
+Tue Feb 13 22:08:25 1996 J. Richard Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.8 is released.
+
+ * time.c [LINUX]: Explicitly include linux/version.h.
+
+ * strace.c (main): Don't let them even *try* to
+ get strace to attach to itself since some systems
+ don't handle this case very gracefully.
+ Reported by David S. Miller <davem@caip.rutgers.edu>.
+
+ * Makefile.in (distclean): Fix it for subdirectories.
+
+ * sunos4/syscallent.h, svr4/syscallent.h: Fill in the new
+ sys_flags member for each defined system call.
+
+Fri Dec 8 01:17:28 1995 Rick Sladkey <jrs@world.std.com>
+
+ * defs.h (TRACE_*): New flags to describe what class
+ of system call each system call is.
+ (sysent): Add sys_flags member.
+ * syscall.c (sysent): Define (and later undef) abbreviations
+ for the system call class flags.
+ (lookup_class): New function to translate strings to
+ system call class flags.
+ (qualify): Handle new system call class mechanism.
+ * linux/syscallent.h: Fill in the new sys_flags member
+ for each defined system call.
+
+ * defs.h (print_sock): Remove redundant and non-K&R C
+ compatible prototype. From Juergen Weigert
+ <jnweiger@immd4.informatik.uni-erlangen.de>.
+
+Thu Dec 7 01:17:40 1995 Rick Sladkey <jrs@world.std.com>
+
+ * linux/ioctlent.sh: Tweak to improve ioctl accuracy.
+ From Michael E Chastain <mec@duracef.shout.net>.
+
+ * system.c (includes) [LINUX]: Add linux/nfs.h for recent
+ kernels. From Michael E Chastain <mec@duracef.shout.net>.
+
+Wed Dec 6 21:52:28 1995 Rick Sladkey <jrs@world.std.com>
+
+ * file.c (sprintfstype): Enclose string result in double
+ quotes.
+
+ * time.c (sys_adjtimex) [LINUX]: Conditionalize
+ constantly evolving timex structure.
+ From Aaron Ucko <UCKO@VAX1.ROCKHURST.EDU>.
+
+ * defs.h, syscall.c, strace.c: Rename syscall to
+ trace_syscall and change prototype and all callers
+ because of broken Linux shared libraries.
+ From Aaron Ucko <UCKO@VAX1.ROCKHURST.EDU>.
+
+ * Makefile.in (clean): Check for a file with test -f not
+ test -d. From Aaron Ucko <UCKO@VAX1.ROCKHURST.EDU>.
+
+Tue Sep 26 02:32:31 1995 Rick Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.7 is released.
+
+ * util.c (string_quote): Fix thinko which caused core
+ dumps for strings with quotes in them.
+ Reported by Marty Leisner <leisner@sdsp.mc.xerox.com>.
+
+ * linux/Makefile.in (errnoent.h rule): Grab all errno.h
+ files from /usr/include, not just the linux one.
+ From Michael E Chastain <mec@duracef.shout.net>.
+
+ * linux/errnoent.sh: Total rewrite to handle more ioctls with
+ fewer false positives on more kernel flavors.
+ From Michael E Chastain <mec@duracef.shout.net>.
+
+Mon Sep 4 01:29:22 1995 Rick Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.6 is released.
+
+ * linux/dummy.h, linux/syscall.h, linux/syscallent.h: Add
+ sys_msync.
+ * mem.c (mctl_funcs, mctl_lockas, sys_mctl): Conditionalize
+ on MC_SYNC instead of HAVE_MCTL.
+ (mctl_sync): Conditionalize on MS_ASYNC instead of HAVE_MCTL.
+ (sys_msync): New function.
+
+Sat Sep 2 12:06:04 1995 Rick Sladkey <jrs@world.std.com>
+
+ * linux/dummy.h, linux/syscall.h, linux/syscallent.h: Add
+ sys_flock and sys_getdents.
+ * desc.c (flockcmds, sys_flock): Conditionalize on LOCK_SH
+ not SUNOS4.
+ * file.c (sys_getdents): Define unconditionally and handle
+ LINUX case.
+ * strace.c (main): Disallow username option unless both real
+ and effective uids are root.
+
+Wed Aug 30 01:29:58 1995 Rick Sladkey <jrs@world.std.com>
+
+ * strace.c (main): Ensure that run_uid and run_gid are
+ always set to something meaningful.
+ (main, newoutf) [!SVR4]: Swap real and effective uids while
+ opening any output files.
+ (main) [!SVR4]: Treat effective uid of root as a request
+ to handle suid binaries correctly using the real uid of
+ the invoking user.
+
+Sat Aug 19 00:06:08 1995 Rick Sladkey <jrs@world.std.com>
+
+ * Makefile.in: Add `|| true' to clean rule because
+ although GNU make 3.74 uses `sh -c' to invoke commands
+ every other make in the world uses `sh -ec'.
+
+ * syscall.c (syscall) [SVR4, MIPS]: The fifth and subsequent
+ arguments appear to be stored on the stack, not in the
+ registers following A3 (empirical result).
+
+ * defs.h: Add prototype for printsock.
+ * svr4/dummy.h: Remove generic handling of sys_mount.
+ * system.c [SVR4, MIPS]: Include several system headers to cleanly
+ get access to SGI mount information.
+ (mount_flags, nfs_flags) [SVR4, MIPS]: New objects.
+ (sys_mount) [SVR4, MIPS]: New function.
+ (sys_mount) [SVR4, !MIPS]: New function.
+
+Tue Jul 4 00:30:34 1995 Rick Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.5 is released.
+
+ * desc.c, resource.c, strace.c, syscall.c, time.c: Cast tv_sec and
+ tv_usec members to long when using printf.
+
+ * ipc.c: Omit define of __KERNEL__.
+ ({MSG,SEM,SHM}_{STAT,INFO}): Explicitly define those things we
+ want which __KERNEL__ used to provide.
+ (sys_msgrcv): Change reference to ipc_kludge structure to
+ look-alike ipc_wrapper to avoid dependence on __KERNEL__.
+
+ mem.c (mmap_flags) [MAP_{GROWSDOWN,DENYWRITE,EXECUTABLE}]: Add
+ Linux specific options.
+
+ syscall.c: Use SYS_ERRLIST_DECLARED instead of guessing.
+ [E{RESTART{SYS,NO{INTR,HAND}},NOIOCTLCMD}]: Explicitly define
+ instead of depending of __KERNEL__.
+
+ term.c: Cast c_{i,o,c,l}flag to long when using printf.
+
+Tue Jun 6 00:27:48 1995 Rick Sladkey <jrs@world.std.com>
+
+ * aclocal.m4 (AC_DECL_SYS_ERRLIST, AC_DECL__SYS_SIGLIST): New.
+ * configure.in: Call AC_DECL_SYS_ERRLIST, AC_DECL_SYS_SIGLIST,
+ and AC_DECL__SYS_SIGLIST.
+ * acconfig.h (SYS_ERRLIST_DECLARED): New.
+ * strace.c (strerror): Use SYS_ERRLIST_DECLARED.
+ (strsignal): Use SYS_SIGLIST_DECLARED.
+
+ net.c (sys_socket): Omit inadvertent surplus comma when
+ protocol family isn't PF_INET.
+
+ util.c (dumpstr): Fix incorrect printing of one too many
+ characters when the length is not an even multiple of 16 bytes.
+ Reported by Juergen Weigert
+ <jnweiger@immd4.informatik.uni-erlangen.de>.
+
+Thu May 4 23:37:47 1995 Rick Sladkey <jrs@world.std.com>
+
+ * ioctl.c (compare): Change prototype to match POSIX qsort.
+ * signal.c (sigishandled) [SVR4]: Omit everything after return.
+ * strace.c (trace) [SVR4]: Break out of for loop instead of
+ returning when finished so final return statement is executed.
+ * syscall.c (internal_syscall): Add more SYS_wait* variations.
+ (syscall) [LINUX]: Correct typo which commented out the M68K
+ argument to ifdef.
+ * util.c (printstr): Cast unsigned char pointer argument
+ to char pointer in umovestr call.
+ (dumpstr): Likewise for umoven.
+
+Wed May 3 01:10:56 1995 Rick Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.4 is released.
+
+ * signal.c (sys_sigblock): Move after the definition of
+ sys_sigsetmask that it calls to avoid an implicit declaration.
+ * stream.c (transport_user_options, transport_server_options):
+ Only needed if TI_BIND is defined.
+ * configure.in: Add -Wno-implicit to WARNFLAGS on SunOS 4.x.
+
+ * process.c (internal_fork) [SVR4]: Fix a typo that omitted
+ the tcp arguement from the call to exiting. Add getrval2
+ check so no fork processing is done in the child.
+ (printwaitn): Initialize exited so that its value is defined
+ for all flows of execution.
+
+Tue May 2 22:39:42 1995 Rick Sladkey <jrs@world.std.com>
+
+ * linux/dummy.h: Add aliases for sysfs, personality, afs_syscall,
+ setfsuid, setfsgid, and _llseek syscalls.
+ * linux/syscall.h: Add prototypes for them.
+ * linux/syscallent.h: Add them to the syscall entries table.
+ * system.c (headers) [LINUX]: Include linux/unistd.h to get __NR_*
+ defines and conditionally include linux/personality.h if
+ __NR_personality is defined.
+ (personality_options) [LINUX]: New table.
+ (sys_personality) [LINUX]: New function.
+
+Tue May 2 00:20:39 1995 Rick Sladkey <jrs@world.std.com>
+
+ * strace.c (trace) [!SVR4]: Change forever loop to one predicated
+ on the number of traced processes so that we can have untraced
+ children (e.g. via popen).
+
+ * strace (main) [!SVR4]: Call fake_execve to get the actual
+ exec and its arguments into the trace.
+ (environ): Declare it.
+ * process.c (fake_execve): New function.
+ (headers): Include sys/syscall.h to get SYS_* defines.
+
+ * process.c (sys_execv, sys_execve): Surround argument annotations
+ with C comment delimiters.
+ (printargv, printargc): The arg vector is an array of char pointers
+ not ints.
+
+ * strace.c (printleader): Also check for multiple -p arguments
+ when deciding whether to print the pid field.
+
+ * strace.c (strerror) [!HAVE_STRERROR]: New function.
+ * defs.h (strerror, strsignal): Add these prototypes if we provide
+ the functions.
+ * configure.in (AC_CHECK_FUNCS): Add strerror.
+
+ * strace.c (main, proc_poller): Add SIGPIPE to the list of caught
+ and blocked signals.
+
+ * strace.c (main): Add username option. Verify they are root before
+ letting them use it. Look up the ids in the password file. Set
+ them just before executing the program.
+ From Reuben Sumner <rasumner@undergrad.math.uwaterloo.ca>.
+
+Sat Apr 29 00:09:56 1995 Rick Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.3 is released.
+
+ * system.c (mount_flags) [LINUX]: Omit duplicated MS_NOSUID entry.
+ From Reuben Sumner <rasumner@undergrad.math.uwaterloo.ca>.
+
+ * strace.c (outfname): Initialize to NULL.
+ (main): Defer output file processing until after arguments.
+ Allow either a pipe or a bang for command arguments.
+ Check if outfname is NULL instead of checking outf for stderr.
+ Reinitialize each startup TCB's outf to fix -p/-o ordering bug.
+ (droptcb): Reset close TCB's outf to NULL instead of stderr.
+ (tprintf): Avoid calling vfprintf if outf is NULL.
+
+ * strace.c (main): Use popen if -o argument begins with a pipe.
+ From Marty Leisner <leisner@sdsp.mc.xerox.com>.
+
+ * process.c (printstatus): Fix a typo where WIFSIGNALED was meant
+ but WIFSTOPPED was used.
+
+ * Makefile.in: Add an EXTRA_DEFS variable and use it in the .c.o
+ rule to prevent the comment from being untrue.
+
+Fri Apr 28 22:01:56 1995 Rick Sladkey <jrs@world.std.com>
+
+ * strace.c (sys_exit): Move follow fork code to internal_exit.
+ (sys_fork): Move follow fork code to internal_fork.
+ (sys_execv, sys_execve): Move follow fork code to internal_exec.
+ (sys_waitpid, sys_wait4): Move follow fork code to internal_wait.
+ (vforking): Remove this static variable and check scno in
+ internal_fork instead.
+ (internal_exit, internal_fork, internal_exec, internal_wait): New
+ functions.
+ * defs.h: Add prototypes for the new internal_* functions.
+ * syscall.c (syscall): Move syscall entering trace qualifier check
+ and reprint checking after context decoding and precede them with
+ a call to internal_syscall. Precede syscall exiting trace
+ qualifier check with a call to internal_syscall.
+ (internal_syscall): New function.
+
+ * defs.h (struct tcb): Make scno signed.
+ * strace.c (syscall) Make u_error signed.
+ [LINUX, I386]: Avoid unsigned cast in eax check.
+ * syscall.c (sys_indir): Make i, scno, and nargs signed.
+ * desc.c (sys_select): Make cumlen unsigned
+
+Mon Apr 24 23:52:47 1995 Rick Sladkey <jrs@world.std.com>
+
+ * net.c (socktypes): Add SOCK_PACKET.
+
+Sun Apr 2 23:50:39 1995 Rick Sladkey <jrs@world.std.com>
+
+ * Makefile (clean): Check explicitly for a Makefile in subdirs
+ before running make in them.
+
+Sun Mar 26 12:37:21 1995 Rick Sladkey <jrs@world.std.com>
+
+ * strace.c [MIPS] (proc_open): Conditionalize run on MIPS.
+ [MIPS] (detach): Initialize error for MIPS case.
+ (trace): Initialize ioctl_result and ioctl_errno for overly helpful
+ compilers.
+ * syscall.c (decode_subcall): Move variable i into conditionals
+ that use use it.
+ * system.c (syssgi_options): Conditionalize SGI_RECVLMSG and
+ SGI_SET_FPDEBUG that SGI decided to drop. I don't have the stomach
+ to change them all.
+ * term.c (term_ioctl): Force [c_[iocl]flags members to long before
+ printing since we don't know what the size of their type is.
+ * util.c [SVR4, MIPS] (umoven): Prevent MIPS from using pread even
+ if autoconf detects it since it seems to either not work or do
+ something else entirely on Irix 5.3.
+
+Sun Mar 26 00:01:11 1995 Rick Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.2 is released.
+ * linux/dummy.h: Make sys_fchdir like sys_close instead of printargs
+ so that the file descriptor arg is decimal.
+
+Sat Mar 25 22:50:13 1995 Rick Sladkey <jrs@world.std.com>
+
+ * net.c [LINUX] (protocols): Explicitly define all IPPROTO_* entries
+ because on Linux they are enumerators.
+
+ * system.c [LINUX] (mount_flags): Handle renaming of MS_SYNC to
+ MS_SYNCHRONOUS.
+
+ * util.c (printxval): When there is no translation, print the actual
+ number first and the the default value as a C comment.
+
+ * net.c (sys_send, sys_sendto, sys_sendmsg, sys_getsockopt,
+ sys_setsockopt): Change first argument from unsigned to signed to
+ cater to the frequent practice of calling system calls with a file
+ descriptor of -1.
+ * mem.c (sys_mmap): Likewise.
+
+Sun Mar 19 13:53:52 1995 Rick Sladkey <jrs@world.std.com>
+
+ * signal.c [LINUX] (signalent): Handle old and new values of SIGIO.
+
+Sun Dec 11 22:51:51 1994 Rick Sladkey <jrs@world.std.com>
+
+ * version.c: Version 3.0.1 is released.
+ * Makefile.in, configure.in, aclocal.m4: Changes for autoconf 2.0.
+ * config.guess, config.guess: Update from the FSF.
+ * install-sh: New from the FSF.
+
+Mon Dec 5 20:51:29 1994 Rick Sladkey <jrs@world.std.com>
+
+ * Makefile.in: Add m68k arch.
+ * acconfig.h (M68K): Add m68k define.
+ * configure.in: Add detection of arch m68k.
+ * process.c [M68K] (struct_user_offsets): Support m68k registers and
+ offsets.
+ * signal.c [M68K] (sigcontext_struct): Support m68k sigcontext
+ structure.
+ [M68K] (sys_sigreturn): Support m68k sigreturn handling.
+ * syscall.c [M68K] (syscall): Support m68k syscall number register
+ and errno in d0 instead of eax.
+ * util.c [M68K] (getpc, printcall, setbpt, clearbpt): Support m68k
+ program counter in PT_PC instead of EIP.
+ [M68K] (LOOP): Support m68k loop instruction.
+ From Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
+
+ * mem.c [MAP_ANONYMOUS] (mmap_flags): Correct inadvertent reference
+ to MAP_FIXED instead of MAP_ANONYMOUS.
+ From Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
+
+ * signal.c [LINUX] (signalent): Signal 30 is now SIGPWR.
+ From Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
+
+Mon Dec 5 01:05:46 1994 Rick Sladkey <jrs@world.std.com>
+
+ * defs.h (tprintf): Fix typo in non-gcc ansi prototype for tprintf.
+ Reported by Thanh Ma <tma@encore.com>.
+
+ * strace.c (cleanup): Send SIGCONT before SIGTERM because Linux
+ 1.1.62 doesn't continue a traced child when the parent exits.
+ Reported by Matt Day <mday@artisoft.com>.
+
+ * system.c [LINUX]: Include netinet/in.h before arpa/inet.h.
+
+ * util.c (printstr): Fix longstanding bug in notating string
+ continuation.
+
+ * strace.c [SVR4] (proc_open): Specifically wait for the child the
+ child to go into the execve syscall to avoid spurious traces.
+ [LINUX] (detach): Conditionalize the status variable.
+
+Sun Dec 4 23:21:42 1994 Rick Sladkey <jrs@world.std.com>
+
+ * Makefile.in: Add mips arch.
+ * acconfig.h (MIPS): Add mips define.
+ * configure.in: Add detection of opsys irix5 and arch mips. Check
+ for prctl function.
+ Check for sys/sysconfig.h header.
+ * defs.h (MAX_ARGS): Bump maximum syscall arguments from 8 to 32.
+ * file.c [SVR4]: Include sys/cred.h.
+ (access_flags): Update access flags for SGI.
+ (sprinttime): Change type of sprinttime argument from unsigned
+ long to time_t.
+ * process.c [HAVE_PRCTL]: Include sys/prctl.h.
+ [HAVE_PRCTL] (prctl_options, sys_prctl): New for SGI.
+ (printsiginfo): Conditionally compile SI_TIMER and SI_MESGQ.
+ Cast si_band member to long before printing.
+ * signal.c (sigact_flags): Add _SA_BSDCALL for SGI.
+ (sigprocmaskcmds): Add SIG_SETMASK32 for SGI.
+ * strace.c [SVR4] [MIPS]:
+ (foobar): New dummy signal handler.
+ (main): Install a dummy signal handler in the child before pausing
+ to work around an SGI bug in PRSABORT.
+ (proc_open): Send a interrupt to the child instead of aborting the
+ syscall which doesn't work on Irix5.2.
+ * svr4/dummy.h: Add new unfinished SGI syscalls
+ (e.g. sys_sysmp, sys_sginap, etc.). Handle some SGI syscalls like
+ existing calls (e.g. sys_ksigaction like sys_sigaction).
+ Printargs does the print thing for sys_sethostid.
+ * svr4/syscall.h: Declare all new SGI syscalls.
+ (SGI_KLUDGE): Define syscall table starting index to be 1 for SGI
+ and add it to all subcall entry points.
+ (SYS_pgrpsys_subcall, SYS_sigcall_subcall, SYS_context): Don't
+ decode as subcalls on MIPS. Instead, use the normal syscalls.
+ * svr4/syscallent.h [MIPS]: Lead syscall table with a dummy entry
+ since SGI syscall numbers are off by one.
+ [MIPS] (sys_pgrpsys): Rename to sys_setpgrp on SGI.
+ [MIPS] (sys_xenix): Rename to sys_syssgi on SGI.
+ [MIPS] (sys_sysmachine): Rename to sys_sysmips on SGI.
+ [MIPS]: Conditionalize SVR4 extension into SGI and Solaris classes.
+ * syscall.c (dumpio): Validate descriptor against MAX_QUALS.
+ [HAVE_PR_SYSCALL] (syscall): Conditionalize SYS_vfork.
+ [MIPS] (syscall): Add SGI section for decoding u_error and u_rval.
+ Add workaround for broken SGI pr_sysarg on syscall entry.
+ [SVR4] (syscall): Conditionalize subcall decoding for
+ SYS_ptrpsys_subcall, SYS_sigcall_subcall and SYS_context_subcall.
+ [SVR4] [MIPS] (getrval2): Handle SGI.
+ * syscallent.sh: Dork the sed line to be choosier about SYS_ lines.
+ * system.c [HAVE_SYSCONFIG_H]: Include sys/sysconfig.h.
+ [MIPS] (syssgi_options, sys_syssgi): New for SGI.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 000000000..a2c8722cc
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,181 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 000000000..5cf059b75
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,105 @@
+# Makefile.in -- strace Makefile prototype -*- Makefile -*-
+#
+# $Id$
+#
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+CC = @CC@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+DEFS = @DEFS@
+LDLIBS = @LIBS@
+
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+WARNFLAGS = @WARNFLAGS@
+
+# OS is one of `linux', `sunos4', or `svr4'.
+OS = @opsys@
+# ARCH is one of `i386', `m68k', `sparc', or `mips'.
+ARCH = @arch@
+# OSARCH is OS/ARCH if it exists, otherwise just OS.
+OSARCH = @osarch@
+
+# You may define any of MAX_PROCS, DEFAULT_STRLEN, DEFAULT_ACOLUMN,
+# or DEFAULT_SORTBY here.
+EXTRA_DEFS =
+
+# Where include files are located, useful for cross-compiling.
+includedir = @includedir@
+
+# Where to install the program:
+# I recommend `/usr' for Linux, `/usr/local' for the others.
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = $(exec_prefix)/bin
+man1dir = $(prefix)/man/man1
+man1ext = .1
+
+SHELL = /bin/sh
+
+INCLUDES = -I. -I$(OS)/$(ARCH) -I$(srcdir)/$(OS)/$(ARCH) -I$(OS) -I$(srcdir)/$(OS)
+SUBDIRS = $(OSARCH)
+ALL_SUBDIRS = test linux linux/alpha linux/powerpc sunos4 svr4
+OBJ = strace.o version.o syscall.o util.o \
+ desc.o file.o ipc.o io.o ioctl.o mem.o net.o process.o bjm.o \
+ resource.o signal.o sock.o system.o term.o time.o proc.o stream.o
+
+all: strace
+
+strace: $(OBJ)
+ $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS)
+
+install: all
+ $(INSTALL_PROGRAM) strace $(bindir)/strace
+ $(INSTALL_DATA) $(srcdir)/strace.1 $(man1dir)/strace$(man1ext)
+
+clean: clean-local
+ for i in $(ALL_SUBDIRS); do \
+ (test -f $$i/Makefile && cd ./$$i && $(MAKE) $@ || true); \
+ done; exit 0
+
+clean-local:
+ rm -f *.o a.out core strace make.out
+
+distclean: distclean-local
+ for i in $(ALL_SUBDIRS); do \
+ (test -f $$i/Makefile && cd ./$$i && $(MAKE) $@ || true); \
+ done; exit 0
+
+distclean-local: clean-local
+ rm -f machine
+ rm -f Makefile config.h config.status config.cache config.log
+
+maintainer-clean: maintainter-clean-local
+ for i in $(ALL_SUBDIRS); do \
+ (test -f $$i/Makefile && cd ./$$i && $(MAKE) $@ || true); \
+ done; exit 0
+
+maintainer-clean-local: distclean-local
+
+.c.o:
+ $(CC) $(WARNFLAGS) $(DEFS) $(EXTRA_DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $<
+
+desc.o: desc.c defs.h config.h
+file.o: file.c defs.h config.h
+io.o: io.c defs.h config.h
+ioctl.o: ioctl.c defs.h config.h
+mem.o: mem.c defs.h config.h
+net.o: net.c defs.h config.h
+process.o: process.c defs.h config.h
+resource.o: resource.c defs.h config.h
+signal.o: signal.c defs.h config.h
+socket.o: socket.c defs.h config.h
+strace.o: strace.c defs.h config.h
+syscall.o: syscall.c defs.h config.h
+system.o: system.c defs.h config.h
+time.o: time.c defs.h config.h
+util.o: util.c defs.h config.h
diff --git a/NEWS b/NEWS
new file mode 100644
index 000000000..63fd5ddd3
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,45 @@
+Changes in version 3.1
+======================
+
+* Irix5 is supported
+* Linux 68k is supported
+* Linux alpha is supported
+* configure is upgraded to autoconf 2.x
+* using -f in combination with -e now works correctly
+* output can be piped to a program
+* tracing setuid programs works better
+* it is now reasonable to install strace setuid to root in some circumstances
+* new useful tracing names like file and process to trace whole
+ classes of system calls, e.g. -efile traces all system calls that
+ take a file name as an argument
+* IPC calls on SunOS 4.1.x are decoded
+* Linux program memory is reliably dereferenced
+* Linux decodes at least the name of all syscalls as of pre2.0.4
+* various cosmetic changes and bug fixes
+
+Changes from versions 2.x to version 3.0
+========================================
+
+* filename arguments are neither abbreviated nor stringified
+* string arguments are now true C strings using octal instead of hex by default
+* preprocessor constants are never shortened (e.g. was RDONLY => now O_RDONLY)
+* by default the output for multiple processes now goes into one file
+* all structures, vectors, bitsets, etc. use consistent output formats
+* the -c option now means count calls, -i does what the old -c used to do
+
+New Features in version 3.0
+===========================
+
+* non-ascii strings can be optionally printed entirely in hex
+* the output format is readable when mutiple processes are generating output
+* exit values are printed in an alignment column
+* is is possible to suppress messages about attaching and detaching
+* various tracing features can be enabled on a per syscall/signal/desc basis
+* selective tracing of syscalls
+* selective printing of syscall structures
+* selective abbreviation of long structures on a per syscall basis
+* selective printing of raw syscall arguments and results
+* selective tracing of signals
+* selective dumping of all I/O read from file descriptors
+* selective dumping of all I/O written to file descriptors
+* optional counting of time, calls, and errors for each syscall
diff --git a/PORTING b/PORTING
new file mode 100644
index 000000000..aef4ce45d
--- /dev/null
+++ b/PORTING
@@ -0,0 +1,70 @@
+I am frequently asked to port strace to a given platform. Less
+frequently I am asked how one would go about porting strace to a given
+platform. :-) Since I have ported strace to a few platforms already I
+have some advice to the would-be strace porter.
+
+The number one question is ``Does the native operating support a
+concept which enables even the mere possibility of tracing?''. So far
+I have seen two mechanisms which support system call tracing. They
+are the SunOS originated feature of the PTRACE_SYSCALL argument to the
+ptrace system call and the PIOCSENTRY/PIOCSEXIT ioctl for the /proc
+filesystem under System V release 4 style Unix derived systems. There
+may be others (surely a better one could be devised :-) but innovation
+is a rare commodity so unless one of these is supported you may be
+SOL.
+
+Therefore the first step is to try `man 2 ptrace' and `man 4 proc' to
+see if there is even a glimmer of hope. Without assistance from the
+operating system, system call tracing is a lost cause. If there is a
+native system call tracing program (however pathetic it might be :-),
+you may be able to use it to trace itself to determine what mechanism
+it is using for tracing the system calls of another process. If the
+interface is documented you should be a happy camper. Otherwise,
+unless you can tolerate the thought of many thankless hours
+single-stepping in a debugger with little or nothing to show for it,
+you should consider other tasks to distract you from your friends,
+family, education, job, spouse and/or significant other.
+
+If you have arrived here, your OS should have ptrace or proc or you
+should have a high tolerance for pain. Then again, curious but
+detached readers are invited to continue with little to risk but
+boredom. If the mechanism is neither ptrace nor proc then examine how
+it is intended to work and see how well it fits with what strace
+already does. If it fits, fine, add a few more ifdefs. If there is a
+gross mismatch, write a whole new event loop.
+
+At this point you are responsible for determining three things: how is
+the specific system call communicated, how are system call arguments
+handled, and how is errno handled. These things can usually be
+resolved in a day or two using a decent assembly level debugger and
+some educated guesswork. For example, set a breakpoint on `read'.
+Then disassemble the code and see where the arguments go. Do they go
+on the stack? Do they go into registers? Some combination of the
+two? Find the point where the transition from user mode to kernel
+mode is made. Can you identify the arguments at this point? When the
+call returns where does errno go? Into a specific register? Into a
+global variable?
+
+Next you need to determine how to decode numeric system call numbers
+into system call names (syscallent.h), errno values into errno names
+(errnoent.h) and ioctl values into ioctl names (ioctlent.h). Often
+this fragile step can be accomplished by massaging system header files
+with ad hoc shell scripts. Expect your scripts to break with every
+dot rev of each OS release.
+
+Finally, once you have the basic framework in which system calls and
+their arguments can be decoded, you must do the dirty work of decoding
+every useful call. Some may be similar or identical to like-named
+calls in other operating systems. Go ahead and tweak what is there
+to achieve what you want. If there is more difference than similarity,
+then just write your own version of it using one of the existing
+implementations for ideas.
+
+The first order of decoding is the generation of suitable system call,
+errno, ioctl and signal tables. Sample scripts are included to assist
+with the generation of a first pass at these tables.
+
+Good luck and feel free to contact me before and/or during any major
+project.
+
+Rick Sladkey <jrs@world.std.com>
diff --git a/README b/README
new file mode 100644
index 000000000..d0c81fa36
--- /dev/null
+++ b/README
@@ -0,0 +1,37 @@
+This is strace 3.1, a system call tracer for SunOS 4.x, Linux, System
+V release 4, Solaris 2.x and Irix 5.x. strace is released under a
+Berkeley-style license at the request of Paul Kranenburg; see the file
+COPYRIGHT for details.
+
+Read the INSTALL file for generic instructions on how to install
+strace. If configure cannot guess your system configuration, you can
+specify it on the command line after the other options like this:
+
+ ./configure --prefix=/usr i486-linux
+
+The following configurations are supposed to work (in porting order):
+
+ sparc-sun-sunos4.1
+ i486-linux
+ sparc-sun-solaris2
+ i486-ncr-sysv4
+ i486-sun-solaris2
+ m68k-linux
+ mips-sgi-irix5
+ alpha-linux
+
+A single sunos4.1 binary should work on all the sun4, sun4c and sun4m
+kernel architectures. Let me know if sun4d doesn't work. Other
+i486-*-sysv4 systems may work with little or no tweaking.
+
+See the file NEWS for information on what has changed in recent
+versions.
+
+See the file PORTING if you like strace but it doesn't work on an
+operating system you use frequently.
+
+See the file CREDITS to see who has contributed to strace.
+
+See the file TODO if you feel like helping out.
+
+Please send bug reports and enhancements to Rick Sladkey <jrs@world.std.com>.
diff --git a/README-linux b/README-linux
new file mode 100644
index 000000000..b6f37534b
--- /dev/null
+++ b/README-linux
@@ -0,0 +1,52 @@
+========================================================================
+This is the unmodified README from Branko Lankester's release of strace
+for Linux. Some of the notes and instructions are no longer valid
+however the file has been retained for its historical value. -- jrs
+========================================================================
+
+This is the second release of strace for linux, it requires linux
+version 0.99.10 or newer. strace was written by Paul Kranenburg for
+SunOS, I have modified it to work with linux. Read the file README and
+the strace.1 for more info on strace.
+
+
+Changes for this release are:
+- bugfixes
+- support for new system calls and ioctls
+- symbolic output for: termio ioctls, sysv ipc, fcntl file locking,
+ statfs and ptrace
+- microsecond time stamps
+
+A lot of the changes and bugfixes for this version were done by
+Rick Sladkey <jrs@world.std.com>, System V IPC support was added
+by Ulrich Pegelow <pegelow@moorea.uni-muenster.de>.
+
+
+FILES:
+
+README.first this file
+README the original readme file for SunOS strace
+getioctls script to create the ioctlents.h file for linux.
+Sun/* files from the original package I didn't use
+
+
+Notes:
+
+- With older versions of Linux (before 0.99.10) signals can get lost
+for a traced process.
+
+- strace works best if you have a proc fs mounted on /proc, the
+/proc/##/mem frame buffers are used for reading system call arguments.
+You can use /dev/ram or some other unused block device for mounting
+the proc fs:
+
+ mount -t proc /dev/ram /proc
+
+or in /etc/fstab:
+
+/dev/hda /proc proc defaults
+
+
+
+Branko Lankester Jun 18 1993
+branko@hacktic.nl || lankeste@fwi.uva.nl
diff --git a/README-sunos4 b/README-sunos4
new file mode 100644
index 000000000..1fa8ae263
--- /dev/null
+++ b/README-sunos4
@@ -0,0 +1,85 @@
+========================================================================
+This is the unmodified README from Paul Kranenburg's release of strace
+for SunOS 4.1.x. Some of the notes and instructions are no longer valid
+however the file has been retained for its historical value. -- jrs
+========================================================================
+
+/*
+ * @(#)README 2.4 92/01/21
+ *
+ * Copyright (C) 1991 Paul Kranenburg.
+ *
+ * Please send comments, enhancements or any other useful ideas to
+ * the address at the end of this file.
+ *
+ */
+
+strace(1) is a system call tracer for Sun(tm) systems much like the
+Sun supplied program trace(1). strace(1) is a useful utility to sort
+of debug programs for which no source is available which unfortunately
+includes almost all of the Sun supplied system software.
+
+Like trace(1), strace displays each system call and its arguments as it
+is invoked by the traced process, but tries to do a better job of
+decoding the arguments, displaying them in symbolic format whenever
+possible. Passed structures/character arrays are read from the process'
+address space and displayed in an appropriate format.
+
+It is also possible to instruct strace to trace child processes as
+they are created by the fork(2) system call. However, this is slightly
+involved for two reasons: 1) the trace flag is cleared in the child
+process by the fork system call, so we must make a special effort to
+gain control of the child (see NOTES below), 2) our tracing manipulations
+of the child may interfere with a possible wait(2) system call executed
+by the (also traced) parent process. In this case we don't allow the parent
+to continue until one of its children enters a state that may cause the
+parent's wait(2) call to return.
+
+
+NOTES.
+
+o Not all system calls have been implemented yet as described
+ above (see dummy.h for a list), these calls only have their args
+ displayed as hex numbers.
+
+o The program draws heavily on Sun's extensions to the ptrace(2)
+ system call.
+
+o This release is based upon SunOS 4.1.1. The syscall list (syscall.h)
+ and ioctl's (ioctlent.m4) are probably most critically dependant
+ on the OS version (see also /sys/os/init_sysent.c).
+ You may have to edit `ioctlsort.c' and/or `ioctlent.m4' to get
+ `ioctlsort.c' to compile with your suite of system header files.
+
+o The way in which child processes are caught and attached to after
+ the fork() call is Sparc-specific (in fact it has the looks of a
+ terrible hack). Also, this trick won't work with vfork(2).
+ Enhancements are sollicited for.
+
+o Dynamically linked executables can be convinced to use the fork(2)
+ system call in stead of vfork(2) by modifying their (internal)
+ symbol table immediately after such a program is exec'ed. Be
+ warned that programs which depend on vfork's peculiar semantics
+ may not run as expected. Enable by the `-F' switch.
+
+
+INSTALLATION.
+
+ Edit the paths in the Makefile to suit your local system.
+ Enter the usual make commands (`make debug' to enable the
+ compiler `-g' flag).
+
+ Not all sites have a complete set of include files, depending
+ on the selected software categories at OS install time. The
+ makefile tries to detect the presence of the Sunview category,
+ if other files are missing you may have to edit `ioctlent.h'.
+
+
+COMMENTS TO:
+
+ P. Kranenburg
+ Department of Computer Science
+ Erasmus University Rotterdam
+ P.O. Box 1738
+ NL-3000 DR Rotterdam
+ e-mail: pk@cs.few.eur.nl
diff --git a/README-svr4 b/README-svr4
new file mode 100644
index 000000000..e53a39392
--- /dev/null
+++ b/README-svr4
@@ -0,0 +1,12 @@
+Even though SVR4 has truss, you may prefer using strace for a number
+of reasons. Not the least of which are portability and source code.
+
+The main event loop is awkward on systems for which procfs isn't
+pollable. I think a pollable procfs is a Solaris invention so most SVR4
+systems have this weakness. On Solaris, strace runs as a single
+controlling process. This is a big improvement if you are debugging a
+lot of processes at once.
+
+There is no thread support but it wouldn't be very difficult to add it.
+
+Rick Sladkey <jrs@world.std.com>
diff --git a/TODO b/TODO
new file mode 100644
index 000000000..4767f4141
--- /dev/null
+++ b/TODO
@@ -0,0 +1,25 @@
+require override to run suid and/or sgid executables normally
+attempt reopen of /proc file if we get EAGAIN from any /proc ioctl
+kill procs we error out of on svr4
+enclose "total x dents" in a comment
+declare gettimeofday and pread for solaris2
+update automatic remaking of autoconf targets
+I don't like run on last close, change it?
+parse long options?
+count signals too with -c
+treat attach, detach messages like signals
+add readv, writev to I/O dumping
+add pread, pwrite to I/O dumping
+add system assist for qualifiers on svr4
+change printcall to getcaller and fix for linux and svr4
+fix fork hang for svr4 without pollable procfs
+add thread support
+print events on entry to and revents on exit from poll
+monitor procfs open and release the other child if the process wants to own it
+fix incorrect syscall number if exit without entry on svr4 without pr_syscall
+fix clean targets so config.h and config.status can be removed
+ignore faults which occur before exec
+look for more ioctls on solaris, used in nslookup for example
+consider adding backtrace support
+consider adding general purpose interpreter
+rename program to sctrace to avoid conflict with svr4 strace?
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 000000000..44a4921c0
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,46 @@
+
+/* Define if this is running the Linux operating system. */
+#undef LINUX
+
+/* Define if this is running the SunOS 4.x operating system. */
+#undef SUNOS4
+
+/* Define if this is running the System V release 4 operating system
+ or a derivative like Solaris 2.x or Irix 5.x. */
+#undef SVR4
+
+/* Define if this is an i386, i486 or pentium architecture. */
+#undef I386
+
+/* Define if this is an m68k architecture. */
+#undef M68K
+
+/* Define if this is a sparc architecture. */
+#undef SPARC
+
+/* Define if this is a mips architecture. */
+#undef MIPS
+
+/* Define if this is an alpha architecture. */
+#undef ALPHA
+
+/* Define if you have SVR4 and the poll system call works on /proc files. */
+#undef HAVE_POLLABLE_PROCFS
+
+/* Define if the prstatus structure in sys/procfs.h has a pr_syscall member. */
+#undef HAVE_PR_SYSCALL
+
+/* Define if you are have a SPARC with SUNOS4 and your want a version
+ of strace that will work on sun4, sun4c and sun4m kernel architectures.
+ Only useful if you have a symbolic link from machine to /usr/include/sun4
+ in the compilation directory. */
+#undef SUNOS4_KERNEL_ARCH_KLUDGE
+
+/* Define if signal.h defines the type sig_atomic_t. */
+#undef HAVE_SIG_ATOMIC_T
+
+/* Define if sys_errlist is declared. */
+#undef SYS_ERRLIST_DECLARED
+
+/* Define if the msghdr structure has a msg_control member. */
+#undef HAVE_MSG_CONTROL
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 000000000..de48e6606
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,211 @@
+dnl ### A macro to find the include directory, useful for cross-compiling.
+AC_DEFUN(AC_INCLUDEDIR,
+[AC_REQUIRE([AC_PROG_AWK])dnl
+AC_SUBST(includedir)
+AC_MSG_CHECKING(for primary include directory)
+includedir=/usr/include
+if test -n "$GCC"
+then
+ >conftest.c
+ new_includedir=`
+ $CC -v -E conftest.c 2>&1 | $AWK '
+ /^End of search list/ { print last; exit }
+ { last = [$]1 }
+ '
+ `
+ rm -f conftest.c
+ if test -n "$new_includedir" && test -d "$new_includedir"
+ then
+ includedir=$new_includedir
+ fi
+fi
+AC_MSG_RESULT($includedir)
+])
+
+dnl ### A macro to automatically set different CC and HOSTCC if using gcc.
+define(AC_PROG_HOSTCC,
+[AC_SUBST(HOSTCC)dnl
+if test -z "$HOSTCC"
+then
+ HOSTCC="$CC"
+ if test -n "$GCC"
+ then
+ # Find out if gcc groks our host.
+ worked=
+ last=
+ for i in $1
+ do
+ test "x$i" = "x$last" && continue
+ last="$i"
+ CC="$HOSTCC -b $i"
+ AC_MSG_CHECKING([for working $CC])
+ AC_TRY_LINK(,,
+ worked=1
+ break
+ )
+ AC_MSG_RESULT(no)
+ done
+ if test -z "$worked"
+ then
+ CC="$HOSTCC"
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ fi
+fi
+])
+
+dnl ### A macro to set gcc warning flags.
+define(AC_WARNFLAGS,
+[AC_SUBST(WARNFLAGS)
+if test -z "$WARNFLAGS"
+then
+ if test -n "$GCC"
+ then
+ # If we're using gcc we want warning flags.
+ WARNFLAGS=-Wall
+ fi
+fi
+])
+
+dnl ### A macro to determine if procfs is pollable.
+AC_DEFUN(AC_POLLABLE_PROCFS,
+[AC_MSG_CHECKING(for pollable procfs)
+AC_CACHE_VAL(ac_cv_pollable_procfs,
+[AC_TRY_RUN([
+#include <stdio.h>
+#include <signal.h>
+#include <sys/procfs.h>
+#include <sys/stropts.h>
+#include <poll.h>
+
+main()
+{
+ int pid;
+ char proc[32];
+ FILE *pfp;
+ struct pollfd pfd;
+
+ if ((pid = fork()) == 0) {
+ pause();
+ exit(0);
+ }
+ sprintf(proc, "/proc/%d", pid);
+ if ((pfp = fopen(proc, "r+")) == NULL)
+ goto fail;
+ if (ioctl(fileno(pfp), PIOCSTOP, NULL) < 0)
+ goto fail;
+ pfd.fd = fileno(pfp);
+ pfd.events = POLLPRI;
+ if (poll(&pfd, 1, 0) < 0)
+ goto fail;
+ if (!(pfd.revents & POLLPRI))
+ goto fail;
+ kill(pid, SIGKILL);
+ exit(0);
+fail:
+ kill(pid, SIGKILL);
+ exit(1);
+}
+],
+ac_cv_pollable_procfs=yes,
+ac_cv_pollable_procfs=no,
+[
+# Guess or punt.
+case "$host_os" in
+solaris2*|irix5*)
+ ac_cv_pollable_procfs=yes
+ ;;
+*)
+ ac_cv_pollable_procfs=no
+ ;;
+esac
+])])
+AC_MSG_RESULT($ac_cv_pollable_procfs)
+if test "$ac_cv_pollable_procfs" = yes
+then
+ AC_DEFINE(HAVE_POLLABLE_PROCFS)
+fi
+])
+
+dnl ### A macro to determine if the prstatus structure has a pr_syscall member.
+AC_DEFUN(AC_STRUCT_PR_SYSCALL,
+[AC_MSG_CHECKING(for pr_syscall in struct prstatus)
+AC_CACHE_VAL(ac_cv_struct_pr_syscall,
+[AC_TRY_COMPILE([#include <sys/procfs.h>],
+[struct prstatus s; s.pr_syscall;],
+ac_cv_struct_pr_syscall=yes,
+ac_cv_struct_pr_syscall=no)])
+AC_MSG_RESULT($ac_cv_struct_pr_syscall)
+if test "$ac_cv_struct_pr_syscall" = yes
+then
+ AC_DEFINE(HAVE_PR_SYSCALL)
+fi
+])
+
+dnl ### A macro to detect the presence of the sig_atomic_t in signal.h
+AC_DEFUN(AC_SIG_ATOMIC_T,
+[AC_MSG_CHECKING(for sig_atomic_t in signal.h)
+AC_CACHE_VAL(ac_cv_sig_atomic_t,
+[AC_TRY_COMPILE([#include <signal.h>],
+[sig_atomic_t x;],
+ac_cv_sig_atomic_t=yes,
+ac_cv_sig_atomic_t=no)])
+AC_MSG_RESULT($ac_cv_sig_atomic_t)
+if test "$ac_cv_sig_atomic_t" = yes
+then
+ AC_DEFINE(HAVE_SIG_ATOMIC_T)
+fi
+])
+
+dnl ### A macro to determine if sys_errlist is declared.
+AC_DEFUN(AC_DECL_SYS_ERRLIST,
+[AC_MSG_CHECKING([for sys_errlist declaration])
+AC_CACHE_VAL(ac_cv_decl_sys_errlist,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <errno.h>
+#include <stdio.h>
+/* Somebody might declare sys_errlist in unistd.h. */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif], [char *msg = *(sys_errlist + 1);],
+ ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no)])dnl
+AC_MSG_RESULT($ac_cv_decl_sys_errlist)
+if test $ac_cv_decl_sys_errlist = yes; then
+ AC_DEFINE(SYS_ERRLIST_DECLARED)
+fi
+])
+
+dnl ### A macro to determine if _sys_siglist is declared.
+AC_DEFUN(AC_DECL__SYS_SIGLIST,
+[AC_MSG_CHECKING([for _sys_siglist declaration])
+AC_CACHE_VAL(ac_cv_decl__sys_siglist,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <signal.h>
+/* Somebody might declare _sys_siglist in unistd.h. */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif], [char *msg = *(_sys_siglist + 1);],
+ ac_cv_decl__sys_siglist=yes, ac_cv_decl__sys_siglist=no)])dnl
+AC_MSG_RESULT($ac_cv_decl__sys_siglist)
+if test $ac_cv_decl__sys_siglist = yes; then
+ AC_DEFINE(SYS_SIGLIST_DECLARED)
+fi
+])
+
+dnl ### A macro to determine if the msghdr structure has a msg_control member.
+AC_DEFUN(AC_STRUCT_MSG_CONTROL,
+[AC_MSG_CHECKING(for msg_control in struct msghdr)
+AC_CACHE_VAL(ac_cv_struct_msg_control,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>],
+[#undef msg_control
+struct msghdr m; m.msg_control;],
+ac_cv_struct_msg_control=yes,
+ac_cv_struct_msg_control=no)])
+AC_MSG_RESULT($ac_cv_struct_msg_control)
+if test "$ac_cv_struct_msg_control" = yes
+then
+ AC_DEFINE(HAVE_MSG_CONTROL)
+fi
+])
diff --git a/bjm.c b/bjm.c
new file mode 100644
index 000000000..2bb91a970
--- /dev/null
+++ b/bjm.c
@@ -0,0 +1,61 @@
+#include "defs.h"
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include <sys/utsname.h>
+#include <sys/user.h>
+#include <sys/syscall.h>
+#include <signal.h>
+#include <linux/module.h>
+
+/* WTA: #define these here: since Debian uses glibc2's includefiles
+ * instead of the kernel includes we miss these otherwise.
+ */
+
+#if !defined(QM_MODULES)
+#define QM_MODULES 1
+#define QM_DEPS 2
+#define QM_REFS 3
+#define QM_SYMBOLS 4
+#define QM_INFO 5
+#endif
+
+static struct xlat which[] = {
+ { 0, "0" },
+ { QM_MODULES, "QM_MODULES" },
+ { QM_DEPS, "QM_DEPS" },
+ { QM_REFS, "QM_REFS" },
+ { QM_SYMBOLS, "QM_SYMBOLS" },
+ { QM_INFO, "QM_INFO" },
+ { 0, NULL },
+};
+
+int
+sys_query_module(tcp)
+struct tcb *tcp;
+{
+
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ tprintf(", ");
+ printxval(which, tcp->u_arg[1], "L_???");
+ tprintf(", ");
+ printstr(tcp, tcp->u_arg[2], tcp->u_arg[3]);
+ tprintf(", %#lx", tcp->u_arg[4]);
+ }
+ return 0;
+}
+
+int
+sys_delete_module(tcp)
+struct tcb *tcp;
+{
+
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ }
+ return 0;
+}
diff --git a/config.guess b/config.guess
new file mode 100755
index 000000000..dafad1119
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,940 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# The master version of this file is at the FSF in /home/gd/gnu/lib.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit system type (host/target name).
+#
+# Only a few systems have been added to this list; please add others
+# (but try to keep the structure clean).
+#
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 8/24/94.)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ cat <<EOF >dummy.s
+ .globl main
+ .ent main
+main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+ fi
+ rm -f dummy.s dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-cbm-sysv4
+ exit 0;;
+ amiga:NetBSD:*:*)
+ echo m68k-cbm-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ arc64:OpenBSD:*:*)
+ echo mips64el-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hkmips:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ arm32:NetBSD:*:*)
+ echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ SR2?01:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:NetBSD:*:*)
+ echo m68k-atari-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:NetBSD:*:*)
+ echo m68k-sun-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:NetBSD:*:*)
+ echo m68k-apple-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:NetBSD:*:*)
+ echo powerpc-apple-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ sed 's/^ //' << EOF >dummy.c
+ int main (argc, argv) int argc; char **argv; {
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy \
+ && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i?86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ sed 's/^ //' << EOF >dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:4)
+ if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=4.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[3478]??:HP-UX:*:*)
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/7?? | 9000/8?[1679] )
+ sed 's/^ //' << EOF >dummy.c
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && HP_ARCH=`./dummy`
+ rm -f dummy.c dummy
+ esac
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ sed 's/^ //' << EOF >dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i?86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*X-MP:*:*:*)
+ echo xmp-cray-unicos
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY-2:*:*:*)
+ echo cray2-cray-unicos
+ exit 0 ;;
+ F300:UNIX_System_V:*:*)
+ FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ F301:UNIX_System_V:*:*)
+ echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+ exit 0 ;;
+ hp3[0-9][05]:NetBSD:*:*)
+ echo m68k-hp-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ i?86:BSD/386:*:* | *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ *:NetBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin32
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin32
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ *:Linux:*:*)
+ # uname on the ARM produces all sorts of strangeness, and we need to
+ # filter it out.
+ case "$UNAME_MACHINE" in
+ arm* | sa110*) UNAME_MACHINE="arm" ;;
+ esac
+
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us.
+ ld_help_string=`ld --help 2>&1`
+ ld_supported_emulations=`echo $ld_help_string \
+ | sed -ne '/supported emulations:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported emulations: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_emulations" in
+ i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
+ i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
+ sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
+ esac
+
+ if test "${UNAME_MACHINE}" = "alpha" ; then
+ sed 's/^ //' <<EOF >dummy.s
+ .globl main
+ .ent main
+ main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ LIBC=""
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+
+ objdump --private-headers dummy | \
+ grep ld.so.1 > /dev/null
+ if test "$?" = 0 ; then
+ LIBC="libc1"
+ fi
+ fi
+ rm -f dummy.s dummy
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
+ elif test "${UNAME_MACHINE}" = "mips" ; then
+ cat >dummy.c <<EOF
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#ifdef __MIPSEB__
+ printf ("%s-unknown-linux-gnu\n", argv[1]);
+#endif
+#ifdef __MIPSEL__
+ printf ("%sel-unknown-linux-gnu\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ else
+ # Either a pre-BFD a.out linker (linux-gnuoldld)
+ # or one that does not give us useful --help.
+ # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+ # If ld does not provide *any* "supported emulations:"
+ # that means it is gnuoldld.
+ echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+ test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+
+ case "${UNAME_MACHINE}" in
+ i?86)
+ VENDOR=pc;
+ ;;
+ *)
+ VENDOR=unknown;
+ ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ cat >dummy.c <<EOF
+#include <features.h>
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#ifdef __ELF__
+# ifdef __GLIBC__
+# if __GLIBC__ >= 2
+ printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+#else
+ printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ fi ;;
+# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+# are messed up and put the nodename in both sysname and nodename.
+ i?86:DYNIX/ptx:4*:*)
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i?86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ i?86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ i?86:LynxOS:2.*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:*:6*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+ printf ("vax-dec-bsd\n"); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+rm -f dummy.c dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+#echo '(Unable to guess system type)' 1>&2
+
+exit 1
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 000000000..09991bebd
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,169 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define to the type of elements in the array set by `getgroups'.
+ Usually this is either `int' or `gid_t'. */
+#undef GETGROUPS_T
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define if your struct stat has st_blksize. */
+#undef HAVE_ST_BLKSIZE
+
+/* Define if your struct stat has st_blocks. */
+#undef HAVE_ST_BLOCKS
+
+/* Define if your struct stat has st_rdev. */
+#undef HAVE_ST_RDEV
+
+/* Define if major, minor, and makedev are declared in <mkdev.h>. */
+#undef MAJOR_IN_MKDEV
+
+/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
+#undef MAJOR_IN_SYSMACROS
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef mode_t
+
+/* Define as the return type of signal handlers (int or void). */
+#undef RETSIGTYPE
+
+/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+#undef STAT_MACROS_BROKEN
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define on System V Release 4. */
+#undef SVR4
+
+/* Define if `sys_siglist' is declared by <signal.h>. */
+#undef SYS_SIGLIST_DECLARED
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
+
+/* Define if this is running the Linux operating system. */
+#undef LINUX
+
+/* Define if this is running the SunOS 4.x operating system. */
+#undef SUNOS4
+
+/* Define if this is running the System V release 4 operating system
+ or a derivative like Solaris 2.x or Irix 5.x. */
+#undef SVR4
+
+/* Define if this is an i386, i486 or pentium architecture. */
+#undef I386
+
+/* Define if this is an m68k architecture. */
+#undef M68K
+
+/* Define if this is a sparc architecture. */
+#undef SPARC
+
+/* Define if this is a mips architecture. */
+#undef MIPS
+
+/* Define if this is an alpha architecture. */
+#undef ALPHA
+
+/* Define if this is an powerpc architecture. */
+#undef POWERPC
+
+/* Define if this is a arm architecture. */
+#undef ARM
+
+/* Define if you have SVR4 and the poll system call works on /proc files. */
+#undef HAVE_POLLABLE_PROCFS
+
+/* Define if the prstatus structure in sys/procfs.h has a pr_syscall member. */
+#undef HAVE_PR_SYSCALL
+
+/* Define if you are have a SPARC with SUNOS4 and your want a version
+ of strace that will work on sun4, sun4c and sun4m kernel architectures.
+ Only useful if you have a symbolic link from machine to /usr/include/sun4
+ in the compilation directory. */
+#undef SUNOS4_KERNEL_ARCH_KLUDGE
+
+/* Define if signal.h defines the type sig_atomic_t. */
+#undef HAVE_SIG_ATOMIC_T
+
+/* Define if sys_errlist is declared. */
+#undef SYS_ERRLIST_DECLARED
+
+/* Define if the msghdr structure has a msg_control member. */
+#undef HAVE_MSG_CONTROL
+
+/* Define if you have the _sys_siglist function. */
+#undef HAVE__SYS_SIGLIST
+
+/* Define if you have the getdents function. */
+#undef HAVE_GETDENTS
+
+/* Define if you have the mctl function. */
+#undef HAVE_MCTL
+
+/* Define if you have the prctl function. */
+#undef HAVE_PRCTL
+
+/* Define if you have the pread function. */
+#undef HAVE_PREAD
+
+/* Define if you have the putpmsg function. */
+#undef HAVE_PUTPMSG
+
+/* Define if you have the sendmsg function. */
+#undef HAVE_SENDMSG
+
+/* Define if you have the sigaction function. */
+#undef HAVE_SIGACTION
+
+/* Define if you have the strerror function. */
+#undef HAVE_STRERROR
+
+/* Define if you have the strsignal function. */
+#undef HAVE_STRSIGNAL
+
+/* Define if you have the sys_siglist function. */
+#undef HAVE_SYS_SIGLIST
+
+/* Define if you have the <asm/sigcontext.h> header file. */
+#undef HAVE_ASM_SIGCONTEXT_H
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <sys/asynch.h> header file. */
+#undef HAVE_SYS_ASYNCH_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/stream.h> header file. */
+#undef HAVE_SYS_STREAM_H
+
+/* Define if you have the <sys/sysconfig.h> header file. */
+#undef HAVE_SYS_SYSCONFIG_H
+
+/* Define if you have the <sys/tiuser.h> header file. */
+#undef HAVE_SYS_TIUSER_H
+
+/* Define if you have the nsl library (-lnsl). */
+#undef HAVE_LIBNSL
diff --git a/config.sub b/config.sub
new file mode 100755
index 000000000..5051de459
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,955 @@
+#! /bin/sh
+# Configuration validation subroutine script, version 1.1.
+# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+if [ x$1 = x ]
+then
+ echo Configuration name missing. 1>&2
+ echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+ echo "or $0 ALIAS" 1>&2
+ echo where ALIAS is a recognized configuration type. 1>&2
+ exit 1
+fi
+
+# First pass through any local machine types.
+case $1 in
+ *local*)
+ echo $1
+ exit 0
+ ;;
+ *)
+ ;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ linux-gnu*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple)
+ os=
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+ | arme[lb] | pyramid | mn10200 | mn10300 \
+ | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
+ | alpha | alphaev5 | alphaev56 | alphapca56 | we32k | ns16k | clipper \
+ | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
+ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
+ | mipstx39 | mipstx39el \
+ | sparc | sparclet | sparclite | sparc64 | v850)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i[34567]86)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
+ | alpha-* | alphaev5-* | alphaev56-* | alphapca56 | we32k-* | cydra-* \
+ | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
+ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+ | sparc64-* | mips64-* | mipsel-* \
+ | mips64el-* | mips64orion-* | mips64orionel-* \
+ | mipstx39-* | mipstx39el-* \
+ | f301-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-cbm
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-cbm
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-cbm
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ cray2)
+ basic_machine=cray2-cray
+ os=-unicos
+ ;;
+ [ctj]90-cray)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i[34567]86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i[34567]86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i[34567]86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i[34567]86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ mipsel*-linux*)
+ basic_machine=mipsel-unknown
+ os=-linux-gnu
+ ;;
+ mips*-linux*)
+ basic_machine=mips-unknown
+ os=-linux-gnu
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | nexen)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | k6 | 6x86)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | nexen-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | k6-* | 6x86-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=rs6000-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ xmp)
+ basic_machine=xmp-cray
+ os=-unicos
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ mips)
+ if [ x$os = x-linux-gnu ]; then
+ basic_machine=mips-unknown
+ else
+ basic_machine=mips-mips
+ fi
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sparc)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f301-fujitsu)
+ os=-uxpv
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
diff --git a/configure b/configure
new file mode 100755
index 000000000..fd0af2190
--- /dev/null
+++ b/configure
@@ -0,0 +1,2674 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=strace.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Make sure we can run config.sub.
+if $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:548: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`$ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`$ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking for supported operating system""... $ac_c" 1>&6
+echo "configure:569: checking for supported operating system" >&5
+
+case "$host_os" in
+linux*)
+ opsys=linux
+ ;;
+sunos4*)
+ opsys=sunos4
+ ;;
+solaris2*)
+ opsys=svr4
+ ;;
+sysv4*)
+ opsys=svr4
+ ;;
+irix5*)
+ opsys=svr4
+ ;;
+*)
+ { echo "configure: error: this operating system is not yet supported by strace" 1>&2; exit 1; }
+ ;;
+esac
+echo "$ac_t""$opsys" 1>&6
+
+# Autoheader trick. Heh, heh.
+opsys_list='
+@@@syms="$syms LINUX SUNOS4 SVR4"@@@
+'
+
+echo $ac_n "checking for supported architecture""... $ac_c" 1>&6
+echo "configure:599: checking for supported architecture" >&5
+case "$host_cpu" in
+i[3456]86|pentium)
+ arch=i386
+ ;;
+m68k)
+ arch=m68k
+ ;;
+sparc*)
+ arch=sparc
+ ;;
+mips)
+ arch=mips
+ ;;
+alpha)
+ arch=alpha
+ ;;
+ppc|powerpc)
+ arch=powerpc
+ ;;
+arm)
+ arch=arm
+ ;;
+*)
+ { echo "configure: error: this architecture is not yet supported by strace" 1>&2; exit 1; }
+ ;;
+esac
+echo "$ac_t""$arch" 1>&6
+
+# Autoheader trick. Heh, heh.
+arch_list='
+@@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM"@@@
+'
+
+osarch="$opsys"
+if [ -d "$srcdir/$opsys/$arch" ]; then
+ osarch="$opsys/$arch"
+fi
+
+OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
+ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
+
+
+
+cat >> confdefs.h <<EOF
+#define $OPSYS 1
+EOF
+
+
+cat >> confdefs.h <<EOF
+#define $ARCH 1
+EOF
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:656: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:685: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ ac_prog_rejected=no
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 743 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:772: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:796: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+if test -z "$HOSTCC"
+then
+ HOSTCC="$CC"
+ if test -n "$GCC"
+ then
+ # Find out if gcc groks our host.
+ worked=
+ last=
+ for i in $host_alias $host
+ do
+ test "x$i" = "x$last" && continue
+ last="$i"
+ CC="$HOSTCC -b $i"
+ echo $ac_n "checking for working $CC""... $ac_c" 1>&6
+echo "configure:837: checking for working $CC" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 839 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ worked=1
+ break
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+ echo "$ac_t""no" 1>&6
+ done
+ if test -z "$worked"
+ then
+ CC="$HOSTCC"
+ else
+ echo "$ac_t""yes" 1>&6
+ fi
+ fi
+fi
+
+
+echo $ac_n "checking for pollable procfs""... $ac_c" 1>&6
+echo "configure:869: checking for pollable procfs" >&5
+if eval "test \"`echo '$''{'ac_cv_pollable_procfs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+
+# Guess or punt.
+case "$host_os" in
+solaris2*|irix5*)
+ ac_cv_pollable_procfs=yes
+ ;;
+*)
+ ac_cv_pollable_procfs=no
+ ;;
+esac
+
+else
+ cat > conftest.$ac_ext <<EOF
+#line 887 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#include <signal.h>
+#include <sys/procfs.h>
+#include <sys/stropts.h>
+#include <poll.h>
+
+main()
+{
+ int pid;
+ char proc[32];
+ FILE *pfp;
+ struct pollfd pfd;
+
+ if ((pid = fork()) == 0) {
+ pause();
+ exit(0);
+ }
+ sprintf(proc, "/proc/%d", pid);
+ if ((pfp = fopen(proc, "r+")) == NULL)
+ goto fail;
+ if (ioctl(fileno(pfp), PIOCSTOP, NULL) < 0)
+ goto fail;
+ pfd.fd = fileno(pfp);
+ pfd.events = POLLPRI;
+ if (poll(&pfd, 1, 0) < 0)
+ goto fail;
+ if (!(pfd.revents & POLLPRI))
+ goto fail;
+ kill(pid, SIGKILL);
+ exit(0);
+fail:
+ kill(pid, SIGKILL);
+ exit(1);
+}
+
+EOF
+if { (eval echo configure:926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_pollable_procfs=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_pollable_procfs=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_pollable_procfs" 1>&6
+if test "$ac_cv_pollable_procfs" = yes
+then
+ cat >> confdefs.h <<\EOF
+#define HAVE_POLLABLE_PROCFS 1
+EOF
+
+fi
+
+echo $ac_n "checking for pr_syscall in struct prstatus""... $ac_c" 1>&6
+echo "configure:950: checking for pr_syscall in struct prstatus" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_pr_syscall'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 955 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() {
+struct prstatus s; s.pr_syscall;
+; return 0; }
+EOF
+if { (eval echo configure:962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_pr_syscall=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_pr_syscall=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_pr_syscall" 1>&6
+if test "$ac_cv_struct_pr_syscall" = yes
+then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PR_SYSCALL 1
+EOF
+
+fi
+
+echo $ac_n "checking for msg_control in struct msghdr""... $ac_c" 1>&6
+echo "configure:984: checking for msg_control in struct msghdr" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_msg_control'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 989 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+int main() {
+#undef msg_control
+struct msghdr m; m.msg_control;
+; return 0; }
+EOF
+if { (eval echo configure:998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_msg_control=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_msg_control=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_msg_control" 1>&6
+if test "$ac_cv_struct_msg_control" = yes
+then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MSG_CONTROL 1
+EOF
+
+fi
+
+for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1024: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AWK="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+ echo "$ac_t""$AWK" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
+
+echo $ac_n "checking for primary include directory""... $ac_c" 1>&6
+echo "configure:1054: checking for primary include directory" >&5
+includedir=/usr/include
+if test -n "$GCC"
+then
+ >conftest.c
+ new_includedir=`
+ $CC -v -E conftest.c 2>&1 | $AWK '
+ /^End of search list/ { print last; exit }
+ { last = $1 }
+ '
+ `
+ rm -f conftest.c
+ if test -n "$new_includedir" && test -d "$new_includedir"
+ then
+ includedir=$new_includedir
+ fi
+fi
+echo "$ac_t""$includedir" 1>&6
+
+if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
+then
+ echo $ac_n "checking for valid machine include directory""... $ac_c" 1>&6
+echo "configure:1076: checking for valid machine include directory" >&5
+ if test -d "$includedir/sun4"
+ then
+ rm -f machine
+ ln -s $includedir/sun4 machine
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define SUNOS4_KERNEL_ARCH_KLUDGE 1
+EOF
+
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+fi
+
+if test -z "$WARNFLAGS"
+then
+ if test -n "$GCC"
+ then
+ # If we're using gcc we want warning flags.
+ WARNFLAGS=-Wall
+ fi
+fi
+
+if test "x$OPSYS" = "xSUNOS4"
+then
+ if test -n "$GCC"
+ then
+ # SunOS 4.x header files don't declare int functions.
+ WARNFLAGS="$WARNFLAGS -Wno-implicit"
+ fi
+fi
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1109: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 1124 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 1141 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
+echo "configure:1171: checking whether ${CC-cc} needs -traditional" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat > conftest.$ac_ext <<EOF
+#line 1177 "configure"
+#include "confdefs.h"
+#include <sgtty.h>
+Autoconf TIOCGETP
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=yes
+else
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat > conftest.$ac_ext <<EOF
+#line 1195 "configure"
+#include "confdefs.h"
+#include <termio.h>
+Autoconf TCGETA
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1227: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ for ac_prog in ginstall installbsd scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ # OSF/1 installbsd also uses dspmsg, but is usable.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1277: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1282 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1352: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1357 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1382 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1400 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1421 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:1460: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1465 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:1473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ ac_header_dirent=$ac_hdr; break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:1498: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldir $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1506 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:1517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -ldir"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:1539: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lx $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1547 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lx"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:1581: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1586 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:1603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_signal=void
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_type_signal=int
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
+echo "configure:1622: checking for st_blksize in struct stat" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1627 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+int main() {
+struct stat s; s.st_blksize;
+; return 0; }
+EOF
+if { (eval echo configure:1635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_st_blksize=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_st_blksize=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
+if test $ac_cv_struct_st_blksize = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ST_BLKSIZE 1
+EOF
+
+fi
+
+echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
+echo "configure:1656: checking for st_blocks in struct stat" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1661 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+int main() {
+struct stat s; s.st_blocks;
+; return 0; }
+EOF
+if { (eval echo configure:1669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_st_blocks=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_st_blocks=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_st_blocks" 1>&6
+if test $ac_cv_struct_st_blocks = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ST_BLOCKS 1
+EOF
+
+else
+ LIBOBJS="$LIBOBJS fileblocks.o"
+fi
+
+echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
+echo "configure:1692: checking for st_rdev in struct stat" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1697 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+int main() {
+struct stat s; s.st_rdev;
+; return 0; }
+EOF
+if { (eval echo configure:1705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_struct_st_rdev=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_struct_st_rdev=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_struct_st_rdev" 1>&6
+if test $ac_cv_struct_st_rdev = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ST_RDEV 1
+EOF
+
+fi
+
+echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
+echo "configure:1726: checking whether stat file-mode macros are broken" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1731 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined(S_ISBLK) && defined(S_IFDIR)
+# if S_ISBLK (S_IFDIR)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISBLK) && defined(S_IFCHR)
+# if S_ISBLK (S_IFCHR)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISLNK) && defined(S_IFREG)
+# if S_ISLNK (S_IFREG)
+You lose.
+# endif
+#endif
+
+#if defined(S_ISSOCK) && defined(S_IFREG)
+# if S_ISSOCK (S_IFREG)
+You lose.
+# endif
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "You lose" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_header_stat_broken=yes
+else
+ rm -rf conftest*
+ ac_cv_header_stat_broken=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
+if test $ac_cv_header_stat_broken = yes; then
+ cat >> confdefs.h <<\EOF
+#define STAT_MACROS_BROKEN 1
+EOF
+
+fi
+
+echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:1782: checking for uid_t in sys/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1787 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "uid_t" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_uid_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+if test $ac_cv_type_uid_t = no; then
+ cat >> confdefs.h <<\EOF
+#define uid_t int
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define gid_t int
+EOF
+
+fi
+
+echo $ac_n "checking for mode_t""... $ac_c" 1>&6
+echo "configure:1816: checking for mode_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1821 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_mode_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_mode_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_mode_t" 1>&6
+if test $ac_cv_type_mode_t = no; then
+ cat >> confdefs.h <<\EOF
+#define mode_t int
+EOF
+
+fi
+
+echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
+echo "configure:1849: checking type of array argument to getgroups" >&5
+if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_type_getgroups=cross
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1857 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Rendell for this test. */
+#include <sys/types.h>
+#define NGID 256
+#undef MAX
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+main()
+{
+ gid_t gidset[NGID];
+ int i, n;
+ union { gid_t gval; long lval; } val;
+
+ val.lval = -1;
+ for (i = 0; i < NGID; i++)
+ gidset[i] = val.gval;
+ n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
+ gidset);
+ /* Exit non-zero if getgroups seems to require an array of ints. This
+ happens when gid_t is short but getgroups modifies an array of ints. */
+ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
+}
+
+EOF
+if { (eval echo configure:1882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_type_getgroups=gid_t
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_type_getgroups=int
+fi
+rm -fr conftest*
+fi
+
+if test $ac_cv_type_getgroups = cross; then
+ cat > conftest.$ac_ext <<EOF
+#line 1896 "configure"
+#include "confdefs.h"
+#include <unistd.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_getgroups=gid_t
+else
+ rm -rf conftest*
+ ac_cv_type_getgroups=int
+fi
+rm -f conftest*
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_type_getgroups" 1>&6
+cat >> confdefs.h <<EOF
+#define GETGROUPS_T $ac_cv_type_getgroups
+EOF
+
+
+echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6
+echo "configure:1920: checking whether sys/types.h defines makedev" >&5
+if eval "test \"`echo '$''{'ac_cv_header_sys_types_h_makedev'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1925 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+return makedev(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:1932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ ac_cv_header_sys_types_h_makedev=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_sys_types_h_makedev=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_header_sys_types_h_makedev" 1>&6
+
+if test $ac_cv_header_sys_types_h_makedev = no; then
+ac_safe=`echo "sys/mkdev.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/mkdev.h""... $ac_c" 1>&6
+echo "configure:1950: checking for sys/mkdev.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1955 "configure"
+#include "confdefs.h"
+#include <sys/mkdev.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define MAJOR_IN_MKDEV 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ if test $ac_cv_header_sys_mkdev_h = no; then
+ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6
+echo "configure:1988: checking for sys/sysmacros.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1993 "configure"
+#include "confdefs.h"
+#include <sys/sysmacros.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define MAJOR_IN_SYSMACROS 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+fi
+
+echo $ac_n "checking for sig_atomic_t in signal.h""... $ac_c" 1>&6
+echo "configure:2026: checking for sig_atomic_t in signal.h" >&5
+if eval "test \"`echo '$''{'ac_cv_sig_atomic_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2031 "configure"
+#include "confdefs.h"
+#include <signal.h>
+int main() {
+sig_atomic_t x;
+; return 0; }
+EOF
+if { (eval echo configure:2038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_sig_atomic_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_sig_atomic_t=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_sig_atomic_t" 1>&6
+if test "$ac_cv_sig_atomic_t" = yes
+then
+ cat >> confdefs.h <<\EOF
+#define HAVE_SIG_ATOMIC_T 1
+EOF
+
+fi
+
+echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
+echo "configure:2060: checking for main in -lnsl" >&5
+ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lnsl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2068 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:2075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lnsl $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+for ac_func in sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2105: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2110 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in sys/filio.h sys/asynch.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2161: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2166 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for sys_errlist declaration""... $ac_c" 1>&6
+echo "configure:2198: checking for sys_errlist declaration" >&5
+if eval "test \"`echo '$''{'ac_cv_decl_sys_errlist'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2203 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <errno.h>
+#include <stdio.h>
+/* Somebody might declare sys_errlist in unistd.h. */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *msg = *(sys_errlist + 1);
+; return 0; }
+EOF
+if { (eval echo configure:2216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_decl_sys_errlist=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_decl_sys_errlist=no
+fi
+rm -f conftest*
+fi
+echo "$ac_t""$ac_cv_decl_sys_errlist" 1>&6
+if test $ac_cv_decl_sys_errlist = yes; then
+ cat >> confdefs.h <<\EOF
+#define SYS_ERRLIST_DECLARED 1
+EOF
+
+fi
+
+echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
+echo "configure:2236: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2241 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+/* NetBSD declares sys_siglist in unistd.h. */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *msg = *(sys_siglist + 1);
+; return 0; }
+EOF
+if { (eval echo configure:2253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_decl_sys_siglist=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_decl_sys_siglist=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
+if test $ac_cv_decl_sys_siglist = yes; then
+ cat >> confdefs.h <<\EOF
+#define SYS_SIGLIST_DECLARED 1
+EOF
+
+fi
+
+echo $ac_n "checking for _sys_siglist declaration""... $ac_c" 1>&6
+echo "configure:2274: checking for _sys_siglist declaration" >&5
+if eval "test \"`echo '$''{'ac_cv_decl__sys_siglist'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2279 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+/* Somebody might declare _sys_siglist in unistd.h. */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *msg = *(_sys_siglist + 1);
+; return 0; }
+EOF
+if { (eval echo configure:2291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_decl__sys_siglist=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_decl__sys_siglist=no
+fi
+rm -f conftest*
+fi
+echo "$ac_t""$ac_cv_decl__sys_siglist" 1>&6
+if test $ac_cv_decl__sys_siglist = yes; then
+ cat >> confdefs.h <<\EOF
+#define SYS_SIGLIST_DECLARED 1
+EOF
+
+fi
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile $osarch/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@opsys@%$opsys%g
+s%@arch@%$arch%g
+s%@osarch@%$osarch%g
+s%@CC@%$CC%g
+s%@HOSTCC@%$HOSTCC%g
+s%@AWK@%$AWK%g
+s%@WARNFLAGS@%$WARNFLAGS%g
+s%@CPP@%$CPP%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@LIBOBJS@%$LIBOBJS%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile $osarch/Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/configure.in b/configure.in
new file mode 100644
index 000000000..32200b46f
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,133 @@
+AC_INIT(strace.c)
+AC_CANONICAL_HOST()
+AC_MSG_CHECKING(for supported operating system)
+changequote(,)dnl
+
+case "$host_os" in
+linux*)
+ opsys=linux
+ ;;
+sunos4*)
+ opsys=sunos4
+ ;;
+solaris2*)
+ opsys=svr4
+ ;;
+sysv4*)
+ opsys=svr4
+ ;;
+irix5*)
+ opsys=svr4
+ ;;
+*)
+ AC_MSG_ERROR(this operating system is not yet supported by strace)
+ ;;
+esac
+AC_MSG_RESULT($opsys)
+
+# Autoheader trick. Heh, heh.
+opsys_list='
+@@@syms="$syms LINUX SUNOS4 SVR4"@@@
+'
+
+AC_MSG_CHECKING(for supported architecture)
+case "$host_cpu" in
+i[3456]86|pentium)
+ arch=i386
+ ;;
+m68k)
+ arch=m68k
+ ;;
+sparc)
+ arch=sparc
+ ;;
+mips)
+ arch=mips
+ ;;
+alpha*)
+ arch=alpha
+ ;;
+ppc|powerpc)
+ arch=powerpc
+ ;;
+arm)
+ arch=arm
+ ;;
+*)
+ AC_MSG_ERROR(this architecture is not yet supported by strace)
+ ;;
+esac
+AC_MSG_RESULT($arch)
+
+# Autoheader trick. Heh, heh.
+arch_list='
+@@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM"@@@
+'
+
+osarch="$opsys"
+if [ -d "$srcdir/$opsys/$arch" ]; then
+ osarch="$opsys/$arch"
+fi
+
+OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
+ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
+
+changequote([,])dnl
+AC_CONFIG_HEADER(config.h)
+AC_SUBST(opsys)
+AC_DEFINE_UNQUOTED($OPSYS)
+AC_SUBST(arch)
+AC_DEFINE_UNQUOTED($ARCH)
+AC_SUBST(osarch)
+AC_PROG_CC
+AC_PROG_HOSTCC($host_alias $host)
+AC_C_CROSS
+AC_POLLABLE_PROCFS
+AC_STRUCT_PR_SYSCALL
+AC_STRUCT_MSG_CONTROL
+AC_INCLUDEDIR
+if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
+then
+ AC_MSG_CHECKING(for valid machine include directory)
+ if test -d "$includedir/sun4"
+ then
+ rm -f machine
+ ln -s $includedir/sun4 machine
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+AC_WARNFLAGS
+if test "x$OPSYS" = "xSUNOS4"
+then
+ if test -n "$GCC"
+ then
+ # SunOS 4.x header files don't declare int functions.
+ WARNFLAGS="$WARNFLAGS -Wno-implicit"
+ fi
+fi
+AC_PROG_CPP
+AC_PROG_GCC_TRADITIONAL
+AC_PROG_INSTALL
+AC_C_CONST
+AC_HEADER_STDC
+AC_HEADER_DIRENT
+AC_TYPE_SIGNAL
+AC_STRUCT_ST_BLKSIZE
+AC_STRUCT_ST_BLOCKS
+AC_STRUCT_ST_RDEV
+AC_HEADER_STAT
+AC_TYPE_UID_T
+AC_TYPE_MODE_T
+AC_TYPE_GETGROUPS
+AC_HEADER_MAJOR
+AC_SIG_ATOMIC_T
+AC_CHECK_LIB(nsl, main)
+AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg)
+AC_CHECK_HEADERS(sys/filio.h sys/asynch.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h)
+AC_DECL_SYS_ERRLIST
+AC_DECL_SYS_SIGLIST
+AC_DECL__SYS_SIGLIST
+AC_OUTPUT(Makefile $osarch/Makefile)
diff --git a/defs.h b/defs.h
new file mode 100644
index 000000000..d9ecccca4
--- /dev/null
+++ b/defs.h
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/* configuration section */
+#ifndef MAX_QUALS
+#define MAX_QUALS 1024 /* maximum number of syscalls, signals, etc. */
+#endif
+#ifndef MAX_PROCS
+#define MAX_PROCS 32 /* maximum number of processes tracable */
+#endif
+#ifndef DEFAULT_STRLEN
+#define DEFAULT_STRLEN 32 /* default maximum # of bytes printed in
+ `printstr', change with `-s' switch */
+#endif
+#ifndef DEFAULT_ACOLUMN
+#define DEFAULT_ACOLUMN 40 /* default alignment column for results */
+#endif
+#ifndef MAX_ARGS
+#define MAX_ARGS 32 /* maximum number of args to a syscall */
+#endif
+#ifndef DEFAULT_SORTBY
+#define DEFAULT_SORTBY "time" /* default sorting method for call profiling */
+#endif
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include <sys/time.h>
+#include <errno.h>
+
+#ifdef STDC_HEADERS
+#include <stddef.h>
+#endif /* STDC_HEADERS */
+
+#if defined(LINUX) && defined(SPARC)
+#define LINUXSPARC
+#endif /* LINUX && SPARC */
+
+#ifdef SVR4
+#include <sys/procfs.h>
+#else /* !SVR4 */
+#if defined(LINUXSPARC) && defined(__GLIBC__)
+#include <sys/ptrace.h>
+#else
+/* Work around awkward prototype in ptrace.h. */
+#define ptrace xptrace
+#include <sys/ptrace.h>
+#undef ptrace
+#ifdef POWERPC
+#define __KERNEL__
+#include <asm/ptrace.h>
+#undef __KERNEL__
+/* TEMP */
+#define UESP PT_R1
+#define EIP PT_NIP
+#define EAX PT_R3
+#define ORIG_EAX PT_ORIG_R3
+#endif
+#ifdef __STDC__
+#ifdef LINUX
+extern long ptrace(int, int, char *, long);
+#else /* !LINUX */
+extern int ptrace(int, int, char *, int, ...);
+#endif /* !LINUX */
+#else /* !__STDC__ */
+extern int ptrace();
+#endif /* !__STDC__ */
+#endif /* !LINUXSPARC */
+#endif /* !SVR4 */
+
+#ifdef LINUX
+#if !defined(LINUXSPARC) || !defined(__GLIBC__)
+#define PTRACE_PEEKUSER PTRACE_PEEKUSR
+#define PTRACE_POKEUSER PTRACE_POKEUSR
+#endif
+#ifdef ALPHA
+#define REG_R0 0
+#define REG_A0 16
+#define REG_A3 19
+#define REG_FP 30
+#define REG_PC 64
+#endif /* ALPHA */
+#endif /* LINUX */
+
+#define SUPPORTED_PERSONALITIES 1
+#define DEFAULT_PERSONALITY 0
+
+#ifdef LINUXSPARC
+#include <linux/a.out.h>
+#include <asm/psr.h>
+#undef SUPPORTED_PERSONALITIES
+#define SUPPORTED_PERSONALITIES 3
+#endif /* LINUXSPARC */
+
+/* Trace Control Block */
+struct tcb {
+ short flags; /* See below for TCB_ values */
+ int pid; /* Process Id of this entry */
+ long scno; /* System call number */
+ int u_nargs; /* System call arguments */
+ long u_arg[MAX_ARGS]; /* System call arguments */
+ int u_error; /* Error code */
+ long u_rval; /* (first) return value */
+ FILE *outf; /* Output file for this process */
+ char *auxstr; /* Auxiliary info from syscall (see RVAL_STR) */
+ struct timeval stime; /* System time usage as of last process wait */
+ struct timeval dtime; /* Delta for system time usage */
+ struct timeval etime; /* Syscall entry time */
+ /* Support for tracing forked processes */
+ struct tcb *parent; /* Parent of this process */
+ int nchildren; /* # of traced children */
+ int waitpid; /* pid(s) this process is waiting for */
+ /* (1st arg of wait4()) */
+ long baddr; /* `Breakpoint' address */
+ long inst[2]; /* Instructions on above */
+ int pfd; /* proc file descriptor */
+#ifdef SVR4
+ prstatus_t status; /* procfs status structure */
+#endif
+};
+
+/* TCB flags */
+#define TCB_STARTUP 00001 /* We have just begun ptracing this process */
+#define TCB_INUSE 00002 /* This table entry is in use */
+#define TCB_INSYSCALL 00004 /* A system call is in progress */
+#define TCB_ATTACHED 00010 /* Process is not our own child */
+#define TCB_EXITING 00020 /* As far as we know, this process is exiting */
+#define TCB_SUSPENDED 00040 /* Process has done a wait(4), that can
+ not be allowed to complete just now */
+#define TCB_BPTSET 00100 /* "Breakpoint" set after fork(2) */
+#define TCB_SIGTRAPPED 00200 /* Process wanted to block SIGTRAP */
+#define TCB_FOLLOWFORK 00400 /* Process should have forks followed */
+#define TCB_REPRINT 01000 /* We should reprint this syscall on exit */
+#ifdef LINUX
+#if defined(ALPHA) || defined(SPARC) || defined(POWERPC)
+#define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */
+#endif /* ALPHA */
+#endif /* LINUX */
+
+/* qualifier flags */
+#define QUAL_TRACE 0001 /* this system call should be traced */
+#define QUAL_ABBREV 0002 /* abbreviate the structures of this syscall */
+#define QUAL_VERBOSE 0004 /* decode the structures of this syscall */
+#define QUAL_RAW 0010 /* print all args in hex for this syscall */
+#define QUAL_SIGNAL 0020 /* report events with this signal */
+#define QUAL_FAULT 0040 /* report events with this fault */
+#define QUAL_READ 0100 /* dump data read on this file descriptor */
+#define QUAL_WRITE 0200 /* dump data written to this file descriptor */
+
+#define entering(tcp) (!((tcp)->flags & TCB_INSYSCALL))
+#define exiting(tcp) ((tcp)->flags & TCB_INSYSCALL)
+#define syserror(tcp) ((tcp)->u_error != 0)
+#define verbose(tcp) (qual_flags[(tcp)->scno] & QUAL_VERBOSE)
+#define abbrev(tcp) (qual_flags[(tcp)->scno] & QUAL_ABBREV)
+#define waiting_parent(tcp) \
+ (tcp->parent && \
+ (tcp->parent->flags & TCB_SUSPENDED) && \
+ (tcp->parent->waitpid <= 0 || tcp->parent->waitpid == tcp->pid))
+
+struct xlat {
+ int val;
+ char *str;
+};
+
+/* Format of syscall return values */
+#define RVAL_DECIMAL 000 /* decimal format */
+#define RVAL_HEX 001 /* hex format */
+#define RVAL_OCTAL 002 /* octal format */
+#define RVAL_UDECIMAL 003 /* unsigned decimal format */
+#define RVAL_MASK 007 /* mask for these values */
+
+#define RVAL_STR 010 /* Print `auxstr' field after return val */
+#define RVAL_NONE 020 /* Print nothing */
+
+#ifndef offsetof
+#define offsetof(type, member) (((char *) &(((type *) NULL)->member)) - \
+ ((char *) (type *) NULL))
+#endif /* !offsetof */
+
+/* get offset of member within a user struct */
+#define uoff(member) offsetof(struct user, member)
+
+#define TRACE_FILE 001 /* Trace file-related syscalls. */
+#define TRACE_IPC 002 /* Trace IPC-related syscalls. */
+#define TRACE_NETWORK 004 /* Trace network-related syscalls. */
+#define TRACE_PROCESS 010 /* Trace process-related syscalls. */
+#define TRACE_SIGNAL 020 /* Trace signal-related syscalls. */
+
+extern struct tcb tcbtab[];
+extern int qual_flags[];
+extern int debug, followfork, followvfork;
+extern int rflag, tflag, dtime, cflag, xflag, qflag;
+extern int acolumn;
+extern char *outfname;
+extern int nprocs;
+extern int max_strlen;
+extern struct tcb *tcp_last;
+
+#ifdef __STDC__
+#define P(args) args
+#else
+#define P(args) ()
+#endif
+
+extern int set_personality P((int personality));
+extern char *xlookup P((struct xlat *, int));
+extern struct tcb *alloctcb P((int));
+extern void droptcb P((struct tcb *));
+
+extern void set_sortby P((char *));
+extern void set_overhead P((int));
+extern void qualify P((char *));
+extern void newoutf P((struct tcb *));
+extern int trace_syscall P((struct tcb *));
+extern void printxval P((struct xlat *, int, char *));
+extern int printargs P((struct tcb *));
+extern int addflags P((struct xlat *, int));
+extern int printflags P((struct xlat *, int));
+extern int umoven P((struct tcb *, long, int, char *));
+extern int umovestr P((struct tcb *, long, int, char *));
+extern int upeek P((int, long, long *));
+extern void dumpstr P((struct tcb *, long, int));
+extern void string_quote P((char *str));
+extern void printstr P((struct tcb *, long, int));
+extern void printnum P((struct tcb *, long, char *));
+extern void printpath P((struct tcb *, long));
+extern void printpathn P((struct tcb *, long, int));
+extern void printtv P((struct tcb *, long));
+extern void printsock P((struct tcb *, long));
+extern void printrusage P((struct tcb *, long));
+extern int clearbpt P((struct tcb *));
+extern int setbpt P((struct tcb *));
+extern int sigishandled P((struct tcb *, int));
+extern void printcall P((struct tcb *));
+extern void printsignal P((int));
+extern void printleader P((struct tcb *));
+extern void printtrailer P((struct tcb *));
+extern void tabto P((int));
+extern void call_summary P((FILE *));
+extern void fake_execve P((struct tcb *, char *, char *[], char *[]));
+
+extern int internal_fork P((struct tcb *));
+extern int internal_exec P((struct tcb *));
+extern int internal_wait P((struct tcb *));
+extern int internal_exit P((struct tcb *));
+
+extern char *ioctl_lookup P((long));
+extern int ioctl_decode P((struct tcb *, long, long));
+extern int term_ioctl P((struct tcb *, long, long));
+extern int sock_ioctl P((struct tcb *, long, long));
+extern int proc_ioctl P((struct tcb *, int, int));
+extern int stream_ioctl P((struct tcb *, int, int));
+
+extern void tv_tv P((struct timeval *, int, int));
+extern int tv_nz P((struct timeval *));
+extern int tv_cmp P((struct timeval *, struct timeval *));
+extern double tv_float P((struct timeval *));
+extern void tv_add P((struct timeval *, struct timeval *, struct timeval *));
+extern void tv_sub P((struct timeval *, struct timeval *, struct timeval *));
+extern void tv_mul P((struct timeval *, struct timeval *, int));
+extern void tv_div P((struct timeval *, struct timeval *, int));
+
+#ifdef SUNOS4
+extern int fixvfork P((struct tcb *));
+#endif
+#if !(defined(LINUX) && !defined(SPARC))
+extern long getrval2 P((struct tcb *));
+#endif
+#ifdef SVR4
+extern int proc_open P((struct tcb *tcp, int attaching));
+#endif
+
+#define umove(pid, addr, objp) \
+ umoven((pid), (addr), sizeof *(objp), (char *) (objp))
+
+#ifdef __STDC__
+#ifdef __GNUC__
+extern void tprintf(const char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
+#else
+extern void tprintf(const char *fmt, ...);
+#endif
+#else
+extern void tprintf();
+#endif
+
+#ifndef HAVE_STRERROR
+const char *strerror P((int));
+#endif
+#ifndef HAVE_STRSIGNAL
+const char *strsignal P((int));
+#endif
+
+extern int current_personality;
+
+struct sysent {
+ int nargs;
+ int sys_flags;
+ int (*sys_func)();
+ char *sys_name;
+};
+
+extern struct sysent *sysent;
+extern int nsyscalls;
+
+extern char **errnoent;
+extern int nerrnos;
+
+struct ioctlent {
+ char *doth;
+ char *symbol;
+ unsigned long code;
+};
+
+extern struct ioctlent *ioctlent;
+extern int nioctlent;
+
+extern char **signalent;
+extern int nsignals;
+
+extern struct ioctlent *ioctlent;
+extern int nioctlents;
+extern char **signalent;
+extern int nsignals;
+
+extern struct ioctlent ioctlent0[];
+extern int nioctlents0;
+extern char *signalent0[];
+extern int nsignals0;
+
+#if SUPPORTED_PERSONALITIES >= 2
+extern struct ioctlent ioctlent1[];
+extern int nioctlents1;
+extern char *signalent1[];
+extern int nsignals1;
+#endif /* SUPPORTED_PERSONALITIES >= 2 */
+
+#if SUPPORTED_PERSONALITIES >= 3
+extern struct ioctlent ioctlent2[];
+extern int nioctlents2;
+extern char *signalent2[];
+extern int nsignals2;
+#endif /* SUPPORTED_PERSONALITIES >= 3 */
diff --git a/desc.c b/desc.c
new file mode 100644
index 000000000..f1e0334dc
--- /dev/null
+++ b/desc.c
@@ -0,0 +1,390 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+#include <sys/file.h>
+
+static struct xlat fcntlcmds[] = {
+ { F_DUPFD, "F_DUPFD" },
+ { F_GETFD, "F_GETFD" },
+ { F_SETFD, "F_SETFD" },
+ { F_GETFL, "F_GETFL" },
+ { F_SETFL, "F_SETFL" },
+ { F_GETLK, "F_GETLK" },
+ { F_SETLK, "F_SETLK" },
+ { F_SETLKW, "F_SETLKW" },
+ { F_GETOWN, "F_GETOWN" },
+ { F_SETOWN, "F_SETOWN" },
+#ifdef F_RSETLK
+ { F_RSETLK, "F_RSETLK" },
+#endif
+#ifdef F_RSETLKW
+ { F_RSETLKW, "F_RSETLKW" },
+#endif
+#ifdef F_RGETLK
+ { F_RGETLK, "F_RGETLK" },
+#endif
+#ifdef F_CNVT
+ { F_CNVT, "F_CNVT" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat fdflags[] = {
+#ifdef FD_CLOEXEC
+ { FD_CLOEXEC, "FD_CLOEXEC" },
+#endif
+ { 0, NULL },
+};
+
+#ifdef LOCK_SH
+
+static struct xlat flockcmds[] = {
+ { LOCK_SH, "LOCK_SH" },
+ { LOCK_EX, "LOCK_EX" },
+ { LOCK_NB, "LOCK_NB" },
+ { LOCK_UN, "LOCK_UN" },
+ { 0, NULL },
+};
+
+#endif /* LOCK_SH */
+
+static struct xlat lockfcmds[] = {
+ { F_RDLCK, "F_RDLCK" },
+ { F_WRLCK, "F_WRLCK" },
+ { F_UNLCK, "F_UNLCK" },
+#ifdef F_EXLCK
+ { F_EXLCK, "F_EXLCK" },
+#endif
+#ifdef F_SHLCK
+ { F_SHLCK, "F_SHLCK" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat whence[] = {
+ { SEEK_SET, "SEEK_SET" },
+ { SEEK_CUR, "SEEK_CUR" },
+ { SEEK_END, "SEEK_END" },
+ { 0, NULL },
+};
+
+/* fcntl/lockf */
+static void
+printflock(tcp, addr, getlk)
+struct tcb *tcp;
+int addr;
+int getlk;
+{
+ struct flock fl;
+
+ if (umove(tcp, addr, &fl) < 0) {
+ tprintf("{...}");
+ return;
+ }
+ tprintf("{type=");
+ printxval(lockfcmds, fl.l_type, "F_???");
+ tprintf(", whence=");
+ printxval(whence, fl.l_whence, "SEEK_???");
+ tprintf(", start=%ld, len=%ld", fl.l_start, fl.l_len);
+ if (getlk)
+ tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
+ else
+ tprintf("}");
+}
+
+static char *
+sprintflags(xlat, flags)
+struct xlat *xlat;
+int flags;
+{
+ static char outstr[1024];
+ char *sep;
+
+ strcpy(outstr, "flags ");
+ sep = "";
+ for (; xlat->str; xlat++) {
+ if ((flags & xlat->val) == xlat->val) {
+ sprintf(outstr + strlen(outstr),
+ "%s%s", sep, xlat->str);
+ sep = "|";
+ flags &= ~xlat->val;
+ }
+ }
+ if (flags)
+ sprintf(outstr + strlen(outstr),
+ "%s%#x", sep, flags);
+ return outstr;
+}
+
+int
+sys_fcntl(tcp)
+struct tcb *tcp;
+{
+ extern struct xlat openmodes[];
+
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printxval(fcntlcmds, tcp->u_arg[1], "F_???");
+ switch (tcp->u_arg[1]) {
+ case F_SETFD:
+ tprintf(", ");
+ if (printflags(fdflags, tcp->u_arg[2]) == 0)
+ tprintf("0");
+ break;
+ case F_SETOWN: case F_DUPFD:
+ tprintf(", %ld", tcp->u_arg[2]);
+ break;
+ case F_SETFL:
+ tprintf(", ");
+ if (printflags(openmodes, tcp->u_arg[2] + 1) == 0)
+ tprintf("0");
+ break;
+ case F_SETLK: case F_SETLKW:
+ tprintf(", ");
+ printflock(tcp, tcp->u_arg[2], 0);
+ break;
+ }
+ }
+ else {
+ switch (tcp->u_arg[1]) {
+ case F_DUPFD:
+ case F_SETFD: case F_SETFL:
+ case F_SETLK: case F_SETLKW:
+ case F_SETOWN: case F_GETOWN:
+ break;
+ case F_GETFD:
+ if (tcp->u_rval == 0)
+ return 0;
+ tcp->auxstr = sprintflags(fdflags, tcp->u_rval);
+ return RVAL_HEX|RVAL_STR;
+ case F_GETFL:
+ tcp->auxstr = sprintflags(openmodes, tcp->u_rval + 1);
+ return RVAL_HEX|RVAL_STR;
+ case F_GETLK:
+ tprintf(", ");
+ printflock(tcp, tcp->u_arg[2], 1);
+ break;
+ default:
+ tprintf(", %#lx", tcp->u_arg[2]);
+ break;
+ }
+ }
+ return 0;
+}
+
+#ifdef LOCK_SH
+
+int
+sys_flock(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ if (!printflags(flockcmds, tcp->u_arg[1]))
+ tprintf("LOCK_???");
+ }
+ return 0;
+}
+#endif /* LOCK_SH */
+
+int
+sys_close(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld", tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_dup(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld", tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_dup2(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, %ld", tcp->u_arg[0], tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_getdtablesize(tcp)
+struct tcb *tcp;
+{
+ return 0;
+}
+
+static int
+decode_select(tcp, args)
+struct tcb *tcp;
+long *args;
+{
+ int i, j, nfds;
+ fd_set fds;
+ struct timeval tv;
+ static char outstr[1024];
+ char *sep;
+ long arg;
+
+ if (entering(tcp)) {
+ nfds = args[0];
+ tprintf("%d", nfds);
+ for (i = 0; i < 3; i++) {
+ arg = args[i+1];
+ if (arg == 0) {
+ tprintf(", NULL");
+ continue;
+ }
+ if (!verbose(tcp)) {
+ tprintf(", %#lx", arg);
+ continue;
+ }
+ if (umove(tcp, arg, &fds) < 0) {
+ tprintf(", [?]");
+ continue;
+ }
+ tprintf(", [");
+ for (j = 0, sep = ""; j < nfds; j++) {
+ if (FD_ISSET(j, &fds)) {
+ tprintf("%s%u", sep, j);
+ sep = " ";
+ }
+ }
+ tprintf("]");
+ }
+ if (!args[4])
+ tprintf(", NULL");
+ else if (!verbose(tcp))
+ tprintf(", %#lx", args[4]);
+ else if (umove(tcp, args[4], &tv) < 0)
+ tprintf(", {...}");
+ else {
+ tprintf(", {%lu, %lu}",
+ (long) tv.tv_sec, (long) tv.tv_usec);
+ }
+ }
+ else {
+ unsigned int cumlen = 0;
+ char *sep = "";
+
+ if (syserror(tcp))
+ return 0;
+
+ if ((nfds = tcp->u_rval) == 0) {
+ tcp->auxstr = "Timeout";
+ return RVAL_STR;
+ }
+ outstr[0] = '\0';
+ for (i = 0; i < 3; i++) {
+ int first = 1;
+ char str[20];
+
+ tcp->auxstr = outstr;
+ arg = args[i+1];
+ if (!arg || umove(tcp, arg, &fds) < 0)
+ continue;
+ for (j = 0; j < args[0]; j++) {
+ if (FD_ISSET(j, &fds)) {
+ if (first) {
+ sprintf(str, "%s%s [%u", sep,
+ i == 0 ? "in" :
+ i == 1 ? "out" :
+ "except", j);
+ first = 0;
+ sep = ", ";
+ }
+ else
+ sprintf(str, " %u", j);
+ cumlen += strlen(str);
+ if (cumlen < sizeof(outstr))
+ strcat(outstr, str);
+ nfds--;
+ }
+ }
+ if (cumlen)
+ strcat(outstr, "]");
+ if (nfds == 0)
+ break;
+ }
+#ifdef LINUX
+ /* This contains no useful information on SunOS. */
+ if (args[4]) {
+ char str[20];
+
+ if (umove(tcp, args[4], &tv) >= 0)
+ sprintf(str, "%sleft {%lu, %lu}", sep,
+ (long) tv.tv_sec, (long) tv.tv_usec);
+ if ((cumlen += strlen(str)) < sizeof(outstr))
+ strcat(outstr, str);
+ }
+#endif /* LINUX */
+ return RVAL_STR;
+ }
+ return 0;
+}
+
+#ifdef LINUX
+
+int
+sys_oldselect(tcp)
+struct tcb *tcp;
+{
+ long args[5];
+
+ if (umoven(tcp, tcp->u_arg[0], sizeof args, (char *) args) < 0) {
+ tprintf("[...]");
+ return 0;
+ }
+ return decode_select(tcp, args);
+}
+
+#endif /* LINUX */
+
+int
+sys_select(tcp)
+struct tcb *tcp;
+{
+ long *args = tcp->u_arg;
+ return decode_select(tcp, args);
+}
diff --git a/errnoent.sh b/errnoent.sh
new file mode 100644
index 000000000..3a709ae5c
--- /dev/null
+++ b/errnoent.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+awk '
+/^#define[ ]+E[A-Z0-9_]+[ ]+[0-9]+/ {
+ errno[$3] = $2
+ if ($3 > max)
+ max = $3
+}
+END {
+ for (i = 0; i <= max; i++) {
+ if (!errno[i])
+ errno[i] = "ERRNO_" i
+ printf "\t\"%s\", /* %d */\n", errno[i], i
+ }
+}
+' $*
diff --git a/file.c b/file.c
new file mode 100644
index 000000000..7da124171
--- /dev/null
+++ b/file.c
@@ -0,0 +1,1302 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <dirent.h>
+
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#ifdef SVR4
+# include <sys/cred.h>
+#endif /* SVR4 */
+
+#include <sys/vfs.h>
+
+#ifdef MAJOR_IN_SYSMACROS
+#include <sys/sysmacros.h>
+#endif
+
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#endif
+
+#ifdef HAVE_SYS_ASYNCH_H
+#include <sys/asynch.h>
+#endif
+
+#ifdef SUNOS4
+#include <ustat.h>
+#endif
+
+/*
+ * This is a really dirty trick but it should always work. Traditional
+ * Unix says r/w/rw are 0/1/2, so we make them true flags 1/2/3 by
+ * adding 1. Just remember to add 1 to any arg decoded with openmodes.
+ */
+struct xlat openmodes[] = {
+ { O_RDWR+1, "O_RDWR" },
+ { O_RDONLY+1, "O_RDONLY" },
+ { O_WRONLY+1, "O_WRONLY" },
+ { O_NONBLOCK, "O_NONBLOCK" },
+ { O_APPEND, "O_APPEND" },
+ { O_CREAT, "O_CREAT" },
+ { O_TRUNC, "O_TRUNC" },
+ { O_EXCL, "O_EXCL" },
+ { O_NOCTTY, "O_NOCTTY" },
+#ifdef O_SYNC
+ { O_SYNC, "O_SYNC" },
+#endif
+#ifdef O_ASYNC
+ { O_ASYNC, "O_ASYNC" },
+#endif
+#ifdef O_DSYNC
+ { O_DSYNC, "O_DSYNC" },
+#endif
+#ifdef O_RSYNC
+ { O_RSYNC, "O_RSYNC" },
+#endif
+#ifdef O_NDELAY
+ { O_NDELAY, "O_NDELAY" },
+#endif
+#ifdef O_PRIV
+ { O_PRIV, "O_PRIV" },
+#endif
+#ifdef O_DIRECT
+ { O_DIRECT, "O_DIRECT" },
+#endif
+#ifdef O_LARGEFILE
+ { O_LARGEFILE, "O_LARGEFILE" },
+#endif
+#ifdef O_DIRECTORY
+ { O_DIRECTORY, "O_DIRECTORY" },
+#endif
+
+#ifdef FNDELAY
+ { FNDELAY, "FNDELAY" },
+#endif
+#ifdef FAPPEND
+ { FAPPEND, "FAPPEND" },
+#endif
+#ifdef FMARK
+ { FMARK, "FMARK" },
+#endif
+#ifdef FDEFER
+ { FDEFER, "FDEFER" },
+#endif
+#ifdef FASYNC
+ { FASYNC, "FASYNC" },
+#endif
+#ifdef FSHLOCK
+ { FSHLOCK, "FSHLOCK" },
+#endif
+#ifdef FEXLOCK
+ { FEXLOCK, "FEXLOCK" },
+#endif
+#ifdef FCREAT
+ { FCREAT, "FCREAT" },
+#endif
+#ifdef FTRUNC
+ { FTRUNC, "FTRUNC" },
+#endif
+#ifdef FEXCL
+ { FEXCL, "FEXCL" },
+#endif
+#ifdef FNBIO
+ { FNBIO, "FNBIO" },
+#endif
+#ifdef FSYNC
+ { FSYNC, "FSYNC" },
+#endif
+#ifdef FNOCTTY
+ { FNOCTTY, "FNOCTTY" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_open(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ /* flags */
+ printflags(openmodes, tcp->u_arg[1] + 1);
+ if (tcp->u_arg[1] & O_CREAT) {
+ /* mode */
+ tprintf(", %#lo", tcp->u_arg[2]);
+ }
+ }
+ return 0;
+}
+
+#ifdef LINUXSPARC
+struct xlat openmodessol[] = {
+ { 0, "O_RDWR" },
+ { 1, "O_RDONLY" },
+ { 2, "O_WRONLY" },
+ { 0x80, "O_NONBLOCK" },
+ { 8, "O_APPEND" },
+ { 0x100, "O_CREAT" },
+ { 0x200, "O_TRUNC" },
+ { 0x400, "O_EXCL" },
+ { 0x800, "O_NOCTTY" },
+ { 0x10, "O_SYNC" },
+ { 0x40, "O_DSYNC" },
+ { 0x8000, "O_RSYNC" },
+ { 4, "O_NDELAY" },
+ { 0x1000, "O_PRIV" },
+ { 0, NULL },
+};
+
+int
+solaris_open(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ /* flags */
+ printflags(openmodessol, tcp->u_arg[1] + 1);
+ if (tcp->u_arg[1] & 0x100) {
+ /* mode */
+ tprintf(", %#lo", tcp->u_arg[2]);
+ }
+ }
+ return 0;
+}
+
+#endif
+
+int
+sys_creat(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %#lo", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+static struct xlat access_flags[] = {
+ { F_OK, "F_OK", },
+ { R_OK, "R_OK" },
+ { W_OK, "W_OK" },
+ { X_OK, "X_OK" },
+#ifdef EFF_ONLY_OK
+ { EFF_ONLY_OK, "EFF_ONLY_OK" },
+#endif
+#ifdef EX_OK
+ { EX_OK, "EX_OK" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_access(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printflags(access_flags, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_umask(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%#lo", tcp->u_arg[0]);
+ }
+ return RVAL_OCTAL;
+}
+
+static struct xlat whence[] = {
+ { SEEK_SET, "SEEK_SET" },
+ { SEEK_CUR, "SEEK_CUR" },
+ { SEEK_END, "SEEK_END" },
+ { 0, NULL },
+};
+
+int
+sys_lseek(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ if (tcp->u_arg[2] == SEEK_SET)
+ tprintf("%lu, ", tcp->u_arg[1]);
+ else
+ tprintf("%ld, ", tcp->u_arg[1]);
+ printxval(whence, tcp->u_arg[2], "SEEK_???");
+ }
+ return RVAL_UDECIMAL;
+}
+
+#ifdef LINUX
+int
+sys_llseek (tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ if (tcp->u_arg[4] == SEEK_SET)
+ tprintf("%ld, %llu, ", tcp->u_arg[0],
+ (((unsigned long long int) tcp->u_arg[1]) << 32
+ | (unsigned long) tcp->u_arg[2]));
+ else
+ tprintf("%ld, %lld, ", tcp->u_arg[0],
+ (((long long int) tcp->u_arg[1]) << 32
+ | (unsigned long) tcp->u_arg[2]));
+ }
+ else {
+ if (syserror(tcp))
+ tprintf("%#lx, ", tcp->u_arg[3]);
+ else {
+ long long int off;
+ umove(tcp, tcp->u_arg[3], &off);
+ tprintf("{%lld}, ", off);
+ }
+ printxval(whence, tcp->u_arg[4], "SEEK_???");
+ }
+ return 0;
+}
+#endif
+
+int
+sys_truncate(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %lu", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_ftruncate(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+/* several stats */
+
+static struct xlat modetypes[] = {
+ { S_IFREG, "S_IFREG" },
+ { S_IFSOCK, "S_IFSOCK" },
+ { S_IFIFO, "S_IFIFO" },
+ { S_IFLNK, "S_IFLNK" },
+ { S_IFDIR, "S_IFDIR" },
+ { S_IFBLK, "S_IFBLK" },
+ { S_IFCHR, "S_IFCHR" },
+ { 0, NULL },
+};
+
+static char *
+sprintmode(mode)
+int mode;
+{
+ static char buf[64];
+ char *s;
+
+ if ((mode & S_IFMT) == 0)
+ s = "";
+ else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) {
+ sprintf(buf, "%#o", mode);
+ return buf;
+ }
+ sprintf(buf, "%s%s%s%s", s,
+ (mode & S_ISUID) ? "|S_ISUID" : "",
+ (mode & S_ISGID) ? "|S_ISGID" : "",
+ (mode & S_ISVTX) ? "|S_ISVTX" : "");
+ mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX);
+ if (mode)
+ sprintf(buf + strlen(buf), "|%#o", mode);
+ s = (*buf == '|') ? buf + 1 : buf;
+ return *s ? s : "0";
+}
+
+static char *
+sprinttime(t)
+time_t t;
+{
+ struct tm *tmp;
+ static char buf[32];
+
+ if (t == 0) {
+ sprintf(buf, "0");
+ return buf;
+ }
+ tmp = localtime(&t);
+ sprintf(buf, "%02d/%02d/%02d-%02d:%02d:%02d",
+ tmp->tm_year, tmp->tm_mon + 1, tmp->tm_mday,
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+ return buf;
+}
+
+#ifdef LINUXSPARC
+typedef struct {
+ int tv_sec;
+ int tv_nsec;
+} timestruct_t;
+
+struct solstat {
+ unsigned st_dev;
+ int st_pad1[3]; /* network id */
+ unsigned st_ino;
+ unsigned st_mode;
+ unsigned st_nlink;
+ unsigned st_uid;
+ unsigned st_gid;
+ unsigned st_rdev;
+ int st_pad2[2];
+ int st_size;
+ int st_pad3; /* st_size, off_t expansion */
+ timestruct_t st_atime;
+ timestruct_t st_mtime;
+ timestruct_t st_ctime;
+ int st_blksize;
+ int st_blocks;
+ char st_fstype[16];
+ int st_pad4[8]; /* expansion area */
+};
+
+static void
+printstatsol(tcp, addr)
+struct tcb *tcp;
+int addr;
+{
+ struct solstat statbuf;
+
+ if (!addr) {
+ tprintf("NULL");
+ return;
+ }
+ if (syserror(tcp) || !verbose(tcp)) {
+ tprintf("%#x", addr);
+ return;
+ }
+ if (umove(tcp, addr, &statbuf) < 0) {
+ tprintf("{...}");
+ return;
+ }
+ if (!abbrev(tcp)) {
+ tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
+ (unsigned long) ((statbuf.st_dev >> 18) & 0x3fff),
+ (unsigned long) (statbuf.st_dev & 0x3ffff),
+ (unsigned long) statbuf.st_ino,
+ sprintmode(statbuf.st_mode));
+ tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
+ (unsigned long) statbuf.st_nlink,
+ (unsigned long) statbuf.st_uid,
+ (unsigned long) statbuf.st_gid);
+ tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize);
+ tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
+ }
+ else
+ tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
+ switch (statbuf.st_mode & S_IFMT) {
+ case S_IFCHR: case S_IFBLK:
+ tprintf("st_rdev=makedev(%lu, %lu), ",
+ (unsigned long) ((statbuf.st_rdev >> 18) & 0x3fff),
+ (unsigned long) (statbuf.st_rdev & 0x3ffff));
+ break;
+ default:
+ tprintf("st_size=%u, ", statbuf.st_size);
+ break;
+ }
+ if (!abbrev(tcp)) {
+ tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
+ tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
+ tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
+ }
+ else
+ tprintf("...}");
+}
+#endif
+
+#ifdef LINUXSPARC
+/* Ugly, bug GLIBC makes this necessary. */
+struct kernel_stat
+{
+ unsigned short int st_dev;
+ unsigned long int st_ino;
+ unsigned short int st_mode;
+ short int st_nlink;
+ unsigned short int st_uid;
+ unsigned short int st_gid;
+ unsigned short int st_rdev;
+ long int st_size;
+ long int st_atime;
+ unsigned long int __unused1;
+ long int st_mtime;
+ unsigned long int __unused2;
+ long int st_ctime;
+ unsigned long int __unused3;
+ long int st_blksize;
+ long int st_blocks;
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+};
+#endif
+static void
+printstat(tcp, addr)
+struct tcb *tcp;
+int addr;
+{
+ struct stat statbuf;
+
+#ifdef LINUXSPARC
+ if (current_personality == 1) {
+ printstatsol(tcp, addr);
+ return;
+ }
+#endif /* LINUXSPARC */
+
+ if (!addr) {
+ tprintf("NULL");
+ return;
+ }
+ if (syserror(tcp) || !verbose(tcp)) {
+ tprintf("%#x", addr);
+ return;
+ }
+ if (umove(tcp, addr, &statbuf) < 0) {
+ tprintf("{...}");
+ return;
+ }
+ if (!abbrev(tcp)) {
+ tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
+ (unsigned long) major(statbuf.st_dev),
+ (unsigned long) minor(statbuf.st_dev),
+ (unsigned long) statbuf.st_ino,
+ sprintmode(statbuf.st_mode));
+ tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
+ (unsigned long) statbuf.st_nlink,
+ (unsigned long) statbuf.st_uid,
+ (unsigned long) statbuf.st_gid);
+#ifdef HAVE_ST_BLKSIZE
+ tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize);
+#endif /* HAVE_ST_BLKSIZE */
+#ifdef HAVE_ST_BLOCKS
+ tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
+#endif /* HAVE_ST_BLOCKS */
+ }
+ else
+ tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
+ switch (statbuf.st_mode & S_IFMT) {
+ case S_IFCHR: case S_IFBLK:
+#ifdef HAVE_ST_RDEV
+ tprintf("st_rdev=makedev(%lu, %lu), ",
+ (unsigned long) major(statbuf.st_rdev),
+ (unsigned long) minor(statbuf.st_rdev));
+#else /* !HAVE_ST_RDEV */
+ tprintf("st_size=makedev(%lu, %lu), ",
+ (unsigned long) major(statbuf.st_size),
+ (unsigned long) minor(statbuf.st_size));
+#endif /* !HAVE_ST_RDEV */
+ break;
+ default:
+ tprintf("st_size=%lu, ", statbuf.st_size);
+ break;
+ }
+ if (!abbrev(tcp)) {
+ tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
+ tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
+ tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
+ }
+ else
+ tprintf("...}");
+}
+
+int
+sys_stat(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ } else {
+ printstat(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_fstat(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ tprintf("%ld, ", tcp->u_arg[0]);
+ else {
+ printstat(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_lstat(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ } else {
+ printstat(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#if defined(SVR4) || defined(LINUXSPARC)
+
+int
+sys_xstat(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", ");
+ } else {
+ printstat(tcp, tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_fxstat(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
+ else {
+ printstat(tcp, tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_lxstat(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", ");
+ } else {
+ printstat(tcp, tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_xmknod(tcp)
+struct tcb *tcp;
+{
+ int mode = tcp->u_arg[2];
+
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", %s", sprintmode(mode));
+ switch (mode & S_IFMT) {
+ case S_IFCHR: case S_IFBLK:
+#ifdef LINUXSPARC
+ tprintf(", makedev(%lu, %lu)",
+ (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
+ (unsigned long) (tcp->u_arg[3] & 0x3ffff));
+#else
+ tprintf(", makedev(%lu, %lu)",
+ (unsigned long) major(tcp->u_arg[3]),
+ (unsigned long) minor(tcp->u_arg[3]));
+#endif
+ break;
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
+#endif /* SVR4 || LINUXSPARC */
+
+#ifdef LINUX
+
+static struct xlat fsmagic[] = {
+ { 0xef51, "EXT2_OLD_SUPER_MAGIC" },
+ { 0xef53, "EXT2_SUPER_MAGIC" },
+ { 0x137d, "EXT_SUPER_MAGIC" },
+ { 0x9660, "ISOFS_SUPER_MAGIC" },
+ { 0x137f, "MINIX_SUPER_MAGIC" },
+ { 0x138f, "MINIX_SUPER_MAGIC2" },
+ { 0x2468, "NEW_MINIX_SUPER_MAGIC" },
+ { 0x4d44, "MSDOS_SUPER_MAGIC" },
+ { 0x6969, "NFS_SUPER_MAGIC" },
+ { 0x9fa0, "PROC_SUPER_MAGIC" },
+ { 0x012fd16d, "XIAFS_SUPER_MAGIC" },
+ { 0, NULL },
+};
+
+#endif /* LINUX */
+
+#ifndef SVR4
+
+static char *
+sprintfstype(magic)
+int magic;
+{
+ static char buf[32];
+#ifdef LINUX
+ char *s;
+
+ s = xlookup(fsmagic, magic);
+ if (s) {
+ sprintf(buf, "\"%s\"", s);
+ return buf;
+ }
+#endif /* LINUX */
+ sprintf(buf, "%#x", magic);
+ return buf;
+}
+
+static void
+printstatfs(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ struct statfs statbuf;
+
+ if (syserror(tcp) || !verbose(tcp)) {
+ tprintf("%#lx", addr);
+ return;
+ }
+ if (umove(tcp, addr, &statbuf) < 0) {
+ tprintf("{...}");
+ return;
+ }
+#ifdef ALPHA
+
+ tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
+ sprintfstype(statbuf.f_type),
+ statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
+ tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_namelen=%u}",
+ statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree, statbuf.f_namelen);
+#else /* !ALPHA */
+ tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
+ sprintfstype(statbuf.f_type),
+ statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
+ tprintf("f_files=%lu, f_ffree=%lu",
+ statbuf.f_files, statbuf.f_ffree);
+#ifdef LINUX
+ tprintf(", f_namelen=%lu}", statbuf.f_namelen);
+#endif /* LINUX */
+#endif /* !ALPHA */
+ tprintf("}");
+}
+
+int
+sys_statfs(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ } else {
+ printstatfs(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_fstatfs(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ } else {
+ printstatfs(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#ifdef LINUX
+#ifdef ALPHA
+
+int
+osf_statfs(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ } else {
+ printstatfs(tcp, tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+osf_fstatfs(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ } else {
+ printstatfs(tcp, tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+#endif /* ALPHA */
+#endif /* LINUX */
+
+#endif /* !SVR4 */
+
+#ifdef SUNOS4
+
+int
+sys_ustat(tcp)
+struct tcb *tcp;
+{
+ struct ustat statbuf;
+
+ if (entering(tcp)) {
+ tprintf("makedev(%lu, %lu), ",
+ (long) major(tcp->u_arg[0]),
+ (long) minor(tcp->u_arg[0]));
+ }
+ else {
+ if (syserror(tcp) || !verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umove(tcp, tcp->u_arg[1], &statbuf) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{f_tfree=%lu, f_tinode=%lu, ",
+ statbuf.f_tfree, statbuf.f_tinode);
+ tprintf("f_fname=\"%.*s\", ",
+ (int) sizeof(statbuf.f_fname),
+ statbuf.f_fname);
+ tprintf("f_fpack=\"%.*s\"}",
+ (int) sizeof(statbuf.f_fpack),
+ statbuf.f_fpack);
+ }
+ }
+ return 0;
+}
+
+#endif /* SUNOS4 */
+
+/* directory */
+int
+sys_chdir(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_mkdir(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %#lo", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_rmdir(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_fchdir(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld", tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_chroot(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_fchroot(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld", tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_link(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_unlink(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_symlink(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_readlink(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printpathn(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_rename(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_chown(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %lu, %lu", tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_fchown(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, %lu, %lu",
+ tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_chmod(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %#lo", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_fchmod(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, %#lo", tcp->u_arg[0], tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_utimes(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printtv(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_utime(tcp)
+struct tcb *tcp;
+{
+ long ut[2];
+
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ if (!tcp->u_arg[1])
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umoven(tcp, tcp->u_arg[1], sizeof ut,
+ (char *) ut) < 0)
+ tprintf("[?, ?]");
+ else {
+ tprintf("[%s,", sprinttime(ut[0]));
+ tprintf(" %s]", sprinttime(ut[1]));
+ }
+ }
+ return 0;
+}
+
+int
+sys_mknod(tcp)
+struct tcb *tcp;
+{
+ int mode = tcp->u_arg[1];
+
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %s", sprintmode(mode));
+ switch (mode & S_IFMT) {
+ case S_IFCHR: case S_IFBLK:
+#ifdef LINUXSPARC
+ if (current_personality == 1)
+ tprintf(", makedev(%lu, %lu)",
+ (unsigned long) ((tcp->u_arg[2] >> 18) & 0x3fff),
+ (unsigned long) (tcp->u_arg[2] & 0x3ffff));
+ else
+#endif
+ tprintf(", makedev(%lu, %lu)",
+ (unsigned long) major(tcp->u_arg[2]),
+ (unsigned long) minor(tcp->u_arg[2]));
+ break;
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
+int
+sys_mkfifo(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %#lo", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_fsync(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld", tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+#ifdef LINUX
+
+static void
+printdir(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ struct dirent d;
+
+ if (!verbose(tcp)) {
+ tprintf("%#lx", addr);
+ return;
+ }
+ if (umove(tcp, addr, &d) < 0) {
+ tprintf("{...}");
+ return;
+ }
+ tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
+#ifndef LINUX
+ /* This contains garbage under Linux. */
+ tprintf("d_off=%d, ", d.d_off);
+#endif /* !LINUX */
+#ifndef LINUX
+ /* No point in printing this out since the syscall returns it. */
+ tprintf("d_reclen=%u, ", d.d_reclen);
+#endif /* !LINUX */
+ tprintf("d_name=");
+ printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
+ tprintf("}");
+}
+
+int
+sys_readdir(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printdir(tcp, tcp->u_arg[1]);
+ /* Not much point in printing this out, it is always 1. */
+ if (tcp->u_arg[2] != 1)
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+#endif /* LINUX */
+
+int
+sys_getdents(tcp)
+struct tcb *tcp;
+{
+ int i, len, dents = 0;
+ char *buf;
+
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ return 0;
+ }
+ if (syserror(tcp) || !verbose(tcp)) {
+ tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
+ return 0;
+ }
+#ifdef linux
+#ifdef __sparc__
+ tprintf (" = Unknown value\n");
+ return 0;
+#endif
+#endif
+ len = tcp->u_rval;
+ if ((buf = malloc(len)) == NULL) {
+ tprintf("out of memory\n");
+ return 0;
+ }
+ if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
+ tprintf("{...}, %lu", tcp->u_arg[2]);
+ free(buf);
+ return 0;
+ }
+ if (!abbrev(tcp))
+ tprintf("{");
+ for (i = 0; i < len;) {
+ struct dirent *d = (struct dirent *) &buf[i];
+#ifdef LINUX
+ if (!abbrev(tcp)) {
+ tprintf("%s{d_ino=%lu, d_off=%lu, ",
+ i ? " " : "", d->d_ino, d->d_off);
+ tprintf("d_reclen=%u, d_name=\"%s\"}",
+ d->d_reclen, d->d_name);
+ }
+#endif /* LINUX */
+#ifdef SVR4
+ if (!abbrev(tcp)) {
+ tprintf("%s{d_ino=%lu, d_off=%lu, ",
+ i ? " " : "", d->d_ino, d->d_off);
+ tprintf("d_reclen=%u, d_name=\"%s\"}",
+ d->d_reclen, d->d_name);
+ }
+#endif /* SVR4 */
+#ifdef SUNOS4
+ if (!abbrev(tcp)) {
+ tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
+ i ? " " : "", d->d_off, d->d_fileno,
+ d->d_reclen);
+ tprintf("d_namlen=%u, d_name=\"%.*s\"}",
+ d->d_namlen, d->d_namlen, d->d_name);
+ }
+#endif /* SUNOS4 */
+ i += d->d_reclen;
+ dents++;
+ }
+ if (!abbrev(tcp))
+ tprintf("}");
+ else
+ tprintf("/* %u entries */", dents);
+ tprintf(", %lu", tcp->u_arg[2]);
+ free(buf);
+ return 0;
+}
+
+#ifdef LINUX
+
+int
+sys_getcwd(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else
+ printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[1]);
+ }
+ return 0;
+}
+#endif /* LINUX */
+
+#ifdef HAVE_SYS_ASYNCH_H
+
+int
+sys_aioread(tcp)
+struct tcb *tcp;
+{
+ struct aio_result_t res;
+
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
+ printxval(whence, tcp->u_arg[4], "L_???");
+ if (syserror(tcp) || tcp->u_arg[5] == 0
+ || umove(tcp, tcp->u_arg[5], &res) < 0)
+ tprintf(", %#lx", tcp->u_arg[5]);
+ else
+ tprintf(", {aio_return %d aio_errno %d}",
+ res.aio_return, res.aio_errno);
+ }
+ return 0;
+}
+
+int
+sys_aiowrite(tcp)
+struct tcb *tcp;
+{
+ struct aio_result_t res;
+
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
+ printxval(whence, tcp->u_arg[4], "L_???");
+ }
+ else {
+ if (tcp->u_arg[5] == 0)
+ tprintf(", NULL");
+ else if (syserror(tcp)
+ || umove(tcp, tcp->u_arg[5], &res) < 0)
+ tprintf(", %#lx", tcp->u_arg[5]);
+ else
+ tprintf(", {aio_return %d aio_errno %d}",
+ res.aio_return, res.aio_errno);
+ }
+ return 0;
+}
+
+int
+sys_aiowait(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ printtv(tcp, tcp->u_arg[0]);
+ return 0;
+}
+
+int
+sys_aiocancel(tcp)
+struct tcb *tcp;
+{
+ struct aio_result_t res;
+
+ if (exiting(tcp)) {
+ if (tcp->u_arg[0] == 0)
+ tprintf("NULL");
+ else if (syserror(tcp)
+ || umove(tcp, tcp->u_arg[0], &res) < 0)
+ tprintf("%#lx", tcp->u_arg[0]);
+ else
+ tprintf("{aio_return %d aio_errno %d}",
+ res.aio_return, res.aio_errno);
+ }
+ return 0;
+}
+
+#endif /* HAVE_SYS_ASYNCH_H */
diff --git a/install-sh b/install-sh
new file mode 100755
index 000000000..58719246f
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,238 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/io.c b/io.c
new file mode 100644
index 000000000..4e00fe4e0
--- /dev/null
+++ b/io.c
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+#include <sys/uio.h>
+
+int
+sys_read(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_write(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_readv(tcp)
+struct tcb *tcp;
+{
+ struct iovec *iov;
+ int i, len;
+
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %lu",
+ tcp->u_arg[1], tcp->u_arg[2]);
+ return 0;
+ }
+ len = tcp->u_arg[2];
+ if ((iov = (struct iovec *) malloc(len * sizeof *iov)) == NULL) {
+ fprintf(stderr, "No memory");
+ return 0;
+ }
+ if (umoven(tcp, tcp->u_arg[1],
+ len * sizeof *iov, (char *) iov) < 0) {
+ tprintf("%#lx", tcp->u_arg[1]);
+ } else {
+ tprintf("[");
+ for (i = 0; i < len; i++) {
+ if (i)
+ tprintf(", ");
+ tprintf("{");
+ printstr(tcp, (long) iov[i].iov_base,
+ iov[i].iov_len);
+ tprintf(", %u}", iov[i].iov_len);
+ }
+ tprintf("]");
+ }
+ free((char *) iov);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_writev(tcp)
+struct tcb *tcp;
+{
+ struct iovec *iov;
+ int i, len;
+
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ len = tcp->u_arg[2];
+ iov = (struct iovec *) malloc(len * sizeof *iov);
+ if (iov == NULL) {
+ fprintf(stderr, "No memory");
+ return 0;
+ }
+ if (umoven(tcp, tcp->u_arg[1],
+ len * sizeof *iov, (char *) iov) < 0) {
+ tprintf("%#lx", tcp->u_arg[1]);
+ } else {
+ tprintf("[");
+ for (i = 0; i < len; i++) {
+ if (i)
+ tprintf(", ");
+ tprintf("{");
+ printstr(tcp, (long) iov[i].iov_base,
+ iov[i].iov_len);
+ tprintf(", %u}", iov[i].iov_len);
+ }
+ tprintf("]");
+ }
+ free((char *) iov);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+#ifdef SVR4
+
+int
+sys_pread(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %lu, %llu", tcp->u_arg[2],
+ (((unsigned long long) tcp->u_arg[4]) << 32
+ | tcp->u_arg[3]));
+ }
+ return 0;
+}
+
+int
+sys_pwrite(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu, %llu", tcp->u_arg[2],
+ (((unsigned long long) tcp->u_arg[4]) << 32
+ | tcp->u_arg[3]));
+ }
+ return 0;
+}
+#endif /* SVR4 */
+
+#ifdef LINUX
+int
+sys_pread(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %lu, %lu", tcp->u_arg[2], tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+int
+sys_pwrite(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu, %lu", tcp->u_arg[2], tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+#endif /* LINUX */
+
+int
+sys_ioctl(tcp)
+struct tcb *tcp;
+{
+ char *symbol;
+
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ symbol = ioctl_lookup(tcp->u_arg[1]);
+ if (symbol)
+ tprintf("%s", symbol);
+ else
+ tprintf("%#lx", tcp->u_arg[1]);
+ ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ else {
+ if (ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]) == 0)
+ tprintf(", %#lx", tcp->u_arg[2]);
+ }
+ return 0;
+}
diff --git a/ioctl.c b/ioctl.c
new file mode 100644
index 000000000..65d3f5271
--- /dev/null
+++ b/ioctl.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+struct ioctlent ioctlent0[] = {
+/*
+ * `ioctlent.h' may be generated from `ioctlent.raw' by the auxiliary
+ * program `ioctlsort', such that the list is sorted by the `code' field.
+ * This has the side-effect of resolving the _IO.. macros into
+ * plain integers, eliminating the need to include here everything
+ * in "/usr/include" .
+ */
+#include "ioctlent.h"
+};
+
+int nioctlents0 = sizeof ioctlent0 / sizeof ioctlent0[0];
+
+#if SUPPORTED_PERSONALITIES >= 2
+struct ioctlent ioctlent1[] = {
+#include "ioctlent1.h"
+};
+
+int nioctlents1 = sizeof ioctlent1 / sizeof ioctlent1[0];
+#endif /* SUPPORTED_PERSONALITIES >= 2 */
+
+#if SUPPORTED_PERSONALITIES >= 3
+struct ioctlent ioctlent2[] = {
+#include "ioctlent2.h"
+};
+
+int nioctlents1 = sizeof ioctlent2 / sizeof ioctlent2[0];
+#endif /* SUPPORTED_PERSONALITIES >= 3 */
+
+struct ioctlent *ioctlent;
+int nioctlents;
+
+static int
+compare(a, b)
+const void *a;
+const void *b;
+{
+ unsigned long code1 = ((struct ioctlent *) a)->code;
+ unsigned long code2 = ((struct ioctlent *) b)->code;
+ return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0;
+}
+
+char *
+ioctl_lookup(code)
+long code;
+{
+ struct ioctlent *iop, ioent;
+
+ ioent.code = code;
+ iop = (struct ioctlent *) bsearch((char *) &ioent, (char *) ioctlent,
+ nioctlents, sizeof(struct ioctlent), compare);
+ return iop ? iop->symbol : NULL;
+}
+
+int
+ioctl_decode(tcp, code, arg)
+struct tcb *tcp;
+long code, arg;
+{
+ switch ((code >> 8) & 0xff) {
+#ifdef LINUX
+#ifdef ALPHA
+ case 'f': case 't': case 'T':
+#else /* !ALPHA */
+ case 0x54:
+#endif /* !ALPHA */
+#else /* !LINUX */
+ case 'f': case 't': case 'T':
+#endif /* !LINUX */
+ return term_ioctl(tcp, code, arg);
+#ifdef LINUX
+ case 0x89:
+#else /* !LINUX */
+ case 'r': case 's': case 'i': case 'p':
+#endif /* !LINUX */
+ return sock_ioctl(tcp, code, arg);
+#ifdef SVR4
+ case 'q':
+ return proc_ioctl(tcp, code, arg);
+#endif /* SVR4 */
+#ifdef HAVE_SYS_STREAM_H
+ case 'S':
+ return stream_ioctl(tcp, code, arg);
+#endif /* HAVE_SYS_STREAM_H */
+ default:
+ break;
+ }
+ return 0;
+}
+
+/*
+ * Registry of ioctl characters, culled from
+ * @(#)ioccom.h 1.7 89/06/16 SMI; from UCB ioctl.h 7.1 6/4/86
+ *
+ * char file where defined notes
+ * ---- ------------------ -----
+ * F sun/fbio.h
+ * G sun/gpio.h
+ * H vaxif/if_hy.h
+ * M sundev/mcpcmd.h *overlap*
+ * M sys/modem.h *overlap*
+ * S sys/stropts.h
+ * T sys/termio.h -no overlap-
+ * T sys/termios.h -no overlap-
+ * V sundev/mdreg.h
+ * a vaxuba/adreg.h
+ * d sun/dkio.h -no overlap with sys/des.h-
+ * d sys/des.h (possible overlap)
+ * d vax/dkio.h (possible overlap)
+ * d vaxuba/rxreg.h (possible overlap)
+ * f sys/filio.h
+ * g sunwindow/win_ioctl.h -no overlap-
+ * g sunwindowdev/winioctl.c !no manifest constant! -no overlap-
+ * h sundev/hrc_common.h
+ * i sys/sockio.h *overlap*
+ * i vaxuba/ikreg.h *overlap*
+ * k sundev/kbio.h
+ * m sundev/msio.h (possible overlap)
+ * m sundev/msreg.h (possible overlap)
+ * m sys/mtio.h (possible overlap)
+ * n sun/ndio.h
+ * p net/nit_buf.h (possible overlap)
+ * p net/nit_if.h (possible overlap)
+ * p net/nit_pf.h (possible overlap)
+ * p sundev/fpareg.h (possible overlap)
+ * p sys/sockio.h (possible overlap)
+ * p vaxuba/psreg.h (possible overlap)
+ * q sun/sqz.h
+ * r sys/sockio.h
+ * s sys/sockio.h
+ * t sys/ttold.h (possible overlap)
+ * t sys/ttycom.h (possible overlap)
+ * v sundev/vuid_event.h *overlap*
+ * v sys/vcmd.h *overlap*
+ *
+ * End of Registry
+ */
+
diff --git a/ioctlsort.c b/ioctlsort.c
new file mode 100644
index 000000000..51aef406b
--- /dev/null
+++ b/ioctlsort.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+struct ioctlent {
+ char *doth;
+ char *symbol;
+ unsigned long code;
+};
+
+#include "ioctlent.raw"
+
+int nioctlents = sizeof ioctlent / sizeof ioctlent[0];
+
+int
+compare(a, b)
+const void *a;
+const void *b;
+{
+ unsigned long code1 = ((struct ioctlent *) a)->code;
+ unsigned long code2 = ((struct ioctlent *) b)->code;
+ return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0;
+}
+
+int
+main(argc, argv)
+int argc;
+char *argv[];
+{
+ int i;
+
+ qsort(ioctlent, nioctlents, sizeof ioctlent[0], compare);
+ for (i = 0; i < nioctlents; i++) {
+ printf("{\"%s\", \"%s\", %#lx},\n",
+ ioctlent[i].doth, ioctlent[i].symbol, ioctlent[i].code);
+ }
+ return 0;
+}
diff --git a/ipc.c b/ipc.c
new file mode 100644
index 000000000..f01a9a911
--- /dev/null
+++ b/ipc.c
@@ -0,0 +1,354 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#if defined(LINUX) || defined(SUNOS4)
+
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#include <sys/msg.h>
+#include <sys/shm.h>
+
+#ifndef MSG_STAT
+#define MSG_STAT 11
+#endif
+#ifndef MSG_INFO
+#define MSG_INFO 12
+#endif
+#ifndef SHM_STAT
+#define SHM_STAT 13
+#endif
+#ifndef SHM_INFO
+#define SHM_INFO 14
+#endif
+#ifndef SEM_STAT
+#define SEM_STAT 18
+#endif
+#ifndef SEM_INFO
+#define SEM_INFO 19
+#endif
+
+static struct xlat msgctl_flags[] = {
+ { IPC_RMID, "IPC_RMID" },
+ { IPC_SET, "IPC_SET" },
+ { IPC_STAT, "IPC_STAT" },
+#ifdef LINUX
+ { IPC_INFO, "IPC_INFO" },
+ { MSG_STAT, "MSG_STAT" },
+ { MSG_INFO, "MSG_INFO" },
+#endif /* LINUX */
+ { 0, NULL },
+};
+
+static struct xlat semctl_flags[] = {
+ { IPC_RMID, "IPC_RMID" },
+ { IPC_SET, "IPC_SET" },
+ { IPC_STAT, "IPC_STAT" },
+#ifdef LINUX
+ { IPC_INFO, "IPC_INFO" },
+ { SEM_STAT, "SEM_STAT" },
+ { SEM_INFO, "SEM_INFO" },
+#endif /* LINUX */
+ { GETPID, "GETPID" },
+ { GETVAL, "GETVAL" },
+ { GETALL, "GETALL" },
+ { GETNCNT, "GETNCNT" },
+ { GETZCNT, "GETZCNT" },
+ { SETVAL, "SETVAL" },
+ { SETALL, "SETALL" },
+ { 0, NULL },
+};
+
+static struct xlat shmctl_flags[] = {
+ { IPC_RMID, "IPC_RMID" },
+ { IPC_SET, "IPC_SET" },
+ { IPC_STAT, "IPC_STAT" },
+#ifdef LINUX
+ { IPC_INFO, "IPC_INFO" },
+ { SHM_STAT, "SHM_STAT" },
+ { SHM_INFO, "SHM_INFO" },
+#endif /* LINUX */
+ { SHM_LOCK, "SHM_LOCK" },
+ { SHM_UNLOCK, "SHM_UNLOCK" },
+ { 0, NULL },
+};
+
+static struct xlat resource_flags[] = {
+ { IPC_CREAT, "IPC_CREAT" },
+ { IPC_EXCL, "IPC_EXCL" },
+ { IPC_NOWAIT, "IPC_NOWAIT" },
+ { 0, NULL },
+};
+
+static struct xlat shm_flags[] = {
+#ifdef LINUX
+ { SHM_REMAP, "SHM_REMAP" },
+#endif /* LINUX */
+ { SHM_RDONLY, "SHM_RDONLY" },
+ { SHM_RND, "SHM_RND" },
+ { 0, NULL },
+};
+
+static struct xlat msg_flags[] = {
+ { MSG_NOERROR, "MSG_NOERROR" },
+#ifdef LINUX
+ { MSG_EXCEPT, "MSG_EXCEPT" },
+#endif /* LINUX */
+ { IPC_NOWAIT, "IPC_NOWAIT" },
+ { 0, NULL },
+};
+
+int sys_msgget(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ if (tcp->u_arg[0])
+ tprintf("%lu", tcp->u_arg[0]);
+ else
+ tprintf("IPC_PRIVATE");
+ tprintf(", ");
+ if (printflags(resource_flags, tcp->u_arg[1]) != 0)
+ tprintf("|");
+ tprintf("%#lo", tcp->u_arg[1] & 0666);
+ }
+ return 0;
+}
+
+int sys_msgctl(tcp)
+struct tcb *tcp;
+{
+ char *cmd = xlookup(msgctl_flags, tcp->u_arg[1]);
+
+ if (entering(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+ tprintf(", %s", cmd == NULL ? "MSG_???" : cmd);
+#ifdef LINUX
+ tprintf(", %#lx", tcp->u_arg[3]);
+#else /* !LINUX */
+ tprintf(", %#lx", tcp->u_arg[2]);
+#endif /* !LINUX */
+ }
+ return 0;
+}
+
+int sys_msgsnd(tcp)
+struct tcb *tcp;
+{
+ long mtype;
+
+ if (entering(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+#ifdef LINUX
+ umove(tcp, tcp->u_arg[3], &mtype);
+ tprintf(", {%lu, ", mtype);
+ printstr(tcp, tcp->u_arg[3] + sizeof(long),
+ tcp->u_arg[1]);
+ tprintf("}, %lu", tcp->u_arg[1]);
+ tprintf(", ");
+ if (printflags(msg_flags, tcp->u_arg[2]) == 0)
+ tprintf("0");
+#else /* !LINUX */
+ umove(tcp, tcp->u_arg[1], &mtype);
+ tprintf(", {%lu, ", mtype);
+ printstr(tcp, tcp->u_arg[1] + sizeof(long),
+ tcp->u_arg[2]);
+ tprintf("}, %lu", tcp->u_arg[2]);
+ tprintf(", ");
+ if (printflags(msg_flags, tcp->u_arg[3]) == 0)
+ tprintf("0");
+#endif /* !LINUX */
+ }
+ return 0;
+}
+
+int sys_msgrcv(tcp)
+struct tcb *tcp;
+{
+ long mtype;
+#ifdef LINUX
+ struct ipc_wrapper {
+ struct msgbuf *msgp;
+ long msgtyp;
+ } tmp;
+#endif
+
+
+ if (exiting(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+#ifdef LINUX
+ umove(tcp, tcp->u_arg[3], &tmp);
+ umove(tcp, (long) tmp.msgp, &mtype);
+ tprintf(", {%lu, ", mtype);
+ printstr(tcp, (long) (tmp.msgp) + sizeof(long),
+ tcp->u_arg[1]);
+ tprintf("}, %lu", tcp->u_arg[1]);
+ tprintf(", %ld", tmp.msgtyp);
+ tprintf(", ");
+ if (printflags(msg_flags, tcp->u_arg[2]) == 0)
+ tprintf("0");
+#else /* !LINUX */
+ umove(tcp, tcp->u_arg[1], &mtype);
+ tprintf(", {%lu, ", mtype);
+ printstr(tcp, tcp->u_arg[1] + sizeof(long),
+ tcp->u_arg[2]);
+ tprintf("}, %lu", tcp->u_arg[2]);
+ tprintf(", %ld", tcp->u_arg[3]);
+ tprintf(", ");
+ if (printflags(msg_flags, tcp->u_arg[4]) == 0)
+ tprintf("0");
+#endif /* !LINUX */
+ }
+ return 0;
+}
+
+int sys_semop(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+#ifdef LINUX
+ tprintf(", %#lx", tcp->u_arg[3]);
+ tprintf(", %lu", tcp->u_arg[1]);
+#else /* !LINUX */
+ tprintf(", %#lx", tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[2]);
+#endif /* !LINUX */
+ }
+ return 0;
+}
+
+int sys_semget(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ if (tcp->u_arg[0])
+ tprintf("%lu", tcp->u_arg[0]);
+ else
+ tprintf("IPC_PRIVATE");
+ tprintf(", %lu", tcp->u_arg[1]);
+ tprintf(", ");
+ if (printflags(resource_flags, tcp->u_arg[2]) != 0)
+ tprintf("|");
+ tprintf("%#lo", tcp->u_arg[2] & 0666);
+ }
+ return 0;
+}
+
+int sys_semctl(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+ tprintf(", %lu, ", tcp->u_arg[1]);
+ printxval(semctl_flags, tcp->u_arg[2], "SEM_???");
+ tprintf(", %#lx", tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+int sys_shmget(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ if (tcp->u_arg[0])
+ tprintf("%lu", tcp->u_arg[0]);
+ else
+ tprintf("IPC_PRIVATE");
+ tprintf(", %lu", tcp->u_arg[1]);
+ tprintf(", ");
+ if (printflags(resource_flags, tcp->u_arg[2]) != 0)
+ tprintf("|");
+ tprintf("%#lo", tcp->u_arg[2] & 0666);
+ }
+ return 0;
+}
+
+int sys_shmctl(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ printxval(shmctl_flags, tcp->u_arg[1], "SHM_???");
+#ifdef LINUX
+ tprintf(", %#lx", tcp->u_arg[3]);
+#else /* !LINUX */
+ tprintf(", %#lx", tcp->u_arg[2]);
+#endif /* !LINUX */
+ }
+ return 0;
+}
+
+int sys_shmat(tcp)
+struct tcb *tcp;
+{
+#ifdef LINUX
+ unsigned long raddr;
+#endif /* LINUX */
+
+ if (exiting(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+#ifdef LINUX
+ tprintf(", %#lx", tcp->u_arg[3]);
+ tprintf(", ");
+ if (printflags(shm_flags, tcp->u_arg[1]) == 0)
+ tprintf("0");
+#else /* !LINUX */
+ tprintf(", %#lx", tcp->u_arg[1]);
+ tprintf(", ");
+ if (printflags(shm_flags, tcp->u_arg[2]) == 0)
+ tprintf("0");
+#endif /* !LINUX */
+ if (syserror(tcp))
+ return 0;
+#ifdef LINUX
+ if (umove(tcp, tcp->u_arg[2], &raddr) < 0)
+ return RVAL_NONE;
+ tcp->u_rval = raddr;
+#endif /* LINUX */
+ return RVAL_HEX;
+ }
+ return 0;
+}
+
+int sys_shmdt(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+#ifdef LINUX
+ tprintf("%#lx", tcp->u_arg[3]);
+#else /* !LINUX */
+ tprintf("%#lx", tcp->u_arg[0]);
+#endif /* !LINUX */
+ return 0;
+}
+
+#endif /* defined(LINUX) || defined(SUNOS4) */
diff --git a/linux/Makefile.in b/linux/Makefile.in
new file mode 100644
index 000000000..8cc135db6
--- /dev/null
+++ b/linux/Makefile.in
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+CC = @CC@
+CPP = @CPP@
+SHELL = /bin/sh
+
+DEFS = @DEFS@
+LDLIBS = @LIBS@
+
+CFLAGS = -g
+LDFLAGS = -g
+WARNFLAGS = @WARNFLAGS@
+
+CPPFLAGS =
+INCLUDES = -I. -I.. -I$(srcdir)
+
+includedir = @includedir@
+
+all: ioctlent.h errnoent.h signalent.h syscallent.h
+
+ioctlent.raw: ioctlent.sh
+ $(SHELL) $(srcdir)/ioctlent.sh $(includedir) >$@
+
+ioctlent.h: ioctlent.raw ioctlsort
+ ./ioctlsort >$@
+
+ioctlsort: ioctlsort.o
+ $(CC) $(LDFLAGS) ioctlsort.o -o ioctlsort
+
+ioctlsort.o: ../ioctlsort.c
+ $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $(srcdir)/../ioctlsort.c
+
+ioctlsort.o: ioctlent.raw
+
+errnoent.h: ../errnoent.sh $(includedir)/linux/errno.h
+ $(SHELL) $(srcdir)/../errnoent.sh $(includedir)/*/errno.h >$@
+
+signalent.h: ../signalent.sh $(includedir)/linux/signal.h
+ $(SHELL) $(srcdir)/../signalent.sh $(includedir)/*/signal.h >$@
+
+#syscallent.h: ../syscallent.sh $(includedir)/sys/syscall.h
+syscallent.h:
+ $(SHELL) $(srcdir)/../syscallent.sh $(includedir)/sys/syscall.h >$@
+
+clean:
+ rm -f ioctlent.c *.raw *.tmp *.o ioctlsort
+
+distclean: clean
+ rm -f Makefile
+
+maintainer-clean: distclean
+ rm -f ioctlent.h errnoent.h signalent.h
diff --git a/linux/alpha/Makefile.in b/linux/alpha/Makefile.in
new file mode 100644
index 000000000..4c5344df8
--- /dev/null
+++ b/linux/alpha/Makefile.in
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+CC = @CC@
+CPP = @CPP@
+SHELL = /bin/sh
+
+DEFS = @DEFS@
+LDLIBS = @LIBS@
+
+CFLAGS = -g
+LDFLAGS = -g
+WARNFLAGS = @WARNFLAGS@
+
+CPPFLAGS =
+INCLUDES = -I. -I.. -I$(srcdir)/.. -I../.. -I$(srcdir)
+
+includedir = @includedir@
+
+all: ioctlent.h errnoent.h signalent.h syscallent.h
+
+ioctlent.raw: ioctlent.sh
+ $(SHELL) $(srcdir)/ioctlent.sh $(includedir) >$@
+
+ioctlent.h: ioctlent.raw ioctlsort
+ ./ioctlsort >$@
+
+ioctlsort: ioctlsort.o
+ $(CC) $(LDFLAGS) ioctlsort.o -o ioctlsort
+
+ioctlsort.o: ../../ioctlsort.c
+ $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $(srcdir)/../../ioctlsort.c
+
+ioctlsort.o: ioctlent.raw
+
+errnoent.h: ../../errnoent.sh $(includedir)/asm/errno.h
+ $(SHELL) $(srcdir)/../../errnoent.sh $(includedir)/asm/errno.h >$@
+
+signalent.h: ../../signalent.sh $(includedir)/asm/signal.h
+ $(SHELL) $(srcdir)/../../signalent.sh $(includedir)/asm/signal.h >$@
+
+#syscallent.h: ../../syscallent.sh $(includedir)/sys/syscall.h
+syscallent.h:
+ $(SHELL) $(srcdir)/../../syscallent.sh $(includedir)/sys/syscall.h >$@
+
+clean:
+ rm -f ioctlent.c *.raw *.tmp *.o ioctlsort
+
+distclean: clean
+ rm -f Makefile
+
+maintainer-clean: distclean
+ rm -f ioctlent.h errnoent.h signalent.h
diff --git a/linux/alpha/errnoent.h b/linux/alpha/errnoent.h
new file mode 100644
index 000000000..4ffaff9cc
--- /dev/null
+++ b/linux/alpha/errnoent.h
@@ -0,0 +1,516 @@
+ "ERRNO_0", /* 0 */
+ "EPERM", /* 1 */
+ "ENOENT", /* 2 */
+ "ESRCH", /* 3 */
+ "EINTR", /* 4 */
+ "EIO", /* 5 */
+ "ENXIO", /* 6 */
+ "E2BIG", /* 7 */
+ "ENOEXEC", /* 8 */
+ "EBADF", /* 9 */
+ "ECHILD", /* 10 */
+ "EDEADLK", /* 11 */
+ "ENOMEM", /* 12 */
+ "EACCES", /* 13 */
+ "EFAULT", /* 14 */
+ "ENOTBLK", /* 15 */
+ "EBUSY", /* 16 */
+ "EEXIST", /* 17 */
+ "EXDEV", /* 18 */
+ "ENODEV", /* 19 */
+ "ENOTDIR", /* 20 */
+ "EISDIR", /* 21 */
+ "EINVAL", /* 22 */
+ "ENFILE", /* 23 */
+ "EMFILE", /* 24 */
+ "ENOTTY", /* 25 */
+ "ETXTBSY", /* 26 */
+ "EFBIG", /* 27 */
+ "ENOSPC", /* 28 */
+ "ESPIPE", /* 29 */
+ "EROFS", /* 30 */
+ "EMLINK", /* 31 */
+ "EPIPE", /* 32 */
+ "EDOM", /* 33 */
+ "ERANGE", /* 34 */
+ "EAGAIN", /* 35 */
+ "EINPROGRESS", /* 36 */
+ "EALREADY", /* 37 */
+ "ENOTSOCK", /* 38 */
+ "EDESTADDRREQ", /* 39 */
+ "EMSGSIZE", /* 40 */
+ "EPROTOTYPE", /* 41 */
+ "ENOPROTOOPT", /* 42 */
+ "EPROTONOSUPPORT", /* 43 */
+ "ESOCKTNOSUPPORT", /* 44 */
+ "EOPNOTSUPP", /* 45 */
+ "EPFNOSUPPORT", /* 46 */
+ "EAFNOSUPPORT", /* 47 */
+ "EADDRINUSE", /* 48 */
+ "EADDRNOTAVAIL", /* 49 */
+ "ENETDOWN", /* 50 */
+ "ENETUNREACH", /* 51 */
+ "ENETRESET", /* 52 */
+ "ECONNABORTED", /* 53 */
+ "ECONNRESET", /* 54 */
+ "ENOBUFS", /* 55 */
+ "EISCONN", /* 56 */
+ "ENOTCONN", /* 57 */
+ "ESHUTDOWN", /* 58 */
+ "ETOOMANYREFS", /* 59 */
+ "ETIMEDOUT", /* 60 */
+ "ECONNREFUSED", /* 61 */
+ "ELOOP", /* 62 */
+ "ENAMETOOLONG", /* 63 */
+ "EHOSTDOWN", /* 64 */
+ "EHOSTUNREACH", /* 65 */
+ "ENOTEMPTY", /* 66 */
+ "ERRNO_67", /* 67 */
+ "EUSERS", /* 68 */
+ "EDQUOT", /* 69 */
+ "ESTALE", /* 70 */
+ "EREMOTE", /* 71 */
+ "ERRNO_72", /* 72 */
+ "ERRNO_73", /* 73 */
+ "ERRNO_74", /* 74 */
+ "ERRNO_75", /* 75 */
+ "ERRNO_76", /* 76 */
+ "ENOLCK", /* 77 */
+ "ENOSYS", /* 78 */
+ "ERRNO_79", /* 79 */
+ "ENOMSG", /* 80 */
+ "EIDRM", /* 81 */
+ "ENOSR", /* 82 */
+ "ETIME", /* 83 */
+ "EBADMSG", /* 84 */
+ "EPROTO", /* 85 */
+ "ENODATA", /* 86 */
+ "ENOSTR", /* 87 */
+ "ECHRNG", /* 88 */
+ "EL2NSYNC", /* 89 */
+ "EL3HLT", /* 90 */
+ "EL3RST", /* 91 */
+ "ENOPKG", /* 92 */
+ "ELNRNG", /* 93 */
+ "EUNATCH", /* 94 */
+ "ENOCSI", /* 95 */
+ "EL2HLT", /* 96 */
+ "EBADE", /* 97 */
+ "EBADR", /* 98 */
+ "EXFULL", /* 99 */
+ "ENOANO", /* 100 */
+ "EBADRQC", /* 101 */
+ "EBADSLT", /* 102 */
+ "EDEADLOCK", /* 103 */
+ "EBFONT", /* 104 */
+ "ENONET", /* 105 */
+ "ENOLINK", /* 106 */
+ "EADV", /* 107 */
+ "ESRMNT", /* 108 */
+ "ECOMM", /* 109 */
+ "EMULTIHOP", /* 110 */
+ "EDOTDOT", /* 111 */
+ "EOVERFLOW", /* 112 */
+ "ENOTUNIQ", /* 113 */
+ "EBADFD", /* 114 */
+ "EREMCHG", /* 115 */
+ "EILSEQ", /* 116 */
+ "EUCLEAN", /* 117 */
+ "ENOTNAM", /* 118 */
+ "ENAVAIL", /* 119 */
+ "EISNAM", /* 120 */
+ "EREMOTEIO", /* 121 */
+ "ELIBACC", /* 122 */
+ "ELIBBAD", /* 123 */
+ "ELIBSCN", /* 124 */
+ "ELIBMAX", /* 125 */
+ "ELIBEXEC", /* 126 */
+ "ERESTART", /* 127 */
+ "ESTRPIPE", /* 128 */
+ "ERRNO_129", /* 129 */
+ "ERRNO_130", /* 130 */
+ "ERRNO_131", /* 131 */
+ "ERRNO_132", /* 132 */
+ "ERRNO_133", /* 133 */
+ "ERRNO_134", /* 134 */
+ "ERRNO_135", /* 135 */
+ "ERRNO_136", /* 136 */
+ "ERRNO_137", /* 137 */
+ "ERRNO_138", /* 138 */
+ "ERRNO_139", /* 139 */
+ "ERRNO_140", /* 140 */
+ "ERRNO_141", /* 141 */
+ "ERRNO_142", /* 142 */
+ "ERRNO_143", /* 143 */
+ "ERRNO_144", /* 144 */
+ "ERRNO_145", /* 145 */
+ "ERRNO_146", /* 146 */
+ "ERRNO_147", /* 147 */
+ "ERRNO_148", /* 148 */
+ "ERRNO_149", /* 149 */
+ "ERRNO_150", /* 150 */
+ "ERRNO_151", /* 151 */
+ "ERRNO_152", /* 152 */
+ "ERRNO_153", /* 153 */
+ "ERRNO_154", /* 154 */
+ "ERRNO_155", /* 155 */
+ "ERRNO_156", /* 156 */
+ "ERRNO_157", /* 157 */
+ "ERRNO_158", /* 158 */
+ "ERRNO_159", /* 159 */
+ "ERRNO_160", /* 160 */
+ "ERRNO_161", /* 161 */
+ "ERRNO_162", /* 162 */
+ "ERRNO_163", /* 163 */
+ "ERRNO_164", /* 164 */
+ "ERRNO_165", /* 165 */
+ "ERRNO_166", /* 166 */
+ "ERRNO_167", /* 167 */
+ "ERRNO_168", /* 168 */
+ "ERRNO_169", /* 169 */
+ "ERRNO_170", /* 170 */
+ "ERRNO_171", /* 171 */
+ "ERRNO_172", /* 172 */
+ "ERRNO_173", /* 173 */
+ "ERRNO_174", /* 174 */
+ "ERRNO_175", /* 175 */
+ "ERRNO_176", /* 176 */
+ "ERRNO_177", /* 177 */
+ "ERRNO_178", /* 178 */
+ "ERRNO_179", /* 179 */
+ "ERRNO_180", /* 180 */
+ "ERRNO_181", /* 181 */
+ "ERRNO_182", /* 182 */
+ "ERRNO_183", /* 183 */
+ "ERRNO_184", /* 184 */
+ "ERRNO_185", /* 185 */
+ "ERRNO_186", /* 186 */
+ "ERRNO_187", /* 187 */
+ "ERRNO_188", /* 188 */
+ "ERRNO_189", /* 189 */
+ "ERRNO_190", /* 190 */
+ "ERRNO_191", /* 191 */
+ "ERRNO_192", /* 192 */
+ "ERRNO_193", /* 193 */
+ "ERRNO_194", /* 194 */
+ "ERRNO_195", /* 195 */
+ "ERRNO_196", /* 196 */
+ "ERRNO_197", /* 197 */
+ "ERRNO_198", /* 198 */
+ "ERRNO_199", /* 199 */
+ "ERRNO_200", /* 200 */
+ "ERRNO_201", /* 201 */
+ "ERRNO_202", /* 202 */
+ "ERRNO_203", /* 203 */
+ "ERRNO_204", /* 204 */
+ "ERRNO_205", /* 205 */
+ "ERRNO_206", /* 206 */
+ "ERRNO_207", /* 207 */
+ "ERRNO_208", /* 208 */
+ "ERRNO_209", /* 209 */
+ "ERRNO_210", /* 210 */
+ "ERRNO_211", /* 211 */
+ "ERRNO_212", /* 212 */
+ "ERRNO_213", /* 213 */
+ "ERRNO_214", /* 214 */
+ "ERRNO_215", /* 215 */
+ "ERRNO_216", /* 216 */
+ "ERRNO_217", /* 217 */
+ "ERRNO_218", /* 218 */
+ "ERRNO_219", /* 219 */
+ "ERRNO_220", /* 220 */
+ "ERRNO_221", /* 221 */
+ "ERRNO_222", /* 222 */
+ "ERRNO_223", /* 223 */
+ "ERRNO_224", /* 224 */
+ "ERRNO_225", /* 225 */
+ "ERRNO_226", /* 226 */
+ "ERRNO_227", /* 227 */
+ "ERRNO_228", /* 228 */
+ "ERRNO_229", /* 229 */
+ "ERRNO_230", /* 230 */
+ "ERRNO_231", /* 231 */
+ "ERRNO_232", /* 232 */
+ "ERRNO_233", /* 233 */
+ "ERRNO_234", /* 234 */
+ "ERRNO_235", /* 235 */
+ "ERRNO_236", /* 236 */
+ "ERRNO_237", /* 237 */
+ "ERRNO_238", /* 238 */
+ "ERRNO_239", /* 239 */
+ "ERRNO_240", /* 240 */
+ "ERRNO_241", /* 241 */
+ "ERRNO_242", /* 242 */
+ "ERRNO_243", /* 243 */
+ "ERRNO_244", /* 244 */
+ "ERRNO_245", /* 245 */
+ "ERRNO_246", /* 246 */
+ "ERRNO_247", /* 247 */
+ "ERRNO_248", /* 248 */
+ "ERRNO_249", /* 249 */
+ "ERRNO_250", /* 250 */
+ "ERRNO_251", /* 251 */
+ "ERRNO_252", /* 252 */
+ "ERRNO_253", /* 253 */
+ "ERRNO_254", /* 254 */
+ "ERRNO_255", /* 255 */
+ "ERRNO_256", /* 256 */
+ "ERRNO_257", /* 257 */
+ "ERRNO_258", /* 258 */
+ "ERRNO_259", /* 259 */
+ "ERRNO_260", /* 260 */
+ "ERRNO_261", /* 261 */
+ "ERRNO_262", /* 262 */
+ "ERRNO_263", /* 263 */
+ "ERRNO_264", /* 264 */
+ "ERRNO_265", /* 265 */
+ "ERRNO_266", /* 266 */
+ "ERRNO_267", /* 267 */
+ "ERRNO_268", /* 268 */
+ "ERRNO_269", /* 269 */
+ "ERRNO_270", /* 270 */
+ "ERRNO_271", /* 271 */
+ "ERRNO_272", /* 272 */
+ "ERRNO_273", /* 273 */
+ "ERRNO_274", /* 274 */
+ "ERRNO_275", /* 275 */
+ "ERRNO_276", /* 276 */
+ "ERRNO_277", /* 277 */
+ "ERRNO_278", /* 278 */
+ "ERRNO_279", /* 279 */
+ "ERRNO_280", /* 280 */
+ "ERRNO_281", /* 281 */
+ "ERRNO_282", /* 282 */
+ "ERRNO_283", /* 283 */
+ "ERRNO_284", /* 284 */
+ "ERRNO_285", /* 285 */
+ "ERRNO_286", /* 286 */
+ "ERRNO_287", /* 287 */
+ "ERRNO_288", /* 288 */
+ "ERRNO_289", /* 289 */
+ "ERRNO_290", /* 290 */
+ "ERRNO_291", /* 291 */
+ "ERRNO_292", /* 292 */
+ "ERRNO_293", /* 293 */
+ "ERRNO_294", /* 294 */
+ "ERRNO_295", /* 295 */
+ "ERRNO_296", /* 296 */
+ "ERRNO_297", /* 297 */
+ "ERRNO_298", /* 298 */
+ "ERRNO_299", /* 299 */
+ "ERRNO_300", /* 300 */
+ "ERRNO_301", /* 301 */
+ "ERRNO_302", /* 302 */
+ "ERRNO_303", /* 303 */
+ "ERRNO_304", /* 304 */
+ "ERRNO_305", /* 305 */
+ "ERRNO_306", /* 306 */
+ "ERRNO_307", /* 307 */
+ "ERRNO_308", /* 308 */
+ "ERRNO_309", /* 309 */
+ "ERRNO_310", /* 310 */
+ "ERRNO_311", /* 311 */
+ "ERRNO_312", /* 312 */
+ "ERRNO_313", /* 313 */
+ "ERRNO_314", /* 314 */
+ "ERRNO_315", /* 315 */
+ "ERRNO_316", /* 316 */
+ "ERRNO_317", /* 317 */
+ "ERRNO_318", /* 318 */
+ "ERRNO_319", /* 319 */
+ "ERRNO_320", /* 320 */
+ "ERRNO_321", /* 321 */
+ "ERRNO_322", /* 322 */
+ "ERRNO_323", /* 323 */
+ "ERRNO_324", /* 324 */
+ "ERRNO_325", /* 325 */
+ "ERRNO_326", /* 326 */
+ "ERRNO_327", /* 327 */
+ "ERRNO_328", /* 328 */
+ "ERRNO_329", /* 329 */
+ "ERRNO_330", /* 330 */
+ "ERRNO_331", /* 331 */
+ "ERRNO_332", /* 332 */
+ "ERRNO_333", /* 333 */
+ "ERRNO_334", /* 334 */
+ "ERRNO_335", /* 335 */
+ "ERRNO_336", /* 336 */
+ "ERRNO_337", /* 337 */
+ "ERRNO_338", /* 338 */
+ "ERRNO_339", /* 339 */
+ "ERRNO_340", /* 340 */
+ "ERRNO_341", /* 341 */
+ "ERRNO_342", /* 342 */
+ "ERRNO_343", /* 343 */
+ "ERRNO_344", /* 344 */
+ "ERRNO_345", /* 345 */
+ "ERRNO_346", /* 346 */
+ "ERRNO_347", /* 347 */
+ "ERRNO_348", /* 348 */
+ "ERRNO_349", /* 349 */
+ "ERRNO_350", /* 350 */
+ "ERRNO_351", /* 351 */
+ "ERRNO_352", /* 352 */
+ "ERRNO_353", /* 353 */
+ "ERRNO_354", /* 354 */
+ "ERRNO_355", /* 355 */
+ "ERRNO_356", /* 356 */
+ "ERRNO_357", /* 357 */
+ "ERRNO_358", /* 358 */
+ "ERRNO_359", /* 359 */
+ "ERRNO_360", /* 360 */
+ "ERRNO_361", /* 361 */
+ "ERRNO_362", /* 362 */
+ "ERRNO_363", /* 363 */
+ "ERRNO_364", /* 364 */
+ "ERRNO_365", /* 365 */
+ "ERRNO_366", /* 366 */
+ "ERRNO_367", /* 367 */
+ "ERRNO_368", /* 368 */
+ "ERRNO_369", /* 369 */
+ "ERRNO_370", /* 370 */
+ "ERRNO_371", /* 371 */
+ "ERRNO_372", /* 372 */
+ "ERRNO_373", /* 373 */
+ "ERRNO_374", /* 374 */
+ "ERRNO_375", /* 375 */
+ "ERRNO_376", /* 376 */
+ "ERRNO_377", /* 377 */
+ "ERRNO_378", /* 378 */
+ "ERRNO_379", /* 379 */
+ "ERRNO_380", /* 380 */
+ "ERRNO_381", /* 381 */
+ "ERRNO_382", /* 382 */
+ "ERRNO_383", /* 383 */
+ "ERRNO_384", /* 384 */
+ "ERRNO_385", /* 385 */
+ "ERRNO_386", /* 386 */
+ "ERRNO_387", /* 387 */
+ "ERRNO_388", /* 388 */
+ "ERRNO_389", /* 389 */
+ "ERRNO_390", /* 390 */
+ "ERRNO_391", /* 391 */
+ "ERRNO_392", /* 392 */
+ "ERRNO_393", /* 393 */
+ "ERRNO_394", /* 394 */
+ "ERRNO_395", /* 395 */
+ "ERRNO_396", /* 396 */
+ "ERRNO_397", /* 397 */
+ "ERRNO_398", /* 398 */
+ "ERRNO_399", /* 399 */
+ "ERRNO_400", /* 400 */
+ "ERRNO_401", /* 401 */
+ "ERRNO_402", /* 402 */
+ "ERRNO_403", /* 403 */
+ "ERRNO_404", /* 404 */
+ "ERRNO_405", /* 405 */
+ "ERRNO_406", /* 406 */
+ "ERRNO_407", /* 407 */
+ "ERRNO_408", /* 408 */
+ "ERRNO_409", /* 409 */
+ "ERRNO_410", /* 410 */
+ "ERRNO_411", /* 411 */
+ "ERRNO_412", /* 412 */
+ "ERRNO_413", /* 413 */
+ "ERRNO_414", /* 414 */
+ "ERRNO_415", /* 415 */
+ "ERRNO_416", /* 416 */
+ "ERRNO_417", /* 417 */
+ "ERRNO_418", /* 418 */
+ "ERRNO_419", /* 419 */
+ "ERRNO_420", /* 420 */
+ "ERRNO_421", /* 421 */
+ "ERRNO_422", /* 422 */
+ "ERRNO_423", /* 423 */
+ "ERRNO_424", /* 424 */
+ "ERRNO_425", /* 425 */
+ "ERRNO_426", /* 426 */
+ "ERRNO_427", /* 427 */
+ "ERRNO_428", /* 428 */
+ "ERRNO_429", /* 429 */
+ "ERRNO_430", /* 430 */
+ "ERRNO_431", /* 431 */
+ "ERRNO_432", /* 432 */
+ "ERRNO_433", /* 433 */
+ "ERRNO_434", /* 434 */
+ "ERRNO_435", /* 435 */
+ "ERRNO_436", /* 436 */
+ "ERRNO_437", /* 437 */
+ "ERRNO_438", /* 438 */
+ "ERRNO_439", /* 439 */
+ "ERRNO_440", /* 440 */
+ "ERRNO_441", /* 441 */
+ "ERRNO_442", /* 442 */
+ "ERRNO_443", /* 443 */
+ "ERRNO_444", /* 444 */
+ "ERRNO_445", /* 445 */
+ "ERRNO_446", /* 446 */
+ "ERRNO_447", /* 447 */
+ "ERRNO_448", /* 448 */
+ "ERRNO_449", /* 449 */
+ "ERRNO_450", /* 450 */
+ "ERRNO_451", /* 451 */
+ "ERRNO_452", /* 452 */
+ "ERRNO_453", /* 453 */
+ "ERRNO_454", /* 454 */
+ "ERRNO_455", /* 455 */
+ "ERRNO_456", /* 456 */
+ "ERRNO_457", /* 457 */
+ "ERRNO_458", /* 458 */
+ "ERRNO_459", /* 459 */
+ "ERRNO_460", /* 460 */
+ "ERRNO_461", /* 461 */
+ "ERRNO_462", /* 462 */
+ "ERRNO_463", /* 463 */
+ "ERRNO_464", /* 464 */
+ "ERRNO_465", /* 465 */
+ "ERRNO_466", /* 466 */
+ "ERRNO_467", /* 467 */
+ "ERRNO_468", /* 468 */
+ "ERRNO_469", /* 469 */
+ "ERRNO_470", /* 470 */
+ "ERRNO_471", /* 471 */
+ "ERRNO_472", /* 472 */
+ "ERRNO_473", /* 473 */
+ "ERRNO_474", /* 474 */
+ "ERRNO_475", /* 475 */
+ "ERRNO_476", /* 476 */
+ "ERRNO_477", /* 477 */
+ "ERRNO_478", /* 478 */
+ "ERRNO_479", /* 479 */
+ "ERRNO_480", /* 480 */
+ "ERRNO_481", /* 481 */
+ "ERRNO_482", /* 482 */
+ "ERRNO_483", /* 483 */
+ "ERRNO_484", /* 484 */
+ "ERRNO_485", /* 485 */
+ "ERRNO_486", /* 486 */
+ "ERRNO_487", /* 487 */
+ "ERRNO_488", /* 488 */
+ "ERRNO_489", /* 489 */
+ "ERRNO_490", /* 490 */
+ "ERRNO_491", /* 491 */
+ "ERRNO_492", /* 492 */
+ "ERRNO_493", /* 493 */
+ "ERRNO_494", /* 494 */
+ "ERRNO_495", /* 495 */
+ "ERRNO_496", /* 496 */
+ "ERRNO_497", /* 497 */
+ "ERRNO_498", /* 498 */
+ "ERRNO_499", /* 499 */
+ "ERRNO_500", /* 500 */
+ "ERRNO_501", /* 501 */
+ "ERRNO_502", /* 502 */
+ "ERRNO_503", /* 503 */
+ "ERRNO_504", /* 504 */
+ "ERRNO_505", /* 505 */
+ "ERRNO_506", /* 506 */
+ "ERRNO_507", /* 507 */
+ "ERRNO_508", /* 508 */
+ "ERRNO_509", /* 509 */
+ "ERRNO_510", /* 510 */
+ "ERRNO_511", /* 511 */
+ "ERESTARTSYS", /* 512 */
+ "ERESTARTNOINTR", /* 513 */
+ "ERESTARTNOHAND", /* 514 */
+ "ENOIOCTLCMD", /* 515 */
diff --git a/linux/alpha/ioctlent.h b/linux/alpha/ioctlent.h
new file mode 100644
index 000000000..db09f3c16
--- /dev/null
+++ b/linux/alpha/ioctlent.h
@@ -0,0 +1,546 @@
+{"linux/ip_fw.h", "IP_FW_TYPE", 0x300},
+{"linux/quota.h", "Q_GETQUOTA", 0x300},
+{"linux/hdreg.h", "HDIO_GETGEO", 0x301},
+{"linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0x302},
+{"linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0x304},
+{"linux/hdreg.h", "HDIO_GET_IDENTITY", 0x307},
+{"linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0x308},
+{"linux/hdreg.h", "HDIO_GET_32BIT", 0x309},
+{"linux/hdreg.h", "HDIO_GET_NOWERR", 0x30a},
+{"linux/hdreg.h", "HDIO_GET_DMA", 0x30b},
+{"linux/hdreg.h", "HDIO_DRIVE_CMD", 0x31f},
+{"linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0x321},
+{"linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0x322},
+{"linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0x323},
+{"linux/hdreg.h", "HDIO_SET_32BIT", 0x324},
+{"linux/hdreg.h", "HDIO_SET_NOWERR", 0x325},
+{"linux/hdreg.h", "HDIO_SET_DMA", 0x326},
+{"linux/hdreg.h", "HDIO_SET_PIO_MODE", 0x327},
+{"linux/quota.h", "Q_SYNC", 0x600},
+{"linux/lp.h", "LPCHAR", 0x601},
+{"linux/lp_m68k.h", "LPCHAR", 0x601},
+{"linux/lp.h", "LPTIME", 0x602},
+{"linux/lp_m68k.h", "LPTIME", 0x602},
+{"linux/lp.h", "LPABORT", 0x604},
+{"linux/lp_m68k.h", "LPABORT", 0x604},
+{"linux/lp.h", "LPSETIRQ", 0x605},
+{"linux/lp_m68k.h", "LPSETIRQ", 0x605},
+{"linux/lp.h", "LPGETIRQ", 0x606},
+{"linux/lp_m68k.h", "LPGETIRQ", 0x606},
+{"linux/lp.h", "LPWAIT", 0x608},
+{"linux/lp_m68k.h", "LPWAIT", 0x608},
+{"linux/lp.h", "LPCAREFUL", 0x609},
+{"linux/lp_m68k.h", "LPCAREFUL", 0x609},
+{"linux/lp.h", "LPABORTOPEN", 0x60a},
+{"linux/lp_m68k.h", "LPABORTOPEN", 0x60a},
+{"linux/lp.h", "LPGETSTATUS", 0x60b},
+{"linux/lp_m68k.h", "LPGETSTATUS", 0x60b},
+{"linux/lp.h", "LPRESET", 0x60c},
+{"linux/lp_m68k.h", "LPRESET", 0x60c},
+{"linux/lp.h", "LPGETSTATS", 0x60d},
+{"linux/lp.h", "LPGETFLAGS", 0x60e},
+{"linux/scc.h", "TIOCSCCCFG", 0x2200},
+{"linux/scc.h", "TIOCSCCINI", 0x2201},
+{"linux/scc.h", "TIOCCHANINI", 0x2202},
+{"linux/scc.h", "TIOCCHANMEM", 0x2210},
+{"linux/scc.h", "TIOCGKISS", 0x2282},
+{"linux/scc.h", "TIOCSKISS", 0x2283},
+{"linux/scc.h", "TIOCSCCSTAT", 0x2284},
+{"linux/fb.h", "FBIOGET_VSCREENINFO", 0x4600},
+{"linux/fb.h", "FBIOPUT_VSCREENINFO", 0x4601},
+{"linux/fb.h", "FBIOGET_FSCREENINFO", 0x4602},
+{"linux/fb.h", "FBIOGETCMAP", 0x4604},
+{"linux/fb.h", "FBIOPUTCMAP", 0x4605},
+{"linux/fb.h", "FBIOPAN_DISPLAY", 0x4606},
+{"linux/fb.h", "FBIOGET_FCURSORINFO", 0x4607},
+{"linux/fb.h", "FBIOGET_VCURSORINFO", 0x4608},
+{"linux/fb.h", "FBIOPUT_VCURSORINFO", 0x4609},
+{"linux/fb.h", "FBIOGET_CURSORSTATE", 0x460a},
+{"linux/fb.h", "FBIOPUT_CURSORSTATE", 0x460b},
+{"linux/fb.h", "FBCMD_DRAWLINE", 0x4621},
+{"linux/fb.h", "FBCMD_MOVE", 0x4622},
+{"linux/kd.h", "KIOCSOUND", 0x4b2f},
+{"linux/kd.h", "KDMKTONE", 0x4b30},
+{"linux/kd.h", "KDGETLED", 0x4b31},
+{"linux/kd.h", "KDSETLED", 0x4b32},
+{"linux/kd.h", "KDGKBTYPE", 0x4b33},
+{"linux/kd.h", "KDADDIO", 0x4b34},
+{"linux/kd.h", "KDDELIO", 0x4b35},
+{"linux/kd.h", "KDENABIO", 0x4b36},
+{"linux/kd.h", "KDDISABIO", 0x4b37},
+{"linux/kd.h", "KDSETMODE", 0x4b3a},
+{"linux/kd.h", "KDGETMODE", 0x4b3b},
+{"linux/kd.h", "KDMAPDISP", 0x4b3c},
+{"linux/kd.h", "KDUNMAPDISP", 0x4b3d},
+{"linux/kd.h", "GIO_SCRNMAP", 0x4b40},
+{"linux/kd.h", "PIO_SCRNMAP", 0x4b41},
+{"linux/kd.h", "KDGKBMODE", 0x4b44},
+{"linux/kd.h", "KDSKBMODE", 0x4b45},
+{"linux/kd.h", "KDGKBENT", 0x4b46},
+{"linux/kd.h", "KDSKBENT", 0x4b47},
+{"linux/kd.h", "KDGKBSENT", 0x4b48},
+{"linux/kd.h", "KDSKBSENT", 0x4b49},
+{"linux/kd.h", "KDGKBDIACR", 0x4b4a},
+{"linux/kd.h", "KDSKBDIACR", 0x4b4b},
+{"linux/kd.h", "KDGETKEYCODE", 0x4b4c},
+{"linux/kd.h", "KDSETKEYCODE", 0x4b4d},
+{"linux/kd.h", "KDSIGACCEPT", 0x4b4e},
+{"linux/kd.h", "GIO_FONT", 0x4b60},
+{"linux/kd.h", "PIO_FONT", 0x4b61},
+{"linux/kd.h", "KDGKBMETA", 0x4b62},
+{"linux/kd.h", "KDSKBMETA", 0x4b63},
+{"linux/kd.h", "KDGKBLED", 0x4b64},
+{"linux/kd.h", "KDSKBLED", 0x4b65},
+{"linux/kd.h", "GIO_UNIMAP", 0x4b66},
+{"linux/kd.h", "PIO_UNIMAP", 0x4b67},
+{"linux/kd.h", "PIO_UNIMAPCLR", 0x4b68},
+{"linux/kd.h", "GIO_UNISCRNMAP", 0x4b69},
+{"linux/kd.h", "PIO_UNISCRNMAP", 0x4b6a},
+{"linux/kd.h", "GIO_FONTX", 0x4b6b},
+{"linux/kd.h", "PIO_FONTX", 0x4b6c},
+{"linux/kd.h", "PIO_FONTRESET", 0x4b6d},
+{"linux/kd.h", "GIO_CMAP", 0x4b70},
+{"linux/kd.h", "PIO_CMAP", 0x4b71},
+{"linux/loop.h", "LOOP_SET_FD", 0x4c00},
+{"linux/loop.h", "LOOP_CLR_FD", 0x4c01},
+{"linux/loop.h", "LOOP_SET_STATUS", 0x4c02},
+{"linux/loop.h", "LOOP_GET_STATUS", 0x4c03},
+{"linux/cdrom.h", "CDROMPAUSE", 0x5301},
+{"linux/cdrom.h", "CDROMRESUME", 0x5302},
+{"linux/cdrom.h", "CDROMPLAYMSF", 0x5303},
+{"linux/cdrom.h", "CDROMPLAYTRKIND", 0x5304},
+{"linux/cdrom.h", "CDROMREADTOCHDR", 0x5305},
+{"linux/cdrom.h", "CDROMREADTOCENTRY", 0x5306},
+{"linux/cdrom.h", "CDROMSTOP", 0x5307},
+{"linux/cdrom.h", "CDROMSTART", 0x5308},
+{"linux/cdrom.h", "CDROMEJECT", 0x5309},
+{"linux/cdrom.h", "CDROMVOLCTRL", 0x530a},
+{"linux/cdrom.h", "CDROMSUBCHNL", 0x530b},
+{"linux/cdrom.h", "CDROMREADMODE2", 0x530c},
+{"linux/cdrom.h", "CDROMREADMODE1", 0x530d},
+{"linux/cdrom.h", "CDROMREADAUDIO", 0x530e},
+{"linux/cdrom.h", "CDROMEJECT_SW", 0x530f},
+{"linux/cdrom.h", "CDROMMULTISESSION", 0x5310},
+{"linux/cdrom.h", "CDROM_GET_UPC", 0x5311},
+{"linux/cm206.h", "CDROM_GET_UPC", 0x5311},
+{"linux/cdrom.h", "CDROMRESET", 0x5312},
+{"linux/cm206.h", "CDROMRESET", 0x5312},
+{"linux/cdrom.h", "CDROMVOLREAD", 0x5313},
+{"linux/cdrom.h", "CDROMREADRAW", 0x5314},
+{"linux/cdrom.h", "CDROMREADCOOKED", 0x5315},
+{"linux/cdrom.h", "CDROMSEEK", 0x5316},
+{"linux/cdrom.h", "CDROMPLAYBLK", 0x5317},
+{"linux/cdrom.h", "CDROMREADALL", 0x5318},
+{"linux/cdrom.h", "CDROMCLOSETRAY", 0x5319},
+{"linux/cdrom.h", "CDROMLOADFROMSLOT", 0x531a},
+{"linux/ucdrom.h", "CDROM_SET_OPTIONS", 0x5320},
+{"linux/ucdrom.h", "CDROM_CLEAR_OPTIONS", 0x5321},
+{"linux/ucdrom.h", "CDROM_SELECT_SPEED", 0x5322},
+{"linux/ucdrom.h", "CDROM_SELECT_DISC", 0x5323},
+{"linux/ucdrom.h", "CDROM_MEDIA_CHANGED", 0x5325},
+{"linux/ucdrom.h", "CDROM_DRIVE_STATUS", 0x5326},
+{"linux/ucdrom.h", "CDROM_DISC_STATUS", 0x5327},
+{"linux/sbpcd.h", "CDROMAUDIOBUFSIZ", 0x5382},
+{"asm/ioctls.h", "TIOCEXCL", 0x540c},
+{"asm/ioctls.h", "TIOCNXCL", 0x540d},
+{"asm/ioctls.h", "TIOCSCTTY", 0x540e},
+{"asm/ioctls.h", "TIOCSTI", 0x5412},
+{"asm/ioctls.h", "TIOCMGET", 0x5415},
+{"asm/ioctls.h", "TIOCMBIS", 0x5416},
+{"asm/ioctls.h", "TIOCMBIC", 0x5417},
+{"asm/ioctls.h", "TIOCMSET", 0x5418},
+{"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419},
+{"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a},
+{"asm/ioctls.h", "TIOCLINUX", 0x541c},
+{"asm/ioctls.h", "TIOCCONS", 0x541d},
+{"asm/ioctls.h", "TIOCGSERIAL", 0x541e},
+{"asm/ioctls.h", "TIOCSSERIAL", 0x541f},
+{"asm/ioctls.h", "TIOCPKT", 0x5420},
+{"asm/ioctls.h", "TIOCNOTTY", 0x5422},
+{"asm/ioctls.h", "TIOCSETD", 0x5423},
+{"asm/ioctls.h", "TIOCGETD", 0x5424},
+{"asm/ioctls.h", "TCSBRKP", 0x5425},
+{"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426},
+{"asm/ioctls.h", "TIOCSERCONFIG", 0x5453},
+{"asm/ioctls.h", "TIOCSERGWILD", 0x5454},
+{"asm/ioctls.h", "TIOCSERSWILD", 0x5455},
+{"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456},
+{"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457},
+{"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458},
+{"asm/ioctls.h", "TIOCSERGETLSR", 0x5459},
+{"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a},
+{"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b},
+{"asm/ioctls.h", "TIOCMIWAIT", 0x545c},
+{"asm/ioctls.h", "TIOCGICOUNT", 0x545d},
+{"linux/vt.h", "VT_OPENQRY", 0x5600},
+{"linux/vt.h", "VT_GETMODE", 0x5601},
+{"linux/vt.h", "VT_SETMODE", 0x5602},
+{"linux/vt.h", "VT_GETSTATE", 0x5603},
+{"linux/vt.h", "VT_SENDSIG", 0x5604},
+{"linux/vt.h", "VT_RELDISP", 0x5605},
+{"linux/vt.h", "VT_ACTIVATE", 0x5606},
+{"linux/vt.h", "VT_WAITACTIVE", 0x5607},
+{"linux/vt.h", "VT_DISALLOCATE", 0x5608},
+{"linux/vt.h", "VT_RESIZE", 0x5609},
+{"linux/vt.h", "VT_RESIZEX", 0x560a},
+{"linux/vt.h", "VT_LOCKSWITCH", 0x560b},
+{"linux/vt.h", "VT_UNLOCKSWITCH", 0x560c},
+{"asm/sockios.h", "SIOCGSTAMP", 0x8906},
+{"linux/sockios.h", "SIOCADDRT", 0x890b},
+{"linux/sockios.h", "SIOCDELRT", 0x890c},
+{"linux/sockios.h", "SIOCGIFNAME", 0x8910},
+{"linux/sockios.h", "SIOCSIFLINK", 0x8911},
+{"linux/sockios.h", "SIOCGIFCONF", 0x8912},
+{"linux/sockios.h", "SIOCGIFFLAGS", 0x8913},
+{"linux/sockios.h", "SIOCSIFFLAGS", 0x8914},
+{"linux/sockios.h", "SIOCGIFADDR", 0x8915},
+{"linux/sockios.h", "SIOCSIFADDR", 0x8916},
+{"linux/sockios.h", "SIOCGIFDSTADDR", 0x8917},
+{"linux/sockios.h", "SIOCSIFDSTADDR", 0x8918},
+{"linux/sockios.h", "SIOCGIFBRDADDR", 0x8919},
+{"linux/sockios.h", "SIOCSIFBRDADDR", 0x891a},
+{"linux/sockios.h", "SIOCGIFNETMASK", 0x891b},
+{"linux/sockios.h", "SIOCSIFNETMASK", 0x891c},
+{"linux/sockios.h", "SIOCGIFMETRIC", 0x891d},
+{"linux/sockios.h", "SIOCSIFMETRIC", 0x891e},
+{"linux/sockios.h", "SIOCGIFMEM", 0x891f},
+{"linux/sockios.h", "SIOCSIFMEM", 0x8920},
+{"linux/sockios.h", "SIOCGIFMTU", 0x8921},
+{"linux/sockios.h", "SIOCSIFMTU", 0x8922},
+{"linux/sockios.h", "SIOCSIFHWADDR", 0x8924},
+{"linux/sockios.h", "SIOCGIFENCAP", 0x8925},
+{"linux/sockios.h", "SIOCSIFENCAP", 0x8926},
+{"linux/sockios.h", "SIOCGIFHWADDR", 0x8927},
+{"linux/sockios.h", "SIOCGIFSLAVE", 0x8929},
+{"linux/sockios.h", "SIOCSIFSLAVE", 0x8930},
+{"linux/sockios.h", "SIOCADDMULTI", 0x8931},
+{"linux/sockios.h", "SIOCDELMULTI", 0x8932},
+{"linux/sockios.h", "SIOCGIFBR", 0x8940},
+{"linux/sockios.h", "SIOCSIFBR", 0x8941},
+{"linux/sockios.h", "OLD_SIOCDARP", 0x8950},
+{"linux/sockios.h", "OLD_SIOCGARP", 0x8951},
+{"linux/sockios.h", "OLD_SIOCSARP", 0x8952},
+{"linux/sockios.h", "SIOCDARP", 0x8953},
+{"linux/sockios.h", "SIOCGARP", 0x8954},
+{"linux/sockios.h", "SIOCSARP", 0x8955},
+{"linux/sockios.h", "SIOCDRARP", 0x8960},
+{"linux/sockios.h", "SIOCGRARP", 0x8961},
+{"linux/sockios.h", "SIOCSRARP", 0x8962},
+{"linux/sockios.h", "SIOCGIFMAP", 0x8970},
+{"linux/sockios.h", "SIOCSIFMAP", 0x8971},
+{"linux/sockios.h", "SIOCADDDLCI", 0x8980},
+{"linux/sockios.h", "SIOCDELDLCI", 0x8981},
+{"linux/sockios.h", "SIOCPROTOPRIVATE", 0x89e0},
+{"linux/sockios.h", "SIOCDEVPRIVATE", 0x89f0},
+{"linux/sbpcd.h", "DDIOCSDBG", 0x9000},
+{"linux/cyclades.h", "CYGETMON", 0x435901},
+{"linux/cyclades.h", "CYGETTHRESH", 0x435902},
+{"linux/cyclades.h", "CYSETTHRESH", 0x435903},
+{"linux/cyclades.h", "CYGETDEFTHRESH", 0x435904},
+{"linux/cyclades.h", "CYSETDEFTHRESH", 0x435905},
+{"linux/cyclades.h", "CYGETTIMEOUT", 0x435906},
+{"linux/cyclades.h", "CYSETTIMEOUT", 0x435907},
+{"linux/cyclades.h", "CYGETDEFTIMEOUT", 0x435908},
+{"linux/cyclades.h", "CYSETDEFTIMEOUT", 0x435909},
+{"linux/fs.h", "FIBMAP", 0x20000001},
+{"linux/fs.h", "FIGETBSZ", 0x20000002},
+{"linux/fd.h", "FDCLRPRM", 0x20000241},
+{"linux/fd.h", "FDMSGON", 0x20000245},
+{"linux/fd.h", "FDMSGOFF", 0x20000246},
+{"linux/fd.h", "FDFMTBEG", 0x20000247},
+{"linux/fd.h", "FDFMTEND", 0x20000249},
+{"linux/fd.h", "FDSETEMSGTRESH", 0x2000024a},
+{"linux/fd.h", "FDFLUSH", 0x2000024b},
+{"linux/fd.h", "FDRESET", 0x20000254},
+{"linux/fd.h", "FDWERRORCLR", 0x20000256},
+{"linux/fd.h", "FDRAWCMD", 0x20000258},
+{"linux/fd.h", "FDTWADDLE", 0x20000259},
+{"linux/fd.h", "FDEJECT", 0x2000025a},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_DOS", 0x200004d2},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_DOS", 0x200004d3},
+{"linux/umsdos_fs.h", "UMSDOS_RMDIR_DOS", 0x200004d4},
+{"linux/umsdos_fs.h", "UMSDOS_STAT_DOS", 0x200004d5},
+{"linux/umsdos_fs.h", "UMSDOS_CREAT_EMD", 0x200004d6},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_EMD", 0x200004d7},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_EMD", 0x200004d8},
+{"linux/umsdos_fs.h", "UMSDOS_GETVERSION", 0x200004d9},
+{"linux/umsdos_fs.h", "UMSDOS_INIT_EMD", 0x200004da},
+{"linux/umsdos_fs.h", "UMSDOS_DOS_SETUP", 0x200004db},
+{"linux/umsdos_fs.h", "UMSDOS_RENAME_DOS", 0x200004dc},
+{"linux/md.h", "REGISTER_DEV", 0x20000901},
+{"linux/md.h", "START_MD", 0x20000902},
+{"linux/md.h", "STOP_MD", 0x20000903},
+{"linux/md.h", "MD_INVALID", 0x20000904},
+{"linux/md.h", "MD_VALID", 0x20000905},
+{"linux/fs.h", "BLKROSET", 0x2000125d},
+{"linux/fs.h", "BLKROGET", 0x2000125e},
+{"linux/fs.h", "BLKRRPART", 0x2000125f},
+{"linux/fs.h", "BLKGETSIZE", 0x20001260},
+{"linux/fs.h", "BLKFLSBUF", 0x20001261},
+{"linux/fs.h", "BLKRASET", 0x20001262},
+{"linux/fs.h", "BLKRAGET", 0x20001263},
+{"linux/cm206.h", "CM206CTL_GET_STAT", 0x20002000},
+{"linux/cm206.h", "CM206CTL_GET_LAST_STAT", 0x20002001},
+{"linux/apm_bios.h", "APM_IOC_STANDBY", 0x20004101},
+{"linux/apm_bios.h", "APM_IOC_SUSPEND", 0x20004102},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_TXDELAY", 0x20004202},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_PPERSIST", 0x20004203},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_SLOTTIME", 0x20004204},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_TXTAIL", 0x20004205},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_FULLDUP", 0x20004206},
+{"linux/baycom.h", "BAYCOMCTL_CALIBRATE", 0x2000420a},
+{"linux/soundcard.h", "SNDCTL_COPR_RESET", 0x20004300},
+{"linux/isdn.h", "IIOCNETAIF", 0x20004901},
+{"linux/isdn.h", "IIOCNETDIF", 0x20004902},
+{"linux/isdn.h", "IIOCNETSCF", 0x20004903},
+{"linux/isdn.h", "IIOCNETGCF", 0x20004904},
+{"linux/isdn.h", "IIOCNETANM", 0x20004905},
+{"linux/isdn.h", "IIOCNETDNM", 0x20004906},
+{"linux/isdn.h", "IIOCNETGNM", 0x20004907},
+{"linux/isdn.h", "IIOCGETSET", 0x20004908},
+{"linux/isdn.h", "IIOCSETSET", 0x20004909},
+{"linux/isdn.h", "IIOCSETVER", 0x2000490a},
+{"linux/isdn.h", "IIOCNETHUP", 0x2000490b},
+{"linux/isdn.h", "IIOCSETGST", 0x2000490c},
+{"linux/isdn.h", "IIOCSETBRJ", 0x2000490d},
+{"linux/isdn.h", "IIOCSIGPRF", 0x2000490e},
+{"linux/isdn.h", "IIOCGETPRF", 0x2000490f},
+{"linux/isdn.h", "IIOCSETPRF", 0x20004910},
+{"linux/isdn.h", "IIOCGETMAP", 0x20004911},
+{"linux/isdn.h", "IIOCSETMAP", 0x20004912},
+{"linux/isdn.h", "IIOCNETASL", 0x20004913},
+{"linux/isdn.h", "IIOCNETDIL", 0x20004914},
+{"linux/isdn.h", "IIOCGETCPS", 0x20004915},
+{"linux/isdn.h", "IIOCNETALN", 0x20004920},
+{"linux/isdn.h", "IIOCNETDLN", 0x20004921},
+{"linux/isdn.h", "IIOCDBGVAR", 0x2000497f},
+{"linux/isdn.h", "IIOCDRVCTL", 0x20004980},
+{"linux/soundcard.h", "SNDCTL_DSP_RESET", 0x20005000},
+{"linux/soundcard.h", "SNDCTL_DSP_SYNC", 0x20005001},
+{"linux/soundcard.h", "SNDCTL_DSP_POST", 0x20005008},
+{"linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", 0x2000500e},
+{"linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", 0x20005015},
+{"linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", 0x20005016},
+{"linux/soundcard.h", "SNDCTL_SEQ_RESET", 0x20005100},
+{"linux/soundcard.h", "SNDCTL_SEQ_SYNC", 0x20005101},
+{"linux/soundcard.h", "SNDCTL_SEQ_PANIC", 0x20005111},
+{"linux/random.h", "RNDZAPENTCNT", 0x20005204},
+{"linux/random.h", "RNDCLEARPOOL", 0x20005206},
+{"linux/soundcard.h", "SNDCTL_TMR_START", 0x20005402},
+{"linux/soundcard.h", "SNDCTL_TMR_STOP", 0x20005403},
+{"linux/soundcard.h", "SNDCTL_TMR_CONTINUE", 0x20005404},
+{"linux/comstats.h", "COM_GETPORTSTATS", 0x2000631e},
+{"linux/comstats.h", "COM_CLRPORTSTATS", 0x2000631f},
+{"linux/comstats.h", "COM_GETBRDSTATS", 0x20006320},
+{"linux/comstats.h", "COM_READPORT", 0x20006328},
+{"linux/comstats.h", "COM_READBOARD", 0x20006329},
+{"linux/comstats.h", "COM_READPANEL", 0x2000632a},
+{"asm/ioctls.h", "FIOCLEX", 0x20006601},
+{"asm/ioctls.h", "FIONCLEX", 0x20006602},
+{"linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", 0x20006e03},
+{"linux/cdk.h", "STL_BINTR", 0x20007314},
+{"linux/cdk.h", "STL_BSTART", 0x20007315},
+{"linux/cdk.h", "STL_BSTOP", 0x20007316},
+{"linux/cdk.h", "STL_BRESET", 0x20007317},
+{"linux/cdk.h", "STL_GETPFLAG", 0x20007350},
+{"linux/cdk.h", "STL_SETPFLAG", 0x20007351},
+{"asm/ioctls.h", "TCSBRK", 0x2000741d},
+{"asm/ioctls.h", "TCXONC", 0x2000741e},
+{"asm/ioctls.h", "TCFLSH", 0x2000741f},
+{"linux/if_ppp.h", "PPPIOCXFERUNIT", 0x2000744e},
+{"asm/ioctls.h", "TIOCSTART", 0x2000746e},
+{"asm/ioctls.h", "TIOCSTOP", 0x2000746f},
+{"linux/baycom.h", "BAYCOMCTL_GETDCD", 0x40014200},
+{"linux/baycom.h", "BAYCOMCTL_GETPTT", 0x40014201},
+{"linux/baycom.h", "BAYCOMCTL_GETSAMPLES", 0x40014210},
+{"linux/baycom.h", "BAYCOMCTL_GETBITS", 0x40014211},
+{"linux/soundcard.h", "SOUND_MIXER_READ_VOLUME", 0x40044d00},
+{"linux/soundcard.h", "SOUND_MIXER_READ_BASS", 0x40044d01},
+{"linux/soundcard.h", "SOUND_MIXER_READ_TREBLE", 0x40044d02},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SYNTH", 0x40044d03},
+{"linux/soundcard.h", "SOUND_MIXER_READ_PCM", 0x40044d04},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SPEAKER", 0x40044d05},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE", 0x40044d06},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MIC", 0x40044d07},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CD", 0x40044d08},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IMIX", 0x40044d09},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ALTPCM", 0x40044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECLEV", 0x40044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IGAIN", 0x40044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_OGAIN", 0x40044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE1", 0x40044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE2", 0x40044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE3", 0x40044d10},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MUTE", 0x40044d1c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ENHANCE", 0x40044d1d},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LOUD", 0x40044d1e},
+{"linux/soundcard.h", "SOUND_MIXER_READ_STEREODEVS", 0x40044dfb},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CAPS", 0x40044dfc},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECMASK", 0x40044dfd},
+{"linux/soundcard.h", "SOUND_MIXER_READ_DEVMASK", 0x40044dfe},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECSRC", 0x40044dff},
+{"linux/soundcard.h", "SOUND_PCM_READ_RATE", 0x40045002},
+{"linux/soundcard.h", "SOUND_PCM_READ_BITS", 0x40045005},
+{"linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", 0x40045006},
+{"linux/soundcard.h", "SOUND_PCM_READ_FILTER", 0x40045007},
+{"linux/soundcard.h", "SNDCTL_DSP_GETFMTS", 0x4004500b},
+{"linux/soundcard.h", "SNDCTL_DSP_GETCAPS", 0x4004500f},
+{"linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", 0x40045010},
+{"linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", 0x40045104},
+{"linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", 0x40045105},
+{"linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", 0x4004510a},
+{"linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", 0x4004510b},
+{"linux/random.h", "RNDGETENTCNT", 0x40045200},
+{"asm/sockios.h", "FIOGETOWN", 0x4004667b},
+{"asm/ioctls.h", "FIONREAD", 0x4004667f},
+{"asm/sockios.h", "SIOCATMARK", 0x40047307},
+{"asm/sockios.h", "SIOCGPGRP", 0x40047309},
+{"linux/if_ppp.h", "PPPIOCGDEBUG", 0x40047441},
+{"linux/if_ppp.h", "PPPIOCGMRU", 0x40047453},
+{"linux/if_ppp.h", "PPPIOCGRASYNCMAP", 0x40047455},
+{"linux/if_ppp.h", "PPPIOCGUNIT", 0x40047456},
+{"linux/if_ppp.h", "PPPIOCGASYNCMAP", 0x40047458},
+{"linux/if_ppp.h", "PPPIOCGFLAGS", 0x4004745a},
+{"asm/ioctls.h", "TIOCOUTQ", 0x40047473},
+{"asm/ioctls.h", "TIOCGPGRP", 0x40047477},
+{"linux/isdn_ppp.h", "PPPIOCGMPFLAGS", 0x40047482},
+{"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID", 0x40047501},
+{"asm/ioctls.h", "TIOCGETP", 0x40067408},
+{"asm/ioctls.h", "TIOCGETC", 0x40067412},
+{"asm/ioctls.h", "TIOCGLTC", 0x40067474},
+{"linux/baycom.h", "BAYCOMCTL_DEBUG1", 0x40084212},
+{"linux/baycom.h", "BAYCOMCTL_DEBUG2", 0x40084213},
+{"linux/baycom.h", "BAYCOMCTL_DEBUG3", 0x40084214},
+{"linux/random.h", "RNDGETPOOL", 0x40085202},
+{"linux/ext2_fs.h", "EXT2_IOC_GETFLAGS", 0x40086601},
+{"linux/mtio.h", "MTIOCPOS", 0x40086d03},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", 0x40087201},
+{"asm/ioctls.h", "TIOCGWINSZ", 0x40087468},
+{"linux/ext2_fs.h", "EXT2_IOC_GETVERSION", 0x40087601},
+{"linux/soundcard.h", "SNDCTL_DSP_GETIPTR", 0x400c5011},
+{"linux/soundcard.h", "SNDCTL_DSP_GETOPTR", 0x400c5012},
+{"linux/fd.h", "FDGETDRVTYP", 0x4010020f},
+{"linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", 0x4010500c},
+{"linux/soundcard.h", "SNDCTL_DSP_GETISPACE", 0x4010500d},
+{"linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", 0x40105013},
+{"linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", 0x40105014},
+{"linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", 0x40106e01},
+{"linux/if_ppp.h", "PPPIOCGIDLE", 0x4010743f},
+{"asm/ioctls.h", "TCGETA", 0x40127417},
+{"linux/fd.h", "FDGETMAXERRS", 0x4014020e},
+{"linux/fd.h", "FDGETPRM", 0x40200204},
+{"linux/fd.h", "FDGETFDCSTAT", 0x40200215},
+{"linux/if_ppp.h", "PPPIOCGXASYNCMAP", 0x40207450},
+{"linux/baycom.h", "BAYCOMCTL_GETPARAMS", 0x40244208},
+{"linux/baycom.h", "BAYCOMCTL_SETPARAMS", 0x40244209},
+{"linux/fd.h", "FDWERRORGET", 0x40280217},
+{"linux/baycom.h", "BAYCOMCTL_GETSTAT", 0x40284207},
+{"asm/ioctls.h", "TCGETS", 0x402c7413},
+{"linux/mtio.h", "MTIOCGET", 0x40306d02},
+{"linux/fd.h", "FDGETDRVSTAT", 0x40500212},
+{"linux/fd.h", "FDPOLLDRVSTAT", 0x40500213},
+{"linux/fd.h", "FDGETDRVPRM", 0x40800211},
+{"linux/soundcard.h", "SNDCTL_COPR_RCVMSG", 0x4fa44309},
+{"linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", 0x80045010},
+{"linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", 0x80045106},
+{"linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", 0x80045108},
+{"linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", 0x80045109},
+{"linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", 0x8004510d},
+{"linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", 0x8004510f},
+{"linux/random.h", "RNDADDTOENTCNT", 0x80045201},
+{"linux/soundcard.h", "SNDCTL_TMR_METRONOME", 0x80045407},
+{"linux/soundcard.h", "SNDCTL_TMR_SELECT", 0x80045408},
+{"asm/sockios.h", "FIOSETOWN", 0x8004667c},
+{"asm/ioctls.h", "FIOASYNC", 0x8004667d},
+{"asm/ioctls.h", "FIONBIO", 0x8004667e},
+{"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", 0x80046e02},
+{"asm/sockios.h", "SIOCSPGRP", 0x80047308},
+{"linux/if_ppp.h", "PPPIOCSDEBUG", 0x80047440},
+{"linux/if_ppp.h", "PPPIOCSMAXCID", 0x80047451},
+{"linux/if_ppp.h", "PPPIOCSMRU", 0x80047452},
+{"linux/if_ppp.h", "PPPIOCSRASYNCMAP", 0x80047454},
+{"linux/if_ppp.h", "PPPIOCSASYNCMAP", 0x80047457},
+{"linux/if_ppp.h", "PPPIOCSFLAGS", 0x80047459},
+{"asm/ioctls.h", "TIOCSPGRP", 0x80047476},
+{"linux/isdn_ppp.h", "PPPIOCBUNDLE", 0x80047481},
+{"linux/isdn_ppp.h", "PPPIOCSMPFLAGS", 0x80047483},
+{"linux/isdn_ppp.h", "PPPIOCSMPMTU", 0x80047484},
+{"linux/isdn_ppp.h", "PPPIOCSMPMRU", 0x80047485},
+{"asm/ioctls.h", "TIOCSETP", 0x80067409},
+{"asm/ioctls.h", "TIOCSETN", 0x8006740a},
+{"asm/ioctls.h", "TIOCSETC", 0x80067411},
+{"asm/ioctls.h", "TIOCSLTC", 0x80067475},
+{"linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", 0x80085112},
+{"linux/random.h", "RNDADDENTROPY", 0x80085203},
+{"linux/ext2_fs.h", "EXT2_IOC_SETFLAGS", 0x80086602},
+{"linux/mtio.h", "MTIOCTOP", 0x80086d01},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", 0x80087202},
+{"linux/if_ppp.h", "PPPIOCSNPMODE", 0x8008744b},
+{"asm/ioctls.h", "TIOCSWINSZ", 0x80087467},
+{"linux/ext2_fs.h", "EXT2_IOC_SETVERSION", 0x80087602},
+{"linux/fd.h", "FDFMTTRK", 0x800c0248},
+{"linux/if_ppp.h", "PPPIOCSCOMPRESS", 0x8010744d},
+{"asm/ioctls.h", "TCSETA", 0x80127418},
+{"asm/ioctls.h", "TCSETAW", 0x80127419},
+{"asm/ioctls.h", "TCSETAF", 0x8012741c},
+{"linux/fd.h", "FDSETMAXERRS", 0x8014024c},
+{"linux/soundcard.h", "SNDCTL_COPR_WDATA", 0x80144304},
+{"linux/soundcard.h", "SNDCTL_COPR_WCODE", 0x80144305},
+{"linux/fd.h", "FDSETPRM", 0x80200242},
+{"linux/fd.h", "FDDEFPRM", 0x80200243},
+{"linux/if_ppp.h", "PPPIOCSXASYNCMAP", 0x8020744f},
+{"linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", 0x80285107},
+{"asm/ioctls.h", "TCSETS", 0x802c7414},
+{"asm/ioctls.h", "TCSETSW", 0x802c7415},
+{"asm/ioctls.h", "TCSETSF", 0x802c7416},
+{"linux/fd.h", "FDSETDRVPRM", 0x80800290},
+{"linux/soundcard.h", "SNDCTL_COPR_SENDMSG", 0x8fa44308},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_VOLUME", 0xc0044d00},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_BASS", 0xc0044d01},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_TREBLE", 0xc0044d02},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SYNTH", 0xc0044d03},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_PCM", 0xc0044d04},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SPEAKER", 0xc0044d05},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE", 0xc0044d06},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MIC", 0xc0044d07},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_CD", 0xc0044d08},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IMIX", 0xc0044d09},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ALTPCM", 0xc0044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECLEV", 0xc0044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IGAIN", 0xc0044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_OGAIN", 0xc0044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE1", 0xc0044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE2", 0xc0044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE3", 0xc0044d10},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MUTE", 0xc0044d1c},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ENHANCE", 0xc0044d1d},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LOUD", 0xc0044d1e},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECSRC", 0xc0044dff},
+{"linux/soundcard.h", "SNDCTL_DSP_SPEED", 0xc0045002},
+{"linux/soundcard.h", "SNDCTL_DSP_STEREO", 0xc0045003},
+{"linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", 0xc0045004},
+{"linux/soundcard.h", "SNDCTL_DSP_SETFMT", 0xc0045005},
+{"linux/soundcard.h", "SOUND_PCM_WRITE_CHANNELS", 0xc0045006},
+{"linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", 0xc0045007},
+{"linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", 0xc0045009},
+{"linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", 0xc004500a},
+{"linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", 0xc0045103},
+{"linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", 0xc004510e},
+{"linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", 0xc0045401},
+{"linux/soundcard.h", "SNDCTL_TMR_TEMPO", 0xc0045405},
+{"linux/soundcard.h", "SNDCTL_TMR_SOURCE", 0xc0045406},
+{"linux/soundcard.h", "SNDCTL_MIDI_PRETIME", 0xc0046d00},
+{"linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", 0xc0046d01},
+{"linux/if_ppp.h", "PPPIOCGNPMODE", 0xc008744c},
+{"linux/soundcard.h", "SNDCTL_COPR_RDATA", 0xc0144302},
+{"linux/soundcard.h", "SNDCTL_COPR_RCODE", 0xc0144303},
+{"linux/soundcard.h", "SNDCTL_COPR_RUN", 0xc0144306},
+{"linux/soundcard.h", "SNDCTL_COPR_HALT", 0xc0144307},
+{"linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", 0xc0216d02},
+{"linux/isdn_ppp.h", "PPPIOCLINKINFO", 0xc0247480},
+{"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", 0xc0386e04},
+{"linux/soundcard.h", "SNDCTL_MIDI_INFO", 0xc074510c},
+{"linux/soundcard.h", "SNDCTL_SYNTH_INFO", 0xc08c5102},
+{"linux/soundcard.h", "SNDCTL_COPR_LOAD", 0xcfb04301},
+{"linux/soundcard.h", "SNDCTL_PMGR_IFACE", 0xcfb85001},
+{"linux/soundcard.h", "SNDCTL_PMGR_ACCESS", 0xcfb85110},
diff --git a/linux/alpha/ioctlent.sh b/linux/alpha/ioctlent.sh
new file mode 100644
index 000000000..dd5fd9da8
--- /dev/null
+++ b/linux/alpha/ioctlent.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+# All rights reserved.
+#
+# Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+# Files to find.
+file_find='asm/*.h linux/*.h scsi/*.h'
+
+# Files to stop.
+file_stop='asm/byteorder.h linux/config.h linux/pci.h linux/xd.h'
+
+# Defs to find.
+# Work on the kernel source to convert all to df_iowr.
+# Don't know how to find low-numbered ioctls in linux/mc146818rtc.h.
+df_name='^[ ]*#[ ]*define[ ]+[A-Z_][A-Z0-9_]*[ ]+'
+df_iowr='_IO|_IOR|_IOW|_IOWR'
+df_NNNN='0[Xx](03|06|22|46|4B|4C|53|54|56|89|90)[0-9A-Fa-f][0-9A-Fa-f]'
+df_4359='0[Xx]4359[0-9A-Fa-f][0-9A-Fa-f]' # linux/cyclades.h
+df_470N='470[0-9]' # linux/fs.h (only in 1.2.13)
+df_smix='MIXER_READ|MIXER_WRITE' # linux/soundcard.h
+df_12NN='12[3-4][0-9]' # linux/umsdos_fs.h (only in 1.2.13)
+df_tail='([() ]|$)'
+def_find="$df_name($df_iowr|$df_NNNN|$df_4359|$df_470N|$df_smix|$df_12NN)$df_tail"
+
+# Defs to stop.
+ds_tail='_MAGIC|_PATCH'
+ds_fdmp='FD(DEF|GET|SET)MEDIAPRM' # linux/fd.h aliases (only in 1.2.13)
+ds_mtio='MTIOC(GET|SET)CONFIG' # linux/mtio.h needs config (only in 1.2.13)
+def_stop="$ds_tail|$ds_fdmp|$ds_mtio"
+
+# Validate arg count.
+if [ $# -ne 1 ]
+then
+ echo "usage: $0 include-directory" >&2
+ exit 1
+fi
+
+# Grep through the files.
+(
+ # Construct list: find files minus stop files.
+ cd $1 || exit
+ file_list=`(ls $file_find $file_stop $file_stop 2>/dev/null) | sort | uniq -u`
+
+ # Grep matching #define lines.
+ # Transform to C structure form.
+ # Filter out stop list.
+ egrep "$def_find" $file_list |
+ sed -n -e 's/^\(.*\):#[ ]*define[ ]*\([A-Z_][A-Z0-9_]*\).*$/ { "\1", "\2", \2 },/p' |
+ egrep -v "$def_stop"
+) > ioctlent.tmp
+
+# Generate the output file.
+echo '/* This file is automatically generated by ioctlent.sh */'
+echo
+echo '#include <sys/types.h>'
+echo
+echo '/* Needed for <linux/baycom.h> */'
+echo '#define BAYCOM_DEBUG'
+echo
+echo '/* Needed for <linux/cyclades.h> */'
+echo '#include <linux/termios.h>'
+echo '#include <linux/tqueue.h>'
+echo
+awk '{ print "#include <" substr($2, 2, length($2) - 3) ">" }' ioctlent.tmp | sort -u
+echo
+echo 'struct ioctlent ioctlent [] ='
+echo '{'
+cat ioctlent.tmp
+echo '};'
+
+# Clean up.
+rm -f ioctlent.tmp
diff --git a/linux/alpha/signalent.h b/linux/alpha/signalent.h
new file mode 100644
index 000000000..2b507e3be
--- /dev/null
+++ b/linux/alpha/signalent.h
@@ -0,0 +1,32 @@
+ "SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGURG", /* 16 */
+ "SIGSTOP", /* 17 */
+ "SIGTSTP", /* 18 */
+ "SIGCONT", /* 19 */
+ "SIGCHLD", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGIO", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGINFO", /* 29 */
+ "SIGUSR1", /* 30 */
+ "SIGUSR2", /* 31 */
diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h
new file mode 100644
index 000000000..794a0a374
--- /dev/null
+++ b/linux/alpha/syscallent.h
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+ { 5, 0, printargs, "SYS_0" }, /* 0 */
+ { 1, TP, sys_exit, "exit" }, /* 1 */
+ { 0, TP, sys_fork, "fork" }, /* 2 */
+ { 3, TF, sys_read, "read" }, /* 3 */
+ { 3, TF, sys_write, "write" }, /* 4 */
+ { 5, 0, printargs, "SYS_5" }, /* 5 */
+ { 1, 0, sys_close, "close" }, /* 6 */
+ { 4, TP, sys_wait4, "wait4" }, /* 7 */
+ { 5, 0, printargs, "SYS_8" }, /* 8 */
+ { 2, TF, sys_link, "link" }, /* 9 */
+ { 1, TF, sys_unlink, "unlink" }, /* 10 */
+ { 5, 0, printargs, "SYS_11" }, /* 11 */
+ { 1, TF, sys_chdir, "chdir" }, /* 12 */
+ { 1, TF, sys_fchdir, "fchdir" }, /* 13 */
+ { 3, TF, sys_mknod, "mknod" }, /* 14 */
+ { 2, TF, sys_chmod, "chmod" }, /* 15 */
+ { 3, TF, sys_chown, "chown" }, /* 16 */
+ { 1, 0, sys_brk, "brk" }, /* 17 */
+ { 5, 0, printargs, "SYS_18" }, /* 18 */
+ { 3, TF, sys_lseek, "lseek" }, /* 19 */
+ { 0, 0, sys_getpid, "getxpid" }, /* 20 */
+ { 4, 0, printargs, "osf_mount" }, /* 21 */
+ { 2, 0, printargs, "osf_umount" }, /* 22 */
+ { 1, 0, sys_setuid, "setuid" }, /* 23 */
+ { 0, 0, sys_getuid, "getxuid" }, /* 24 */
+ { 5, 0, printargs, "SYS_25" }, /* 25 */
+ { 4, 0, sys_ptrace, "ptrace" }, /* 26 */
+ { 5, 0, printargs, "SYS_27" }, /* 27 */
+ { 5, 0, printargs, "SYS_28" }, /* 28 */
+ { 5, 0, printargs, "SYS_29" }, /* 29 */
+ { 5, 0, printargs, "SYS_30" }, /* 30 */
+ { 5, 0, printargs, "SYS_31" }, /* 31 */
+ { 5, 0, printargs, "SYS_32" }, /* 32 */
+ { 2, TF, sys_access, "access" }, /* 33 */
+ { 5, 0, printargs, "SYS_34" }, /* 34 */
+ { 5, 0, printargs, "SYS_35" }, /* 35 */
+ { 0, 0, sys_sync, "sync" }, /* 36 */
+ { 2, TS, sys_kill, "kill" }, /* 37 */
+ { 5, 0, printargs, "SYS_38" }, /* 38 */
+ { 2, 0, sys_setpgid, "setpgid" }, /* 39 */
+ { 5, 0, printargs, "SYS_40" }, /* 40 */
+ { 1, 0, sys_dup, "dup" }, /* 41 */
+ { 1, 0, sys_pipe, "pipe" }, /* 42 */
+ { 5, 0, printargs, "SYS_43" }, /* 43 */
+ { 5, 0, printargs, "SYS_44" }, /* 44 */
+ { 3, TF, sys_open, "open" }, /* 45 */
+ { 5, 0, printargs, "SYS_46" }, /* 46 */
+ { 1, 0, sys_getgid, "getxgid" }, /* 47 */
+ { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 48 */
+ { 5, 0, printargs, "SYS_49" }, /* 49 */
+ { 5, 0, printargs, "SYS_50" }, /* 50 */
+ { 1, TF, sys_acct, "acct" }, /* 51 */
+ { 1, TS, sys_sigpending, "sigpending" }, /* 52 */
+ { 5, 0, printargs, "SYS_53" }, /* 53 */
+ { 3, 0, sys_ioctl, "ioctl" }, /* 54 */
+ { 5, 0, printargs, "SYS_55" }, /* 55 */
+ { 5, 0, printargs, "SYS_56" }, /* 56 */
+ { 2, TF, sys_symlink, "symlink" }, /* 57 */
+ { 3, TF, sys_readlink, "readlink" }, /* 58 */
+ { 3, TF|TP, sys_execve, "execve" }, /* 59 */
+ { 1, 0, sys_umask, "umask" }, /* 60 */
+ { 1, TF, sys_chroot, "chroot" }, /* 61 */
+ { 5, 0, printargs, "SYS_62" }, /* 62 */
+ { 0, 0, sys_getpgrp, "getpgrp" }, /* 63 */
+ { 0, 0, sys_getpagesize, "getpagesize" }, /* 64 */
+ { 5, 0, printargs, "SYS_65" }, /* 65 */
+ { 0, TP, sys_fork, "osf_vfork" }, /* 66 */
+ { 2, TF, sys_stat, "stat" }, /* 67 */
+ { 2, TF, sys_lstat, "lstat" }, /* 68 */
+ { 5, 0, printargs, "SYS_69" }, /* 69 */
+ { 5, 0, printargs, "SYS_70" }, /* 70 */
+ { 1, 0, sys_mmap, "mmap" }, /* 71 */
+ { 5, 0, printargs, "SYS_72" }, /* 72 */
+ { 2, 0, sys_munmap, "munmap" }, /* 73 */
+ { 3, 0, sys_mprotect, "mprotect" }, /* 74 */
+ { 0, 0, printargs, "madvise" }, /* 75 */
+ { 0, 0, sys_vhangup, "vhangup" }, /* 76 */
+ { 5, 0, printargs, "SYS_77" }, /* 77 */
+ { 5, 0, printargs, "SYS_78" }, /* 78 */
+ { 2, 0, sys_getgroups, "getgroups" }, /* 79 */
+ { 2, 0, sys_setgroups, "setgroups" }, /* 80 */
+ { 5, 0, printargs, "SYS_81" }, /* 81 */
+ { 2, 0, sys_setpgrp, "setpgrp" }, /* 82 */
+ { 3, 0, sys_setitimer, "setitimer" }, /* 83 */
+ { 5, 0, printargs, "SYS_84" }, /* 84 */
+ { 5, 0, printargs, "SYS_85" }, /* 85 */
+ { 2, 0, sys_getitimer, "getitimer" }, /* 86 */
+ { 2, 0, sys_gethostname, "gethostname" }, /* 87 */
+ { 2, 0, sys_sethostname, "sethostname" }, /* 88 */
+ { 0, 0, sys_getdtablesize, "getdtablesize" }, /* 89 */
+ { 2, 0, sys_dup2, "dup2" }, /* 90 */
+ { 2, 0, sys_fstat, "fstat" }, /* 91 */
+ { 3, 0, sys_fcntl, "fcntl" }, /* 92 */
+ { 5, 0, sys_select, "select" }, /* 93 */
+ { 5, 0, printargs, "SYS_94" }, /* 94 */
+ { 1, 0, sys_fsync, "fsync" }, /* 95 */
+ { 3, 0, sys_setpriority, "setpriority" }, /* 96 */
+ { 3, TN, sys_socket, "socket" }, /* 97 */
+ { 3, TN, sys_connect, "connect" }, /* 98 */
+ { 3, TN, sys_accept, "accept" }, /* 99 */
+ { 2, 0, sys_getpriority, "getpriority" }, /* 100 */
+ { 4, TN, sys_send, "send" }, /* 101 */
+ { 4, TN, sys_recv, "recv" }, /* 102 */
+ { 1, TS, sys_sigreturn, "sigreturn" }, /* 103 */
+ { 3, TN, sys_bind, "bind" }, /* 104 */
+ { 5, TN, sys_setsockopt, "setsockopt" }, /* 105 */
+ { 2, TN, sys_listen, "listen" }, /* 106 */
+ { 5, 0, printargs, "SYS_107" }, /* 107 */
+ { 5, 0, printargs, "SYS_108" }, /* 108 */
+ { 5, 0, printargs, "SYS_109" }, /* 109 */
+ { 5, 0, printargs, "SYS_110" }, /* 110 */
+ { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 111 */
+ { 5, 0, printargs, "SYS_112" }, /* 112 */
+ { 3, TN, sys_recvmsg, "recvmsg" }, /* 113 */
+ { 3, TN, sys_sendmsg, "sendmsg" }, /* 114 */
+ { 5, 0, printargs, "SYS_115" }, /* 115 */
+ { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 116 */
+ { 2, 0, sys_getrusage, "getrusage" }, /* 117 */
+ { 5, TN, sys_getsockopt, "getsockopt" }, /* 118 */
+ { 5, 0, printargs, "SYS_119" }, /* 119 */
+ { 3, 0, sys_readv, "readv" }, /* 120 */
+ { 3, 0, sys_writev, "writev" }, /* 121 */
+ { 2, 0, sys_settimeofday, "settimeofday" }, /* 122 */
+ { 3, 0, sys_fchown, "fchown" }, /* 123 */
+ { 2, 0, sys_fchmod, "fchmod" }, /* 124 */
+ { 6, TN, sys_recvfrom, "recvfrom" }, /* 125 */
+ { 2, 0, sys_setreuid, "setreuid" }, /* 126 */
+ { 2, 0, sys_setregid, "setregid" }, /* 127 */
+ { 2, TF, sys_rename, "rename" }, /* 128 */
+ { 2, TF, sys_truncate, "truncate" }, /* 129 */
+ { 2, 0, sys_ftruncate, "ftruncate" }, /* 130 */
+ { 2, 0, sys_flock, "flock" }, /* 131 */
+ { 1, 0, sys_setgid, "setgid" }, /* 132 */
+ { 6, TN, sys_sendto, "sendto" }, /* 133 */
+ { 2, TN, sys_shutdown, "shutdown" }, /* 134 */
+ { 4, TN, sys_socketpair, "socketpair" }, /* 135 */
+ { 2, TF, sys_mkdir, "mkdir" }, /* 136 */
+ { 1, TF, sys_rmdir, "rmdir" }, /* 137 */
+ { 2, 0, sys_utimes, "utimes" }, /* 138 */
+ { 5, 0, printargs, "SYS_139" }, /* 139 */
+ { 5, 0, printargs, "SYS_140" }, /* 140 */
+ { 3, TN, sys_getpeername, "getpeername" }, /* 141 */
+ { 5, 0, printargs, "SYS_142" }, /* 142 */
+ { 5, 0, printargs, "SYS_143" }, /* 143 */
+ { 2, 0, sys_getrlimit, "getrlimit" }, /* 144 */
+ { 2, 0, sys_setrlimit, "setrlimit" }, /* 145 */
+ { 5, 0, printargs, "SYS_146" }, /* 146 */
+ { 0, 0, sys_setsid, "setsid" }, /* 147 */
+ { 4, 0, sys_quotactl, "quotactl" }, /* 148 */
+ { 5, 0, printargs, "SYS_149" }, /* 149 */
+ { 3, TN, sys_getsockname, "getsockname" }, /* 150 */
+ { 5, 0, printargs, "SYS_151" }, /* 151 */
+ { 5, 0, printargs, "SYS_152" }, /* 152 */
+ { 5, 0, printargs, "SYS_153" }, /* 153 */
+ { 5, 0, printargs, "SYS_154" }, /* 154 */
+ { 5, 0, printargs, "SYS_155" }, /* 155 */
+ { 3, TS, sys_sigaction, "sigaction" }, /* 156 */
+ { 5, 0, printargs, "SYS_157" }, /* 157 */
+ { 5, 0, printargs, "SYS_158" }, /* 158 */
+ { 4, 0, printargs, "osf_getdirentries"}, /* 159 */
+ { 3, 0, osf_statfs, "osf_statfs" }, /* 160 */
+ { 3, 0, osf_fstatfs, "osf_fstatfs" }, /* 161 */
+ { 5, 0, printargs, "SYS_162" }, /* 162 */
+ { 5, 0, printargs, "SYS_163" }, /* 163 */
+ { 5, 0, printargs, "SYS_164" }, /* 164 */
+ { 2, 0, printargs, "osf_getdomainname"}, /* 165 */
+ { 2, 0, sys_setdomainname, "setdomainname" }, /* 166 */
+ { 5, 0, printargs, "SYS_167" }, /* 167 */
+ { 5, 0, printargs, "SYS_168" }, /* 168 */
+ { 5, 0, printargs, "SYS_169" }, /* 169 */
+ { 5, 0, printargs, "SYS_170" }, /* 170 */
+ { 5, 0, printargs, "SYS_171" }, /* 171 */
+ { 5, 0, printargs, "SYS_172" }, /* 172 */
+ { 5, 0, printargs, "SYS_173" }, /* 173 */
+ { 5, 0, printargs, "SYS_174" }, /* 174 */
+ { 5, 0, printargs, "SYS_175" }, /* 175 */
+ { 5, 0, printargs, "SYS_176" }, /* 176 */
+ { 5, 0, printargs, "SYS_177" }, /* 177 */
+ { 5, 0, printargs, "SYS_178" }, /* 178 */
+ { 5, 0, printargs, "SYS_179" }, /* 179 */
+ { 5, 0, printargs, "SYS_180" }, /* 180 */
+ { 5, 0, printargs, "SYS_181" }, /* 181 */
+ { 5, 0, printargs, "SYS_182" }, /* 182 */
+ { 5, 0, printargs, "SYS_183" }, /* 183 */
+ { 5, 0, printargs, "SYS_184" }, /* 184 */
+ { 5, 0, printargs, "SYS_185" }, /* 185 */
+ { 5, 0, printargs, "SYS_186" }, /* 186 */
+ { 5, 0, printargs, "SYS_187" }, /* 187 */
+ { 5, 0, printargs, "SYS_188" }, /* 188 */
+ { 5, 0, printargs, "SYS_189" }, /* 189 */
+ { 5, 0, printargs, "SYS_190" }, /* 190 */
+ { 5, 0, printargs, "SYS_191" }, /* 191 */
+ { 5, 0, printargs, "SYS_192" }, /* 192 */
+ { 5, 0, printargs, "SYS_193" }, /* 193 */
+ { 5, 0, printargs, "SYS_194" }, /* 194 */
+ { 5, 0, printargs, "SYS_195" }, /* 195 */
+ { 5, 0, printargs, "SYS_196" }, /* 196 */
+ { 5, 0, printargs, "SYS_197" }, /* 197 */
+ { 5, 0, printargs, "SYS_198" }, /* 198 */
+ { 4, 0, printargs, "osf_swapon" }, /* 199 */
+ { 4, TI, sys_msgctl, "msgctl" }, /* 200 */
+ { 4, TI, sys_msgget, "msgget" }, /* 201 */
+ { 4, TI, sys_msgrcv, "msgrcv" }, /* 202 */
+ { 4, TI, sys_msgsnd, "msgsnd" }, /* 203 */
+ { 4, TI, sys_semctl, "semctl" }, /* 204 */
+ { 4, TI, sys_semget, "semget" }, /* 205 */
+ { 4, TI, printargs, "semop" }, /* 206 */
+ { 1, 0, printargs, "osf_utsname" }, /* 207 */
+ { 5, 0, printargs, "SYS_208" }, /* 208 */
+ { 3, TI, printargs, "osf_shmat" }, /* 209 */
+ { 4, TI, sys_shmctl, "shmctl" }, /* 210 */
+ { 4, TI, sys_shmdt, "shmdt" }, /* 211 */
+ { 4, TI, sys_shmget, "shmget" }, /* 212 */
+ { 5, 0, printargs, "SYS_213" }, /* 213 */
+ { 5, 0, printargs, "SYS_214" }, /* 214 */
+ { 5, 0, printargs, "SYS_215" }, /* 215 */
+ { 5, 0, printargs, "SYS_216" }, /* 216 */
+ { 3, 0, sys_msync, "msync" }, /* 217 */
+ { 5, 0, printargs, "SYS_218" }, /* 218 */
+ { 5, 0, printargs, "SYS_219" }, /* 219 */
+ { 5, 0, printargs, "SYS_220" }, /* 220 */
+ { 5, 0, printargs, "SYS_221" }, /* 221 */
+ { 5, 0, printargs, "SYS_222" }, /* 222 */
+ { 5, 0, printargs, "SYS_223" }, /* 223 */
+ { 5, 0, printargs, "SYS_224" }, /* 224 */
+ { 5, 0, printargs, "SYS_225" }, /* 225 */
+ { 5, 0, printargs, "SYS_226" }, /* 226 */
+ { 5, 0, printargs, "SYS_227" }, /* 227 */
+ { 5, 0, printargs, "SYS_228" }, /* 228 */
+ { 5, 0, printargs, "SYS_229" }, /* 229 */
+ { 5, 0, printargs, "SYS_230" }, /* 230 */
+ { 5, 0, printargs, "SYS_231" }, /* 231 */
+ { 5, 0, printargs, "SYS_232" }, /* 232 */
+ { 1, 0, sys_getpgid, "getpgid" }, /* 233 */
+ { 1, 0, sys_getsid, "getsid" }, /* 234 */
+ { 5, 0, printargs, "SYS_235" }, /* 235 */
+ { 5, 0, printargs, "SYS_236" }, /* 236 */
+ { 5, 0, printargs, "SYS_237" }, /* 237 */
+ { 5, 0, printargs, "SYS_238" }, /* 238 */
+ { 5, 0, printargs, "SYS_239" }, /* 239 */
+ { 5, 0, printargs, "SYS_240" }, /* 240 */
+ { 5, 0, printargs, "SYS_241" }, /* 241 */
+ { 5, 0, printargs, "SYS_242" }, /* 242 */
+ { 5, 0, printargs, "SYS_243" }, /* 243 */
+ { 2, 0, printargs, "osf_proplist_syscall"}, /* 244 */
+ { 5, 0, printargs, "SYS_245" }, /* 245 */
+ { 5, 0, printargs, "SYS_246" }, /* 246 */
+ { 5, 0, printargs, "SYS_247" }, /* 247 */
+ { 5, 0, printargs, "SYS_248" }, /* 248 */
+ { 5, 0, printargs, "SYS_249" }, /* 249 */
+ { 2, 0, printargs, "osf_usleep_thread"}, /* 250 */
+ { 5, 0, printargs, "SYS_251" }, /* 251 */
+ { 5, 0, printargs, "SYS_252" }, /* 252 */
+ { 5, 0, printargs, "SYS_253" }, /* 253 */
+ { 5, 0, sys_sysfs, "sysfs" }, /* 254 */
+ { 5, 0, printargs, "SYS_255" }, /* 255 */
+ { 5, 0, printargs, "osf_getsysinfo"}, /* 256 */
+ { 5, 0, printargs, "osf_setsysinfo"}, /* 257 */
+ { 5, 0, printargs, "SYS_258" }, /* 258 */
+ { 5, 0, printargs, "SYS_259" }, /* 259 */
+ { 5, 0, printargs, "SYS_260" }, /* 260 */
+ { 5, 0, printargs, "SYS_261" }, /* 261 */
+ { 5, 0, printargs, "SYS_262" }, /* 262 */
+ { 5, 0, printargs, "SYS_263" }, /* 263 */
+ { 5, 0, printargs, "SYS_264" }, /* 264 */
+ { 5, 0, printargs, "SYS_265" }, /* 265 */
+ { 5, 0, printargs, "SYS_266" }, /* 266 */
+ { 5, 0, printargs, "SYS_267" }, /* 267 */
+ { 5, 0, printargs, "SYS_268" }, /* 268 */
+ { 5, 0, printargs, "SYS_269" }, /* 269 */
+ { 5, 0, printargs, "SYS_270" }, /* 270 */
+ { 5, 0, printargs, "SYS_271" }, /* 271 */
+ { 5, 0, printargs, "SYS_272" }, /* 272 */
+ { 5, 0, printargs, "SYS_273" }, /* 273 */
+ { 5, 0, printargs, "SYS_274" }, /* 274 */
+ { 5, 0, printargs, "SYS_275" }, /* 275 */
+ { 5, 0, printargs, "SYS_276" }, /* 276 */
+ { 5, 0, printargs, "SYS_277" }, /* 277 */
+ { 5, 0, printargs, "SYS_278" }, /* 278 */
+ { 5, 0, printargs, "SYS_279" }, /* 279 */
+ { 5, 0, printargs, "SYS_280" }, /* 280 */
+ { 5, 0, printargs, "SYS_281" }, /* 281 */
+ { 5, 0, printargs, "SYS_282" }, /* 282 */
+ { 5, 0, printargs, "SYS_283" }, /* 283 */
+ { 5, 0, printargs, "SYS_284" }, /* 284 */
+ { 5, 0, printargs, "SYS_285" }, /* 285 */
+ { 5, 0, printargs, "SYS_286" }, /* 286 */
+ { 5, 0, printargs, "SYS_287" }, /* 287 */
+ { 5, 0, printargs, "SYS_288" }, /* 288 */
+ { 5, 0, printargs, "SYS_289" }, /* 289 */
+ { 5, 0, printargs, "SYS_290" }, /* 290 */
+ { 5, 0, printargs, "SYS_291" }, /* 291 */
+ { 5, 0, printargs, "SYS_292" }, /* 292 */
+ { 5, 0, printargs, "SYS_293" }, /* 293 */
+ { 5, 0, printargs, "SYS_294" }, /* 294 */
+ { 5, 0, printargs, "SYS_295" }, /* 295 */
+ { 5, 0, printargs, "SYS_296" }, /* 296 */
+ { 5, 0, printargs, "SYS_297" }, /* 297 */
+ { 5, 0, printargs, "SYS_298" }, /* 298 */
+ { 5, 0, printargs, "SYS_299" }, /* 299 */
+ { 0, 0, sys_bdflush, "bdflush" }, /* 300 */
+ { 3, 0, printargs, "sethae" }, /* 301 */
+ { 5, TF, sys_mount, "mount" }, /* 302 */
+ { 1, 0, sys_adjtimex, "adjtimex" }, /* 303 */
+ { 1, 0, sys_swapoff, "swapoff" }, /* 304 */
+ { 3, 0, sys_getdents, "getdents" }, /* 305 */
+ { 2, 0, sys_create_module, "create_module" }, /* 306 */
+ { 4, 0, sys_init_module, "init_module" }, /* 307 */
+ { 1, 0, sys_delete_module, "delete_module" }, /* 308 */
+ { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 309 */
+ { 3, 0, sys_syslog, "syslog" }, /* 310 */
+ { 3, 0, sys_reboot, "reboot" }, /* 311 */
+ { 2, TP, sys_clone, "clone" }, /* 312 */
+ { 1, 0, sys_uselib, "uselib" }, /* 313 */
+ { 2, 0, sys_mlock, "mlock" }, /* 314 */
+ { 2, 0, sys_munlock, "munlock" }, /* 315 */
+ { 1, 0, sys_mlockall, "mlockall" }, /* 316 */
+ { 1, 0, sys_munlockall, "munlockall" }, /* 317 */
+ { 1, 0, sys_sysinfo, "sysinfo" }, /* 318 */
+ { 1, 0, sys_sysctl, "sysctl" }, /* 319 */
+ { 0, 0, sys_idle, "idle" }, /* 320 */
+ { 1, 0, sys_umount, "umount" }, /* 321 */
+ { 1, 0, sys_swapon, "swapon" }, /* 322 */
+ { 1, 0, sys_times, "times" }, /* 323 */
+ { 1, 0, sys_personality, "personality" }, /* 324 */
+ { 1, 0, sys_setfsuid, "setfsuid" }, /* 325 */
+ { 1, 0, sys_setfsgid, "setfsgid" }, /* 326 */
+ { 2, 0, sys_ustat, "ustat" }, /* 327 */
+ { 2, TF, sys_statfs, "statfs" }, /* 328 */
+ { 2, 0, sys_fstatfs, "fstatfs" }, /* 329 */
+ { 2, 0, sys_sched_setparam, "sched_setparam"}, /* 330 */
+ { 2, 0, sys_sched_getparam, "sched_getparam"}, /* 331 */
+ { 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 332 */
+ { 2, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 333 */
+ { 0, 0, sys_sched_yield, "sched_yield" }, /* 334 */
+ { 1, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 335 */
+ { 1, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 336 */
+ { 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 337 */
+ { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 338 */
+ { 1, 0, sys_uname, "uname" }, /* 339 */
+ { 2, 0, sys_nanosleep, "nanosleep" }, /* 340 */
+ { 5, 0, sys_mremap, "mremap" }, /* 341 */
+ { 5, 0, printargs, "SYS_342" }, /* 342 */
+ { 5, 0, printargs, "SYS_343" }, /* 343 */
+ { 5, 0, printargs, "SYS_344" }, /* 344 */
+ { 5, 0, printargs, "SYS_345" }, /* 345 */
+ { 5, 0, printargs, "SYS_346" }, /* 346 */
+ { 5, 0, printargs, "SYS_347" }, /* 347 */
+ { 5, 0, printargs, "SYS_348" }, /* 348 */
+ { 5, 0, printargs, "SYS_349" }, /* 349 */
diff --git a/linux/dummy.h b/linux/dummy.h
new file mode 100644
index 000000000..7f7d34d3f
--- /dev/null
+++ b/linux/dummy.h
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+/* still unfinished */
+#define sys_reboot printargs
+#define sys_ioperm printargs
+#define sys_syslog printargs
+#define sys_iopl printargs
+#define sys_vm86old printargs
+#define sys_modify_ldt printargs
+#define sys_init_module printargs
+#define sys_get_kernel_syms printargs
+#define sys_quotactl printargs
+#define sys_bdflush printargs
+#define sys_sysfs printargs
+#define sys_afs_syscall printargs
+
+#define sys_fdatasync printargs
+#define sys_sysctl printargs
+#define sys_mlock printargs
+#define sys_munlock printargs
+#define sys_mlockall printargs
+#define sys_munlockall printargs
+#define sys_sched_setparam printargs
+#define sys_sched_getparam printargs
+#define sys_sched_setscheduler printargs
+#define sys_sched_getscheduler printargs
+#define sys_sched_yield printargs
+#define sys_sched_get_priority_max printargs
+#define sys_sched_get_priority_min printargs
+#define sys_sched_rr_get_interval printargs
+#define sys_mremap printargs
+
+/* like another call */
+#define sys_uselib sys_chdir
+#define sys_umount sys_chdir
+#define sys_swapon sys_chdir
+#define sys_swapoff sys_chdir
+#define sys_clone sys_fork
+#define sys_create_module sys_sethostname
+#define sys_delete_module sys_chdir
+#define sys_fchdir sys_close
+#define sys_setfsuid sys_setuid
+#define sys_setfsgid sys_setgid
+#define sys_nanosleep sys_adjtime
+
+/* printargs does the right thing */
+#define sys_setup printargs
+#define sys_getpid printargs
+#define sys_getuid printargs
+#define sys_pause printargs
+#define sys_sync printargs
+#define sys_getgid printargs
+#define sys_geteuid printargs
+#define sys_getegid printargs
+#define sys_getppid printargs
+#define sys_getpgrp printargs
+#define sys_setsid printargs
+#define sys_vhangup printargs
+#define sys_idle printargs
+#define sys_getpgid printargs
+
+/* subcall entry points */
+#define sys_socketcall printargs
+#define sys_ipc printargs
+
+/* unimplemented */
+#define sys_stty printargs
+#define sys_gtty printargs
+#define sys_ftime printargs
+#define sys_prof printargs
+#define sys_acct printargs
+#define sys_phys printargs
+#define sys_lock printargs
+#define sys_mpx printargs
+#define sys_ulimit printargs
+#define sys_profil printargs
+#define sys_ustat printargs
+#define sys_break printargs
+
+/* deprecated */
+#define sys_oldstat printargs
+#define sys_oldlstat printargs
+#define sys_oldfstat printargs
+#define sys_olduname printargs
+#define sys_oldolduname printargs
+
+/* no library support */
+#ifndef HAVE_SENDMSG
+#define sys_sendmsg printargs
+#define sys_recvmsg printargs
+#endif
+
+#if DONE
+#define sys_oldselect printargs
+#define sys_msync printargs
+#define sys_flock printargs
+#define sys_getdents printargs
+#define sys_stime printargs
+#define sys_time printargs
+#define sys_times printargs
+#define sys_mount printargs
+#define sys_nice printargs
+#define sys_mprotect printargs
+#define sys_sigprocmask printargs
+#define sys_adjtimex printargs
+#define sys_sysinfo printargs
+#define sys_ipc printargs
+#define sys_setdomainname printargs
+#define sys_statfs printargs
+#define sys_fstatfs printargs
+#define sys_ptrace printargs
+#define sys_sigreturn printargs
+#define sys_fsync printargs
+#define sys_alarm printargs
+#define sys_socketcall printargs
+#define sys_sigsuspend printargs
+#define sys_utime printargs
+#define sys_brk printargs
+#define sys_mmap printargs
+#define sys_munmap printargs
+#define sys_select printargs
+#define sys_setuid printargs
+#define sys_setgid printargs
+#define sys_setreuid printargs
+#define sys_setregid printargs
+#define sys_getgroups printargs
+#define sys_setgroups printargs
+#define sys_setrlimit printargs
+#define sys_getrlimit printargs
+#define sys_getrusage printargs
+#define sys_getpriority printargs
+#define sys_setpriority printargs
+#define sys_setpgid printargs
+#define sys_access printargs
+#define sys_sethostname printargs
+#define sys_readdir printargs
+#define sys_waitpid printargs
+#define sys_wait4 printargs
+#define sys_execve printargs
+#define sys_fork printargs
+#define sys_uname printargs
+#define sys_pipe printargs
+#define sys_siggetmask printargs
+#define sys_sigsetmask printargs
+#define sys_exit printargs
+#define sys_kill printargs
+#define sys_signal printargs
+#define sys_sigaction printargs
+#define sys_sigpending printargs
+#define sys_fcntl printargs
+#define sys_dup printargs
+#define sys_dup2 printargs
+#define sys_close printargs
+#define sys_ioctl printargs
+#define sys_read printargs
+#define sys_write printargs
+#define sys_open printargs
+#define sys_creat printargs
+#define sys_link printargs
+#define sys_unlink printargs
+#define sys_chdir printargs
+#define sys_mknod printargs
+#define sys_chmod printargs
+#define sys_chown printargs
+#define sys_lseek printargs
+#define sys_rename printargs
+#define sys_mkdir printargs
+#define sys_rmdir printargs
+#define sys_umask printargs
+#define sys_chroot printargs
+#define sys_gettimeofday printargs
+#define sys_settimeofday printargs
+#define sys_symlink printargs
+#define sys_readlink printargs
+#define sys_truncate printargs
+#define sys_ftruncate printargs
+#define sys_fchmod printargs
+#define sys_fchown printargs
+#define sys_setitimer printargs
+#define sys_getitimer printargs
+#define sys_stat printargs
+#define sys_lstat printargs
+#define sys_fstat printargs
+#define sys_personality printargs
+#define sys_poll printargs
+#endif
diff --git a/linux/errnoent.h b/linux/errnoent.h
new file mode 100644
index 000000000..c00d23ffd
--- /dev/null
+++ b/linux/errnoent.h
@@ -0,0 +1,516 @@
+ "ERRNO_0", /* 0 */
+ "EPERM", /* 1 */
+ "ENOENT", /* 2 */
+ "ESRCH", /* 3 */
+ "EINTR", /* 4 */
+ "EIO", /* 5 */
+ "ENXIO", /* 6 */
+ "E2BIG", /* 7 */
+ "ENOEXEC", /* 8 */
+ "EBADF", /* 9 */
+ "ECHILD", /* 10 */
+ "EAGAIN", /* 11 */
+ "ENOMEM", /* 12 */
+ "EACCES", /* 13 */
+ "EFAULT", /* 14 */
+ "ENOTBLK", /* 15 */
+ "EBUSY", /* 16 */
+ "EEXIST", /* 17 */
+ "EXDEV", /* 18 */
+ "ENODEV", /* 19 */
+ "ENOTDIR", /* 20 */
+ "EISDIR", /* 21 */
+ "EINVAL", /* 22 */
+ "ENFILE", /* 23 */
+ "EMFILE", /* 24 */
+ "ENOTTY", /* 25 */
+ "ETXTBSY", /* 26 */
+ "EFBIG", /* 27 */
+ "ENOSPC", /* 28 */
+ "ESPIPE", /* 29 */
+ "EROFS", /* 30 */
+ "EMLINK", /* 31 */
+ "EPIPE", /* 32 */
+ "EDOM", /* 33 */
+ "ERANGE", /* 34 */
+ "EDEADLK", /* 35 */
+ "ENAMETOOLONG", /* 36 */
+ "ENOLCK", /* 37 */
+ "ENOSYS", /* 38 */
+ "ENOTEMPTY", /* 39 */
+ "ELOOP", /* 40 */
+ "ERRNO_41", /* 41 */
+ "ENOMSG", /* 42 */
+ "EIDRM", /* 43 */
+ "ECHRNG", /* 44 */
+ "EL2NSYNC", /* 45 */
+ "EL3HLT", /* 46 */
+ "EL3RST", /* 47 */
+ "ELNRNG", /* 48 */
+ "EUNATCH", /* 49 */
+ "ENOCSI", /* 50 */
+ "EL2HLT", /* 51 */
+ "EBADE", /* 52 */
+ "EBADR", /* 53 */
+ "EXFULL", /* 54 */
+ "ENOANO", /* 55 */
+ "EBADRQC", /* 56 */
+ "EBADSLT", /* 57 */
+ "EDEADLOCK", /* 58 */
+ "EBFONT", /* 59 */
+ "ENOSTR", /* 60 */
+ "ENODATA", /* 61 */
+ "ETIME", /* 62 */
+ "ENOSR", /* 63 */
+ "ENONET", /* 64 */
+ "ENOPKG", /* 65 */
+ "EREMOTE", /* 66 */
+ "ENOLINK", /* 67 */
+ "EADV", /* 68 */
+ "ESRMNT", /* 69 */
+ "ECOMM", /* 70 */
+ "EPROTO", /* 71 */
+ "EMULTIHOP", /* 72 */
+ "EDOTDOT", /* 73 */
+ "EBADMSG", /* 74 */
+ "EOVERFLOW", /* 75 */
+ "ENOTUNIQ", /* 76 */
+ "EBADFD", /* 77 */
+ "EREMCHG", /* 78 */
+ "ELIBACC", /* 79 */
+ "ELIBBAD", /* 80 */
+ "ELIBSCN", /* 81 */
+ "ELIBMAX", /* 82 */
+ "ELIBEXEC", /* 83 */
+ "EILSEQ", /* 84 */
+ "ERESTART", /* 85 */
+ "ESTRPIPE", /* 86 */
+ "EUSERS", /* 87 */
+ "ENOTSOCK", /* 88 */
+ "EDESTADDRREQ", /* 89 */
+ "EMSGSIZE", /* 90 */
+ "EPROTOTYPE", /* 91 */
+ "ENOPROTOOPT", /* 92 */
+ "EPROTONOSUPPORT", /* 93 */
+ "ESOCKTNOSUPPORT", /* 94 */
+ "EOPNOTSUPP", /* 95 */
+ "EPFNOSUPPORT", /* 96 */
+ "EAFNOSUPPORT", /* 97 */
+ "EADDRINUSE", /* 98 */
+ "EADDRNOTAVAIL", /* 99 */
+ "ENETDOWN", /* 100 */
+ "ENETUNREACH", /* 101 */
+ "ENETRESET", /* 102 */
+ "ECONNABORTED", /* 103 */
+ "ECONNRESET", /* 104 */
+ "ENOBUFS", /* 105 */
+ "EISCONN", /* 106 */
+ "ENOTCONN", /* 107 */
+ "ESHUTDOWN", /* 108 */
+ "ETOOMANYREFS", /* 109 */
+ "ETIMEDOUT", /* 110 */
+ "ECONNREFUSED", /* 111 */
+ "EHOSTDOWN", /* 112 */
+ "EHOSTUNREACH", /* 113 */
+ "EALREADY", /* 114 */
+ "EINPROGRESS", /* 115 */
+ "ESTALE", /* 116 */
+ "EUCLEAN", /* 117 */
+ "ENOTNAM", /* 118 */
+ "ENAVAIL", /* 119 */
+ "EISNAM", /* 120 */
+ "EREMOTEIO", /* 121 */
+ "EDQUOT", /* 122 */
+ "ERRNO_123", /* 123 */
+ "ERRNO_124", /* 124 */
+ "ERRNO_125", /* 125 */
+ "ERRNO_126", /* 126 */
+ "ERRNO_127", /* 127 */
+ "ERRNO_128", /* 128 */
+ "ERRNO_129", /* 129 */
+ "ERRNO_130", /* 130 */
+ "ERRNO_131", /* 131 */
+ "ERRNO_132", /* 132 */
+ "ERRNO_133", /* 133 */
+ "ERRNO_134", /* 134 */
+ "ERRNO_135", /* 135 */
+ "ERRNO_136", /* 136 */
+ "ERRNO_137", /* 137 */
+ "ERRNO_138", /* 138 */
+ "ERRNO_139", /* 139 */
+ "ERRNO_140", /* 140 */
+ "ERRNO_141", /* 141 */
+ "ERRNO_142", /* 142 */
+ "ERRNO_143", /* 143 */
+ "ERRNO_144", /* 144 */
+ "ERRNO_145", /* 145 */
+ "ERRNO_146", /* 146 */
+ "ERRNO_147", /* 147 */
+ "ERRNO_148", /* 148 */
+ "ERRNO_149", /* 149 */
+ "ERRNO_150", /* 150 */
+ "ERRNO_151", /* 151 */
+ "ERRNO_152", /* 152 */
+ "ERRNO_153", /* 153 */
+ "ERRNO_154", /* 154 */
+ "ERRNO_155", /* 155 */
+ "ERRNO_156", /* 156 */
+ "ERRNO_157", /* 157 */
+ "ERRNO_158", /* 158 */
+ "ERRNO_159", /* 159 */
+ "ERRNO_160", /* 160 */
+ "ERRNO_161", /* 161 */
+ "ERRNO_162", /* 162 */
+ "ERRNO_163", /* 163 */
+ "ERRNO_164", /* 164 */
+ "ERRNO_165", /* 165 */
+ "ERRNO_166", /* 166 */
+ "ERRNO_167", /* 167 */
+ "ERRNO_168", /* 168 */
+ "ERRNO_169", /* 169 */
+ "ERRNO_170", /* 170 */
+ "ERRNO_171", /* 171 */
+ "ERRNO_172", /* 172 */
+ "ERRNO_173", /* 173 */
+ "ERRNO_174", /* 174 */
+ "ERRNO_175", /* 175 */
+ "ERRNO_176", /* 176 */
+ "ERRNO_177", /* 177 */
+ "ERRNO_178", /* 178 */
+ "ERRNO_179", /* 179 */
+ "ERRNO_180", /* 180 */
+ "ERRNO_181", /* 181 */
+ "ERRNO_182", /* 182 */
+ "ERRNO_183", /* 183 */
+ "ERRNO_184", /* 184 */
+ "ERRNO_185", /* 185 */
+ "ERRNO_186", /* 186 */
+ "ERRNO_187", /* 187 */
+ "ERRNO_188", /* 188 */
+ "ERRNO_189", /* 189 */
+ "ERRNO_190", /* 190 */
+ "ERRNO_191", /* 191 */
+ "ERRNO_192", /* 192 */
+ "ERRNO_193", /* 193 */
+ "ERRNO_194", /* 194 */
+ "ERRNO_195", /* 195 */
+ "ERRNO_196", /* 196 */
+ "ERRNO_197", /* 197 */
+ "ERRNO_198", /* 198 */
+ "ERRNO_199", /* 199 */
+ "ERRNO_200", /* 200 */
+ "ERRNO_201", /* 201 */
+ "ERRNO_202", /* 202 */
+ "ERRNO_203", /* 203 */
+ "ERRNO_204", /* 204 */
+ "ERRNO_205", /* 205 */
+ "ERRNO_206", /* 206 */
+ "ERRNO_207", /* 207 */
+ "ERRNO_208", /* 208 */
+ "ERRNO_209", /* 209 */
+ "ERRNO_210", /* 210 */
+ "ERRNO_211", /* 211 */
+ "ERRNO_212", /* 212 */
+ "ERRNO_213", /* 213 */
+ "ERRNO_214", /* 214 */
+ "ERRNO_215", /* 215 */
+ "ERRNO_216", /* 216 */
+ "ERRNO_217", /* 217 */
+ "ERRNO_218", /* 218 */
+ "ERRNO_219", /* 219 */
+ "ERRNO_220", /* 220 */
+ "ERRNO_221", /* 221 */
+ "ERRNO_222", /* 222 */
+ "ERRNO_223", /* 223 */
+ "ERRNO_224", /* 224 */
+ "ERRNO_225", /* 225 */
+ "ERRNO_226", /* 226 */
+ "ERRNO_227", /* 227 */
+ "ERRNO_228", /* 228 */
+ "ERRNO_229", /* 229 */
+ "ERRNO_230", /* 230 */
+ "ERRNO_231", /* 231 */
+ "ERRNO_232", /* 232 */
+ "ERRNO_233", /* 233 */
+ "ERRNO_234", /* 234 */
+ "ERRNO_235", /* 235 */
+ "ERRNO_236", /* 236 */
+ "ERRNO_237", /* 237 */
+ "ERRNO_238", /* 238 */
+ "ERRNO_239", /* 239 */
+ "ERRNO_240", /* 240 */
+ "ERRNO_241", /* 241 */
+ "ERRNO_242", /* 242 */
+ "ERRNO_243", /* 243 */
+ "ERRNO_244", /* 244 */
+ "ERRNO_245", /* 245 */
+ "ERRNO_246", /* 246 */
+ "ERRNO_247", /* 247 */
+ "ERRNO_248", /* 248 */
+ "ERRNO_249", /* 249 */
+ "ERRNO_250", /* 250 */
+ "ERRNO_251", /* 251 */
+ "ERRNO_252", /* 252 */
+ "ERRNO_253", /* 253 */
+ "ERRNO_254", /* 254 */
+ "ERRNO_255", /* 255 */
+ "ERRNO_256", /* 256 */
+ "ERRNO_257", /* 257 */
+ "ERRNO_258", /* 258 */
+ "ERRNO_259", /* 259 */
+ "ERRNO_260", /* 260 */
+ "ERRNO_261", /* 261 */
+ "ERRNO_262", /* 262 */
+ "ERRNO_263", /* 263 */
+ "ERRNO_264", /* 264 */
+ "ERRNO_265", /* 265 */
+ "ERRNO_266", /* 266 */
+ "ERRNO_267", /* 267 */
+ "ERRNO_268", /* 268 */
+ "ERRNO_269", /* 269 */
+ "ERRNO_270", /* 270 */
+ "ERRNO_271", /* 271 */
+ "ERRNO_272", /* 272 */
+ "ERRNO_273", /* 273 */
+ "ERRNO_274", /* 274 */
+ "ERRNO_275", /* 275 */
+ "ERRNO_276", /* 276 */
+ "ERRNO_277", /* 277 */
+ "ERRNO_278", /* 278 */
+ "ERRNO_279", /* 279 */
+ "ERRNO_280", /* 280 */
+ "ERRNO_281", /* 281 */
+ "ERRNO_282", /* 282 */
+ "ERRNO_283", /* 283 */
+ "ERRNO_284", /* 284 */
+ "ERRNO_285", /* 285 */
+ "ERRNO_286", /* 286 */
+ "ERRNO_287", /* 287 */
+ "ERRNO_288", /* 288 */
+ "ERRNO_289", /* 289 */
+ "ERRNO_290", /* 290 */
+ "ERRNO_291", /* 291 */
+ "ERRNO_292", /* 292 */
+ "ERRNO_293", /* 293 */
+ "ERRNO_294", /* 294 */
+ "ERRNO_295", /* 295 */
+ "ERRNO_296", /* 296 */
+ "ERRNO_297", /* 297 */
+ "ERRNO_298", /* 298 */
+ "ERRNO_299", /* 299 */
+ "ERRNO_300", /* 300 */
+ "ERRNO_301", /* 301 */
+ "ERRNO_302", /* 302 */
+ "ERRNO_303", /* 303 */
+ "ERRNO_304", /* 304 */
+ "ERRNO_305", /* 305 */
+ "ERRNO_306", /* 306 */
+ "ERRNO_307", /* 307 */
+ "ERRNO_308", /* 308 */
+ "ERRNO_309", /* 309 */
+ "ERRNO_310", /* 310 */
+ "ERRNO_311", /* 311 */
+ "ERRNO_312", /* 312 */
+ "ERRNO_313", /* 313 */
+ "ERRNO_314", /* 314 */
+ "ERRNO_315", /* 315 */
+ "ERRNO_316", /* 316 */
+ "ERRNO_317", /* 317 */
+ "ERRNO_318", /* 318 */
+ "ERRNO_319", /* 319 */
+ "ERRNO_320", /* 320 */
+ "ERRNO_321", /* 321 */
+ "ERRNO_322", /* 322 */
+ "ERRNO_323", /* 323 */
+ "ERRNO_324", /* 324 */
+ "ERRNO_325", /* 325 */
+ "ERRNO_326", /* 326 */
+ "ERRNO_327", /* 327 */
+ "ERRNO_328", /* 328 */
+ "ERRNO_329", /* 329 */
+ "ERRNO_330", /* 330 */
+ "ERRNO_331", /* 331 */
+ "ERRNO_332", /* 332 */
+ "ERRNO_333", /* 333 */
+ "ERRNO_334", /* 334 */
+ "ERRNO_335", /* 335 */
+ "ERRNO_336", /* 336 */
+ "ERRNO_337", /* 337 */
+ "ERRNO_338", /* 338 */
+ "ERRNO_339", /* 339 */
+ "ERRNO_340", /* 340 */
+ "ERRNO_341", /* 341 */
+ "ERRNO_342", /* 342 */
+ "ERRNO_343", /* 343 */
+ "ERRNO_344", /* 344 */
+ "ERRNO_345", /* 345 */
+ "ERRNO_346", /* 346 */
+ "ERRNO_347", /* 347 */
+ "ERRNO_348", /* 348 */
+ "ERRNO_349", /* 349 */
+ "ERRNO_350", /* 350 */
+ "ERRNO_351", /* 351 */
+ "ERRNO_352", /* 352 */
+ "ERRNO_353", /* 353 */
+ "ERRNO_354", /* 354 */
+ "ERRNO_355", /* 355 */
+ "ERRNO_356", /* 356 */
+ "ERRNO_357", /* 357 */
+ "ERRNO_358", /* 358 */
+ "ERRNO_359", /* 359 */
+ "ERRNO_360", /* 360 */
+ "ERRNO_361", /* 361 */
+ "ERRNO_362", /* 362 */
+ "ERRNO_363", /* 363 */
+ "ERRNO_364", /* 364 */
+ "ERRNO_365", /* 365 */
+ "ERRNO_366", /* 366 */
+ "ERRNO_367", /* 367 */
+ "ERRNO_368", /* 368 */
+ "ERRNO_369", /* 369 */
+ "ERRNO_370", /* 370 */
+ "ERRNO_371", /* 371 */
+ "ERRNO_372", /* 372 */
+ "ERRNO_373", /* 373 */
+ "ERRNO_374", /* 374 */
+ "ERRNO_375", /* 375 */
+ "ERRNO_376", /* 376 */
+ "ERRNO_377", /* 377 */
+ "ERRNO_378", /* 378 */
+ "ERRNO_379", /* 379 */
+ "ERRNO_380", /* 380 */
+ "ERRNO_381", /* 381 */
+ "ERRNO_382", /* 382 */
+ "ERRNO_383", /* 383 */
+ "ERRNO_384", /* 384 */
+ "ERRNO_385", /* 385 */
+ "ERRNO_386", /* 386 */
+ "ERRNO_387", /* 387 */
+ "ERRNO_388", /* 388 */
+ "ERRNO_389", /* 389 */
+ "ERRNO_390", /* 390 */
+ "ERRNO_391", /* 391 */
+ "ERRNO_392", /* 392 */
+ "ERRNO_393", /* 393 */
+ "ERRNO_394", /* 394 */
+ "ERRNO_395", /* 395 */
+ "ERRNO_396", /* 396 */
+ "ERRNO_397", /* 397 */
+ "ERRNO_398", /* 398 */
+ "ERRNO_399", /* 399 */
+ "ERRNO_400", /* 400 */
+ "ERRNO_401", /* 401 */
+ "ERRNO_402", /* 402 */
+ "ERRNO_403", /* 403 */
+ "ERRNO_404", /* 404 */
+ "ERRNO_405", /* 405 */
+ "ERRNO_406", /* 406 */
+ "ERRNO_407", /* 407 */
+ "ERRNO_408", /* 408 */
+ "ERRNO_409", /* 409 */
+ "ERRNO_410", /* 410 */
+ "ERRNO_411", /* 411 */
+ "ERRNO_412", /* 412 */
+ "ERRNO_413", /* 413 */
+ "ERRNO_414", /* 414 */
+ "ERRNO_415", /* 415 */
+ "ERRNO_416", /* 416 */
+ "ERRNO_417", /* 417 */
+ "ERRNO_418", /* 418 */
+ "ERRNO_419", /* 419 */
+ "ERRNO_420", /* 420 */
+ "ERRNO_421", /* 421 */
+ "ERRNO_422", /* 422 */
+ "ERRNO_423", /* 423 */
+ "ERRNO_424", /* 424 */
+ "ERRNO_425", /* 425 */
+ "ERRNO_426", /* 426 */
+ "ERRNO_427", /* 427 */
+ "ERRNO_428", /* 428 */
+ "ERRNO_429", /* 429 */
+ "ERRNO_430", /* 430 */
+ "ERRNO_431", /* 431 */
+ "ERRNO_432", /* 432 */
+ "ERRNO_433", /* 433 */
+ "ERRNO_434", /* 434 */
+ "ERRNO_435", /* 435 */
+ "ERRNO_436", /* 436 */
+ "ERRNO_437", /* 437 */
+ "ERRNO_438", /* 438 */
+ "ERRNO_439", /* 439 */
+ "ERRNO_440", /* 440 */
+ "ERRNO_441", /* 441 */
+ "ERRNO_442", /* 442 */
+ "ERRNO_443", /* 443 */
+ "ERRNO_444", /* 444 */
+ "ERRNO_445", /* 445 */
+ "ERRNO_446", /* 446 */
+ "ERRNO_447", /* 447 */
+ "ERRNO_448", /* 448 */
+ "ERRNO_449", /* 449 */
+ "ERRNO_450", /* 450 */
+ "ERRNO_451", /* 451 */
+ "ERRNO_452", /* 452 */
+ "ERRNO_453", /* 453 */
+ "ERRNO_454", /* 454 */
+ "ERRNO_455", /* 455 */
+ "ERRNO_456", /* 456 */
+ "ERRNO_457", /* 457 */
+ "ERRNO_458", /* 458 */
+ "ERRNO_459", /* 459 */
+ "ERRNO_460", /* 460 */
+ "ERRNO_461", /* 461 */
+ "ERRNO_462", /* 462 */
+ "ERRNO_463", /* 463 */
+ "ERRNO_464", /* 464 */
+ "ERRNO_465", /* 465 */
+ "ERRNO_466", /* 466 */
+ "ERRNO_467", /* 467 */
+ "ERRNO_468", /* 468 */
+ "ERRNO_469", /* 469 */
+ "ERRNO_470", /* 470 */
+ "ERRNO_471", /* 471 */
+ "ERRNO_472", /* 472 */
+ "ERRNO_473", /* 473 */
+ "ERRNO_474", /* 474 */
+ "ERRNO_475", /* 475 */
+ "ERRNO_476", /* 476 */
+ "ERRNO_477", /* 477 */
+ "ERRNO_478", /* 478 */
+ "ERRNO_479", /* 479 */
+ "ERRNO_480", /* 480 */
+ "ERRNO_481", /* 481 */
+ "ERRNO_482", /* 482 */
+ "ERRNO_483", /* 483 */
+ "ERRNO_484", /* 484 */
+ "ERRNO_485", /* 485 */
+ "ERRNO_486", /* 486 */
+ "ERRNO_487", /* 487 */
+ "ERRNO_488", /* 488 */
+ "ERRNO_489", /* 489 */
+ "ERRNO_490", /* 490 */
+ "ERRNO_491", /* 491 */
+ "ERRNO_492", /* 492 */
+ "ERRNO_493", /* 493 */
+ "ERRNO_494", /* 494 */
+ "ERRNO_495", /* 495 */
+ "ERRNO_496", /* 496 */
+ "ERRNO_497", /* 497 */
+ "ERRNO_498", /* 498 */
+ "ERRNO_499", /* 499 */
+ "ERRNO_500", /* 500 */
+ "ERRNO_501", /* 501 */
+ "ERRNO_502", /* 502 */
+ "ERRNO_503", /* 503 */
+ "ERRNO_504", /* 504 */
+ "ERRNO_505", /* 505 */
+ "ERRNO_506", /* 506 */
+ "ERRNO_507", /* 507 */
+ "ERRNO_508", /* 508 */
+ "ERRNO_509", /* 509 */
+ "ERRNO_510", /* 510 */
+ "ERRNO_511", /* 511 */
+ "ERESTARTSYS", /* 512 */
+ "ERESTARTNOINTR", /* 513 */
+ "ERESTARTNOHAND", /* 514 */
+ "ENOIOCTLCMD", /* 515 */
diff --git a/linux/ioctlent.h b/linux/ioctlent.h
new file mode 100644
index 000000000..108a9fe0b
--- /dev/null
+++ b/linux/ioctlent.h
@@ -0,0 +1,519 @@
+{"linux/fs.h", "FIBMAP", 0x1},
+{"linux/fs.h", "FIGETBSZ", 0x2},
+{"linux/fd.h", "FDCLRPRM", 0x241},
+{"linux/fd.h", "FDMSGON", 0x245},
+{"linux/fd.h", "FDMSGOFF", 0x246},
+{"linux/fd.h", "FDFMTBEG", 0x247},
+{"linux/fd.h", "FDFMTEND", 0x249},
+{"linux/fd.h", "FDSETEMSGTRESH", 0x24a},
+{"linux/fd.h", "FDFLUSH", 0x24b},
+{"linux/fd.h", "FDRESET", 0x254},
+{"linux/fd.h", "FDWERRORCLR", 0x256},
+{"linux/fd.h", "FDRAWCMD", 0x258},
+{"linux/fd.h", "FDTWADDLE", 0x259},
+{"linux/fd.h", "FDEJECT", 0x25a},
+{"linux/ip_fw.h", "IP_FW_TYPE", 0x300},
+{"linux/quota.h", "Q_GETQUOTA", 0x300},
+{"linux/hdreg.h", "HDIO_GETGEO", 0x301},
+{"linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0x302},
+{"linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0x304},
+{"linux/hdreg.h", "HDIO_GET_IDENTITY", 0x307},
+{"linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0x308},
+{"linux/hdreg.h", "HDIO_GET_32BIT", 0x309},
+{"linux/hdreg.h", "HDIO_GET_NOWERR", 0x30a},
+{"linux/hdreg.h", "HDIO_GET_DMA", 0x30b},
+{"linux/hdreg.h", "HDIO_DRIVE_CMD", 0x31f},
+{"linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0x321},
+{"linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0x322},
+{"linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0x323},
+{"linux/hdreg.h", "HDIO_SET_32BIT", 0x324},
+{"linux/hdreg.h", "HDIO_SET_NOWERR", 0x325},
+{"linux/hdreg.h", "HDIO_SET_DMA", 0x326},
+{"linux/hdreg.h", "HDIO_SET_PIO_MODE", 0x327},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_DOS", 0x4d2},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_DOS", 0x4d3},
+{"linux/umsdos_fs.h", "UMSDOS_RMDIR_DOS", 0x4d4},
+{"linux/umsdos_fs.h", "UMSDOS_STAT_DOS", 0x4d5},
+{"linux/umsdos_fs.h", "UMSDOS_CREAT_EMD", 0x4d6},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_EMD", 0x4d7},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_EMD", 0x4d8},
+{"linux/umsdos_fs.h", "UMSDOS_GETVERSION", 0x4d9},
+{"linux/umsdos_fs.h", "UMSDOS_INIT_EMD", 0x4da},
+{"linux/umsdos_fs.h", "UMSDOS_DOS_SETUP", 0x4db},
+{"linux/umsdos_fs.h", "UMSDOS_RENAME_DOS", 0x4dc},
+{"linux/quota.h", "Q_SYNC", 0x600},
+{"linux/lp.h", "LPCHAR", 0x601},
+{"linux/lp_m68k.h", "LPCHAR", 0x601},
+{"linux/lp.h", "LPTIME", 0x602},
+{"linux/lp_m68k.h", "LPTIME", 0x602},
+{"linux/lp.h", "LPABORT", 0x604},
+{"linux/lp_m68k.h", "LPABORT", 0x604},
+{"linux/lp.h", "LPSETIRQ", 0x605},
+{"linux/lp_m68k.h", "LPSETIRQ", 0x605},
+{"linux/lp.h", "LPGETIRQ", 0x606},
+{"linux/lp_m68k.h", "LPGETIRQ", 0x606},
+{"linux/lp.h", "LPWAIT", 0x608},
+{"linux/lp_m68k.h", "LPWAIT", 0x608},
+{"linux/lp.h", "LPCAREFUL", 0x609},
+{"linux/lp_m68k.h", "LPCAREFUL", 0x609},
+{"linux/lp.h", "LPABORTOPEN", 0x60a},
+{"linux/lp_m68k.h", "LPABORTOPEN", 0x60a},
+{"linux/lp.h", "LPGETSTATUS", 0x60b},
+{"linux/lp_m68k.h", "LPGETSTATUS", 0x60b},
+{"linux/lp.h", "LPRESET", 0x60c},
+{"linux/lp_m68k.h", "LPRESET", 0x60c},
+{"linux/lp.h", "LPGETSTATS", 0x60d},
+{"linux/lp.h", "LPGETFLAGS", 0x60e},
+{"linux/md.h", "REGISTER_DEV", 0x901},
+{"linux/md.h", "START_MD", 0x902},
+{"linux/md.h", "STOP_MD", 0x903},
+{"linux/md.h", "MD_INVALID", 0x904},
+{"linux/md.h", "MD_VALID", 0x905},
+{"linux/fs.h", "BLKROSET", 0x125d},
+{"linux/fs.h", "BLKROGET", 0x125e},
+{"linux/fs.h", "BLKRRPART", 0x125f},
+{"linux/fs.h", "BLKGETSIZE", 0x1260},
+{"linux/fs.h", "BLKFLSBUF", 0x1261},
+{"linux/fs.h", "BLKRASET", 0x1262},
+{"linux/fs.h", "BLKRAGET", 0x1263},
+{"linux/scc.h", "TIOCSCCCFG", 0x2200},
+{"linux/scc.h", "TIOCSCCINI", 0x2201},
+{"linux/scc.h", "TIOCCHANINI", 0x2202},
+{"linux/scc.h", "TIOCCHANMEM", 0x2210},
+{"linux/scc.h", "TIOCGKISS", 0x2282},
+{"linux/scc.h", "TIOCSKISS", 0x2283},
+{"linux/scc.h", "TIOCSCCSTAT", 0x2284},
+{"linux/apm_bios.h", "APM_IOC_STANDBY", 0x4101},
+{"linux/apm_bios.h", "APM_IOC_SUSPEND", 0x4102},
+{"linux/soundcard.h", "SNDCTL_COPR_RESET", 0x4300},
+{"linux/fb.h", "FBIOGET_VSCREENINFO", 0x4600},
+{"linux/fb.h", "FBIOPUT_VSCREENINFO", 0x4601},
+{"linux/fb.h", "FBIOGET_FSCREENINFO", 0x4602},
+{"linux/fb.h", "FBIOGETCMAP", 0x4604},
+{"linux/fb.h", "FBIOPUTCMAP", 0x4605},
+{"linux/fb.h", "FBIOPAN_DISPLAY", 0x4606},
+{"linux/fb.h", "FBIOGET_FCURSORINFO", 0x4607},
+{"linux/fb.h", "FBIOGET_VCURSORINFO", 0x4608},
+{"linux/fb.h", "FBIOPUT_VCURSORINFO", 0x4609},
+{"linux/fb.h", "FBIOGET_CURSORSTATE", 0x460a},
+{"linux/fb.h", "FBIOPUT_CURSORSTATE", 0x460b},
+{"linux/fb.h", "FBCMD_DRAWLINE", 0x4621},
+{"linux/fb.h", "FBCMD_MOVE", 0x4622},
+{"linux/isdn.h", "IIOCNETAIF", 0x4901},
+{"linux/isdn.h", "IIOCNETDIF", 0x4902},
+{"linux/isdn.h", "IIOCNETSCF", 0x4903},
+{"linux/isdn.h", "IIOCNETGCF", 0x4904},
+{"linux/isdn.h", "IIOCNETANM", 0x4905},
+{"linux/isdn.h", "IIOCNETDNM", 0x4906},
+{"linux/isdn.h", "IIOCNETGNM", 0x4907},
+{"linux/isdn.h", "IIOCGETSET", 0x4908},
+{"linux/isdn.h", "IIOCSETSET", 0x4909},
+{"linux/isdn.h", "IIOCSETVER", 0x490a},
+{"linux/isdn.h", "IIOCNETHUP", 0x490b},
+{"linux/isdn.h", "IIOCSETGST", 0x490c},
+{"linux/isdn.h", "IIOCSETBRJ", 0x490d},
+{"linux/isdn.h", "IIOCSIGPRF", 0x490e},
+{"linux/isdn.h", "IIOCGETPRF", 0x490f},
+{"linux/isdn.h", "IIOCSETPRF", 0x4910},
+{"linux/isdn.h", "IIOCGETMAP", 0x4911},
+{"linux/isdn.h", "IIOCSETMAP", 0x4912},
+{"linux/isdn.h", "IIOCNETASL", 0x4913},
+{"linux/isdn.h", "IIOCNETDIL", 0x4914},
+{"linux/isdn.h", "IIOCGETCPS", 0x4915},
+{"linux/isdn.h", "IIOCNETALN", 0x4920},
+{"linux/isdn.h", "IIOCNETDLN", 0x4921},
+{"linux/isdn.h", "IIOCDBGVAR", 0x497f},
+{"linux/isdn.h", "IIOCDRVCTL", 0x4980},
+{"linux/kd.h", "KIOCSOUND", 0x4b2f},
+{"linux/kd.h", "KDMKTONE", 0x4b30},
+{"linux/kd.h", "KDGETLED", 0x4b31},
+{"linux/kd.h", "KDSETLED", 0x4b32},
+{"linux/kd.h", "KDGKBTYPE", 0x4b33},
+{"linux/kd.h", "KDADDIO", 0x4b34},
+{"linux/kd.h", "KDDELIO", 0x4b35},
+{"linux/kd.h", "KDENABIO", 0x4b36},
+{"linux/kd.h", "KDDISABIO", 0x4b37},
+{"linux/kd.h", "KDSETMODE", 0x4b3a},
+{"linux/kd.h", "KDGETMODE", 0x4b3b},
+{"linux/kd.h", "KDMAPDISP", 0x4b3c},
+{"linux/kd.h", "KDUNMAPDISP", 0x4b3d},
+{"linux/kd.h", "GIO_SCRNMAP", 0x4b40},
+{"linux/kd.h", "PIO_SCRNMAP", 0x4b41},
+{"linux/kd.h", "KDGKBMODE", 0x4b44},
+{"linux/kd.h", "KDSKBMODE", 0x4b45},
+{"linux/kd.h", "KDGKBENT", 0x4b46},
+{"linux/kd.h", "KDSKBENT", 0x4b47},
+{"linux/kd.h", "KDGKBSENT", 0x4b48},
+{"linux/kd.h", "KDSKBSENT", 0x4b49},
+{"linux/kd.h", "KDGKBDIACR", 0x4b4a},
+{"linux/kd.h", "KDSKBDIACR", 0x4b4b},
+{"linux/kd.h", "KDGETKEYCODE", 0x4b4c},
+{"linux/kd.h", "KDSETKEYCODE", 0x4b4d},
+{"linux/kd.h", "KDSIGACCEPT", 0x4b4e},
+{"linux/kd.h", "GIO_FONT", 0x4b60},
+{"linux/kd.h", "PIO_FONT", 0x4b61},
+{"linux/kd.h", "KDGKBMETA", 0x4b62},
+{"linux/kd.h", "KDSKBMETA", 0x4b63},
+{"linux/kd.h", "KDGKBLED", 0x4b64},
+{"linux/kd.h", "KDSKBLED", 0x4b65},
+{"linux/kd.h", "GIO_UNIMAP", 0x4b66},
+{"linux/kd.h", "PIO_UNIMAP", 0x4b67},
+{"linux/kd.h", "PIO_UNIMAPCLR", 0x4b68},
+{"linux/kd.h", "GIO_UNISCRNMAP", 0x4b69},
+{"linux/kd.h", "PIO_UNISCRNMAP", 0x4b6a},
+{"linux/kd.h", "GIO_FONTX", 0x4b6b},
+{"linux/kd.h", "PIO_FONTX", 0x4b6c},
+{"linux/kd.h", "PIO_FONTRESET", 0x4b6d},
+{"linux/kd.h", "GIO_CMAP", 0x4b70},
+{"linux/kd.h", "PIO_CMAP", 0x4b71},
+{"linux/loop.h", "LOOP_SET_FD", 0x4c00},
+{"linux/loop.h", "LOOP_CLR_FD", 0x4c01},
+{"linux/loop.h", "LOOP_SET_STATUS", 0x4c02},
+{"linux/loop.h", "LOOP_GET_STATUS", 0x4c03},
+{"linux/soundcard.h", "SNDCTL_DSP_RESET", 0x5000},
+{"linux/soundcard.h", "SNDCTL_DSP_SYNC", 0x5001},
+{"linux/soundcard.h", "SNDCTL_DSP_POST", 0x5008},
+{"linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", 0x500e},
+{"linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", 0x5015},
+{"linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", 0x5016},
+{"linux/soundcard.h", "SNDCTL_SEQ_RESET", 0x5100},
+{"linux/soundcard.h", "SNDCTL_SEQ_SYNC", 0x5101},
+{"linux/soundcard.h", "SNDCTL_SEQ_PANIC", 0x5111},
+{"linux/random.h", "RNDZAPENTCNT", 0x5204},
+{"linux/random.h", "RNDCLEARPOOL", 0x5206},
+{"linux/cdrom.h", "CDROMPAUSE", 0x5301},
+{"linux/cdrom.h", "CDROMRESUME", 0x5302},
+{"linux/cdrom.h", "CDROMPLAYMSF", 0x5303},
+{"linux/cdrom.h", "CDROMPLAYTRKIND", 0x5304},
+{"linux/cdrom.h", "CDROMREADTOCHDR", 0x5305},
+{"linux/cdrom.h", "CDROMREADTOCENTRY", 0x5306},
+{"linux/cdrom.h", "CDROMSTOP", 0x5307},
+{"linux/cdrom.h", "CDROMSTART", 0x5308},
+{"linux/cdrom.h", "CDROMEJECT", 0x5309},
+{"linux/cdrom.h", "CDROMVOLCTRL", 0x530a},
+{"linux/cdrom.h", "CDROMSUBCHNL", 0x530b},
+{"linux/cdrom.h", "CDROMREADMODE2", 0x530c},
+{"linux/cdrom.h", "CDROMREADMODE1", 0x530d},
+{"linux/cdrom.h", "CDROMREADAUDIO", 0x530e},
+{"linux/cdrom.h", "CDROMEJECT_SW", 0x530f},
+{"linux/cdrom.h", "CDROMMULTISESSION", 0x5310},
+{"linux/cdrom.h", "CDROM_GET_UPC", 0x5311},
+{"linux/cm206.h", "CDROM_GET_UPC", 0x5311},
+{"linux/cdrom.h", "CDROMRESET", 0x5312},
+{"linux/cm206.h", "CDROMRESET", 0x5312},
+{"linux/cdrom.h", "CDROMVOLREAD", 0x5313},
+{"linux/cdrom.h", "CDROMREADRAW", 0x5314},
+{"linux/cdrom.h", "CDROMREADCOOKED", 0x5315},
+{"linux/cdrom.h", "CDROMSEEK", 0x5316},
+{"linux/cdrom.h", "CDROMPLAYBLK", 0x5317},
+{"linux/cdrom.h", "CDROMREADALL", 0x5318},
+{"linux/cdrom.h", "CDROMCLOSETRAY", 0x5319},
+{"linux/cdrom.h", "CDROMLOADFROMSLOT", 0x531a},
+{"linux/ucdrom.h", "CDROM_SET_OPTIONS", 0x5320},
+{"linux/ucdrom.h", "CDROM_CLEAR_OPTIONS", 0x5321},
+{"linux/ucdrom.h", "CDROM_SELECT_SPEED", 0x5322},
+{"linux/ucdrom.h", "CDROM_SELECT_DISC", 0x5323},
+{"linux/ucdrom.h", "CDROM_MEDIA_CHANGED", 0x5325},
+{"linux/ucdrom.h", "CDROM_DRIVE_STATUS", 0x5326},
+{"linux/ucdrom.h", "CDROM_DISC_STATUS", 0x5327},
+{"linux/sbpcd.h", "CDROMAUDIOBUFSIZ", 0x5382},
+{"asm/ioctls.h", "TCGETS", 0x5401},
+{"asm/ioctls.h", "TCSETS", 0x5402},
+{"linux/soundcard.h", "SNDCTL_TMR_START", 0x5402},
+{"asm/ioctls.h", "TCSETSW", 0x5403},
+{"linux/soundcard.h", "SNDCTL_TMR_STOP", 0x5403},
+{"asm/ioctls.h", "TCSETSF", 0x5404},
+{"linux/soundcard.h", "SNDCTL_TMR_CONTINUE", 0x5404},
+{"asm/ioctls.h", "TCGETA", 0x5405},
+{"asm/ioctls.h", "TCSETA", 0x5406},
+{"asm/ioctls.h", "TCSETAW", 0x5407},
+{"asm/ioctls.h", "TCSETAF", 0x5408},
+{"asm/ioctls.h", "TCSBRK", 0x5409},
+{"asm/ioctls.h", "TCXONC", 0x540a},
+{"asm/ioctls.h", "TCFLSH", 0x540b},
+{"asm/ioctls.h", "TIOCEXCL", 0x540c},
+{"asm/ioctls.h", "TIOCNXCL", 0x540d},
+{"asm/ioctls.h", "TIOCSCTTY", 0x540e},
+{"asm/ioctls.h", "TIOCGPGRP", 0x540f},
+{"asm/ioctls.h", "TIOCSPGRP", 0x5410},
+{"asm/ioctls.h", "TIOCOUTQ", 0x5411},
+{"asm/ioctls.h", "TIOCSTI", 0x5412},
+{"asm/ioctls.h", "TIOCGWINSZ", 0x5413},
+{"asm/ioctls.h", "TIOCSWINSZ", 0x5414},
+{"asm/ioctls.h", "TIOCMGET", 0x5415},
+{"asm/ioctls.h", "TIOCMBIS", 0x5416},
+{"asm/ioctls.h", "TIOCMBIC", 0x5417},
+{"asm/ioctls.h", "TIOCMSET", 0x5418},
+{"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419},
+{"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a},
+{"asm/ioctls.h", "FIONREAD", 0x541b},
+{"asm/ioctls.h", "TIOCLINUX", 0x541c},
+{"asm/ioctls.h", "TIOCCONS", 0x541d},
+{"asm/ioctls.h", "TIOCGSERIAL", 0x541e},
+{"asm/ioctls.h", "TIOCSSERIAL", 0x541f},
+{"asm/ioctls.h", "TIOCPKT", 0x5420},
+{"asm/ioctls.h", "FIONBIO", 0x5421},
+{"asm/ioctls.h", "TIOCNOTTY", 0x5422},
+{"asm/ioctls.h", "TIOCSETD", 0x5423},
+{"asm/ioctls.h", "TIOCGETD", 0x5424},
+{"asm/ioctls.h", "TCSBRKP", 0x5425},
+{"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426},
+{"asm/ioctls.h", "FIONCLEX", 0x5450},
+{"asm/ioctls.h", "FIOCLEX", 0x5451},
+{"asm/ioctls.h", "FIOASYNC", 0x5452},
+{"asm/ioctls.h", "TIOCSERCONFIG", 0x5453},
+{"asm/ioctls.h", "TIOCSERGWILD", 0x5454},
+{"asm/ioctls.h", "TIOCSERSWILD", 0x5455},
+{"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456},
+{"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457},
+{"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458},
+{"asm/ioctls.h", "TIOCSERGETLSR", 0x5459},
+{"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a},
+{"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b},
+{"asm/ioctls.h", "TIOCMIWAIT", 0x545c},
+{"asm/ioctls.h", "TIOCGICOUNT", 0x545d},
+{"linux/vt.h", "VT_OPENQRY", 0x5600},
+{"linux/vt.h", "VT_GETMODE", 0x5601},
+{"linux/vt.h", "VT_SETMODE", 0x5602},
+{"linux/vt.h", "VT_GETSTATE", 0x5603},
+{"linux/vt.h", "VT_SENDSIG", 0x5604},
+{"linux/vt.h", "VT_RELDISP", 0x5605},
+{"linux/vt.h", "VT_ACTIVATE", 0x5606},
+{"linux/vt.h", "VT_WAITACTIVE", 0x5607},
+{"linux/vt.h", "VT_DISALLOCATE", 0x5608},
+{"linux/vt.h", "VT_RESIZE", 0x5609},
+{"linux/vt.h", "VT_RESIZEX", 0x560a},
+{"linux/vt.h", "VT_LOCKSWITCH", 0x560b},
+{"linux/vt.h", "VT_UNLOCKSWITCH", 0x560c},
+{"linux/comstats.h", "COM_GETPORTSTATS", 0x631e},
+{"linux/comstats.h", "COM_CLRPORTSTATS", 0x631f},
+{"linux/comstats.h", "COM_GETBRDSTATS", 0x6320},
+{"linux/comstats.h", "COM_READPORT", 0x6328},
+{"linux/comstats.h", "COM_READBOARD", 0x6329},
+{"linux/comstats.h", "COM_READPANEL", 0x632a},
+{"linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", 0x6e03},
+{"linux/cdk.h", "STL_BINTR", 0x7314},
+{"linux/cdk.h", "STL_BSTART", 0x7315},
+{"linux/cdk.h", "STL_BSTOP", 0x7316},
+{"linux/cdk.h", "STL_BRESET", 0x7317},
+{"linux/cdk.h", "STL_GETPFLAG", 0x7350},
+{"linux/cdk.h", "STL_SETPFLAG", 0x7351},
+{"linux/if_ppp.h", "PPPIOCXFERUNIT", 0x744e},
+{"asm/sockios.h", "FIOSETOWN", 0x8901},
+{"asm/sockios.h", "SIOCSPGRP", 0x8902},
+{"asm/sockios.h", "FIOGETOWN", 0x8903},
+{"asm/sockios.h", "SIOCGPGRP", 0x8904},
+{"asm/sockios.h", "SIOCATMARK", 0x8905},
+{"asm/sockios.h", "SIOCGSTAMP", 0x8906},
+{"linux/sockios.h", "SIOCADDRT", 0x890b},
+{"linux/sockios.h", "SIOCDELRT", 0x890c},
+{"linux/sockios.h", "SIOCGIFNAME", 0x8910},
+{"linux/sockios.h", "SIOCSIFLINK", 0x8911},
+{"linux/sockios.h", "SIOCGIFCONF", 0x8912},
+{"linux/sockios.h", "SIOCGIFFLAGS", 0x8913},
+{"linux/sockios.h", "SIOCSIFFLAGS", 0x8914},
+{"linux/sockios.h", "SIOCGIFADDR", 0x8915},
+{"linux/sockios.h", "SIOCSIFADDR", 0x8916},
+{"linux/sockios.h", "SIOCGIFDSTADDR", 0x8917},
+{"linux/sockios.h", "SIOCSIFDSTADDR", 0x8918},
+{"linux/sockios.h", "SIOCGIFBRDADDR", 0x8919},
+{"linux/sockios.h", "SIOCSIFBRDADDR", 0x891a},
+{"linux/sockios.h", "SIOCGIFNETMASK", 0x891b},
+{"linux/sockios.h", "SIOCSIFNETMASK", 0x891c},
+{"linux/sockios.h", "SIOCGIFMETRIC", 0x891d},
+{"linux/sockios.h", "SIOCSIFMETRIC", 0x891e},
+{"linux/sockios.h", "SIOCGIFMEM", 0x891f},
+{"linux/sockios.h", "SIOCSIFMEM", 0x8920},
+{"linux/sockios.h", "SIOCGIFMTU", 0x8921},
+{"linux/sockios.h", "SIOCSIFMTU", 0x8922},
+{"linux/sockios.h", "SIOCSIFHWADDR", 0x8924},
+{"linux/sockios.h", "SIOCGIFENCAP", 0x8925},
+{"linux/sockios.h", "SIOCSIFENCAP", 0x8926},
+{"linux/sockios.h", "SIOCGIFHWADDR", 0x8927},
+{"linux/sockios.h", "SIOCGIFSLAVE", 0x8929},
+{"linux/sockios.h", "SIOCSIFSLAVE", 0x8930},
+{"linux/sockios.h", "SIOCADDMULTI", 0x8931},
+{"linux/sockios.h", "SIOCDELMULTI", 0x8932},
+{"linux/sockios.h", "SIOCGIFBR", 0x8940},
+{"linux/sockios.h", "SIOCSIFBR", 0x8941},
+{"linux/sockios.h", "OLD_SIOCDARP", 0x8950},
+{"linux/sockios.h", "OLD_SIOCGARP", 0x8951},
+{"linux/sockios.h", "OLD_SIOCSARP", 0x8952},
+{"linux/sockios.h", "SIOCDARP", 0x8953},
+{"linux/sockios.h", "SIOCGARP", 0x8954},
+{"linux/sockios.h", "SIOCSARP", 0x8955},
+{"linux/sockios.h", "SIOCDRARP", 0x8960},
+{"linux/sockios.h", "SIOCGRARP", 0x8961},
+{"linux/sockios.h", "SIOCSRARP", 0x8962},
+{"linux/sockios.h", "SIOCGIFMAP", 0x8970},
+{"linux/sockios.h", "SIOCSIFMAP", 0x8971},
+{"linux/sockios.h", "SIOCADDDLCI", 0x8980},
+{"linux/sockios.h", "SIOCDELDLCI", 0x8981},
+{"linux/sockios.h", "SIOCPROTOPRIVATE", 0x89e0},
+{"linux/sockios.h", "SIOCDEVPRIVATE", 0x89f0},
+{"linux/sbpcd.h", "DDIOCSDBG", 0x9000},
+{"linux/cyclades.h", "CYGETMON", 0x435901},
+{"linux/cyclades.h", "CYGETTHRESH", 0x435902},
+{"linux/cyclades.h", "CYSETTHRESH", 0x435903},
+{"linux/cyclades.h", "CYGETDEFTHRESH", 0x435904},
+{"linux/cyclades.h", "CYSETDEFTHRESH", 0x435905},
+{"linux/cyclades.h", "CYGETTIMEOUT", 0x435906},
+{"linux/cyclades.h", "CYSETTIMEOUT", 0x435907},
+{"linux/cyclades.h", "CYGETDEFTIMEOUT", 0x435908},
+{"linux/cyclades.h", "CYSETDEFTIMEOUT", 0x435909},
+{"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", 0x40026e02},
+{"linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", 0x40045010},
+{"linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", 0x40045106},
+{"linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", 0x40045108},
+{"linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", 0x40045109},
+{"linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", 0x4004510d},
+{"linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", 0x4004510f},
+{"linux/random.h", "RNDADDTOENTCNT", 0x40045201},
+{"linux/soundcard.h", "SNDCTL_TMR_METRONOME", 0x40045407},
+{"linux/soundcard.h", "SNDCTL_TMR_SELECT", 0x40045408},
+{"linux/ext2_fs.h", "EXT2_IOC_SETFLAGS", 0x40046602},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", 0x40047202},
+{"linux/if_ppp.h", "PPPIOCSDEBUG", 0x40047440},
+{"linux/if_ppp.h", "PPPIOCSMAXCID", 0x40047451},
+{"linux/if_ppp.h", "PPPIOCSMRU", 0x40047452},
+{"linux/if_ppp.h", "PPPIOCSRASYNCMAP", 0x40047454},
+{"linux/if_ppp.h", "PPPIOCSASYNCMAP", 0x40047457},
+{"linux/if_ppp.h", "PPPIOCSFLAGS", 0x40047459},
+{"linux/isdn_ppp.h", "PPPIOCBUNDLE", 0x40047481},
+{"linux/isdn_ppp.h", "PPPIOCSMPFLAGS", 0x40047483},
+{"linux/isdn_ppp.h", "PPPIOCSMPMTU", 0x40047484},
+{"linux/isdn_ppp.h", "PPPIOCSMPMRU", 0x40047485},
+{"linux/ext2_fs.h", "EXT2_IOC_SETVERSION", 0x40047602},
+{"linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", 0x40085112},
+{"linux/random.h", "RNDADDENTROPY", 0x40085203},
+{"linux/mtio.h", "MTIOCTOP", 0x40086d01},
+{"linux/if_ppp.h", "PPPIOCSNPMODE", 0x4008744b},
+{"linux/fd.h", "FDFMTTRK", 0x400c0248},
+{"linux/if_ppp.h", "PPPIOCSCOMPRESS", 0x400c744d},
+{"linux/fd.h", "FDSETMAXERRS", 0x4014024c},
+{"linux/soundcard.h", "SNDCTL_COPR_WDATA", 0x40144304},
+{"linux/soundcard.h", "SNDCTL_COPR_WCODE", 0x40144305},
+{"linux/fd.h", "FDSETPRM", 0x401c0242},
+{"linux/fd.h", "FDDEFPRM", 0x401c0243},
+{"linux/if_ppp.h", "PPPIOCSXASYNCMAP", 0x4020744f},
+{"linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", 0x40285107},
+{"linux/fd.h", "FDSETDRVPRM", 0x40580290},
+{"linux/soundcard.h", "SNDCTL_COPR_SENDMSG", 0x4fa44308},
+{"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID", 0x80027501},
+{"linux/soundcard.h", "SOUND_MIXER_READ_VOLUME", 0x80044d00},
+{"linux/soundcard.h", "SOUND_MIXER_READ_BASS", 0x80044d01},
+{"linux/soundcard.h", "SOUND_MIXER_READ_TREBLE", 0x80044d02},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SYNTH", 0x80044d03},
+{"linux/soundcard.h", "SOUND_MIXER_READ_PCM", 0x80044d04},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SPEAKER", 0x80044d05},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE", 0x80044d06},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MIC", 0x80044d07},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CD", 0x80044d08},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IMIX", 0x80044d09},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ALTPCM", 0x80044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECLEV", 0x80044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IGAIN", 0x80044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_OGAIN", 0x80044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE1", 0x80044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE2", 0x80044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE3", 0x80044d10},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MUTE", 0x80044d1c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ENHANCE", 0x80044d1d},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LOUD", 0x80044d1e},
+{"linux/soundcard.h", "SOUND_MIXER_READ_STEREODEVS", 0x80044dfb},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CAPS", 0x80044dfc},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECMASK", 0x80044dfd},
+{"linux/soundcard.h", "SOUND_MIXER_READ_DEVMASK", 0x80044dfe},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECSRC", 0x80044dff},
+{"linux/soundcard.h", "SOUND_PCM_READ_RATE", 0x80045002},
+{"linux/soundcard.h", "SOUND_PCM_READ_BITS", 0x80045005},
+{"linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", 0x80045006},
+{"linux/soundcard.h", "SOUND_PCM_READ_FILTER", 0x80045007},
+{"linux/soundcard.h", "SNDCTL_DSP_GETFMTS", 0x8004500b},
+{"linux/soundcard.h", "SNDCTL_DSP_GETCAPS", 0x8004500f},
+{"linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", 0x80045010},
+{"linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", 0x80045104},
+{"linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", 0x80045105},
+{"linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", 0x8004510a},
+{"linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", 0x8004510b},
+{"linux/random.h", "RNDGETENTCNT", 0x80045200},
+{"linux/ext2_fs.h", "EXT2_IOC_GETFLAGS", 0x80046601},
+{"linux/mtio.h", "MTIOCPOS", 0x80046d03},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", 0x80047201},
+{"linux/if_ppp.h", "PPPIOCGDEBUG", 0x80047441},
+{"linux/if_ppp.h", "PPPIOCGMRU", 0x80047453},
+{"linux/if_ppp.h", "PPPIOCGRASYNCMAP", 0x80047455},
+{"linux/if_ppp.h", "PPPIOCGUNIT", 0x80047456},
+{"linux/if_ppp.h", "PPPIOCGASYNCMAP", 0x80047458},
+{"linux/if_ppp.h", "PPPIOCGFLAGS", 0x8004745a},
+{"linux/isdn_ppp.h", "PPPIOCGMPFLAGS", 0x80047482},
+{"linux/ext2_fs.h", "EXT2_IOC_GETVERSION", 0x80047601},
+{"linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", 0x80085013},
+{"linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", 0x80085014},
+{"linux/random.h", "RNDGETPOOL", 0x80085202},
+{"linux/if_ppp.h", "PPPIOCGIDLE", 0x8008743f},
+{"linux/soundcard.h", "SNDCTL_DSP_GETIPTR", 0x800c5011},
+{"linux/soundcard.h", "SNDCTL_DSP_GETOPTR", 0x800c5012},
+{"linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", 0x800c6e01},
+{"linux/fd.h", "FDGETDRVTYP", 0x8010020f},
+{"linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", 0x8010500c},
+{"linux/soundcard.h", "SNDCTL_DSP_GETISPACE", 0x8010500d},
+{"linux/fd.h", "FDGETMAXERRS", 0x8014020e},
+{"linux/fd.h", "FDWERRORGET", 0x80180217},
+{"linux/fd.h", "FDGETPRM", 0x801c0204},
+{"linux/mtio.h", "MTIOCGET", 0x801c6d02},
+{"linux/fd.h", "FDGETFDCSTAT", 0x80200215},
+{"linux/if_ppp.h", "PPPIOCGXASYNCMAP", 0x80207450},
+{"linux/fd.h", "FDGETDRVSTAT", 0x80340212},
+{"linux/fd.h", "FDPOLLDRVSTAT", 0x80340213},
+{"linux/fd.h", "FDGETDRVPRM", 0x80580211},
+{"linux/soundcard.h", "SNDCTL_COPR_RCVMSG", 0x8fa44309},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_VOLUME", 0xc0044d00},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_BASS", 0xc0044d01},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_TREBLE", 0xc0044d02},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SYNTH", 0xc0044d03},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_PCM", 0xc0044d04},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SPEAKER", 0xc0044d05},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE", 0xc0044d06},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MIC", 0xc0044d07},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_CD", 0xc0044d08},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IMIX", 0xc0044d09},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ALTPCM", 0xc0044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECLEV", 0xc0044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IGAIN", 0xc0044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_OGAIN", 0xc0044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE1", 0xc0044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE2", 0xc0044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE3", 0xc0044d10},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MUTE", 0xc0044d1c},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ENHANCE", 0xc0044d1d},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LOUD", 0xc0044d1e},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECSRC", 0xc0044dff},
+{"linux/soundcard.h", "SNDCTL_DSP_SPEED", 0xc0045002},
+{"linux/soundcard.h", "SNDCTL_DSP_STEREO", 0xc0045003},
+{"linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", 0xc0045004},
+{"linux/soundcard.h", "SNDCTL_DSP_SETFMT", 0xc0045005},
+{"linux/soundcard.h", "SOUND_PCM_WRITE_CHANNELS", 0xc0045006},
+{"linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", 0xc0045007},
+{"linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", 0xc0045009},
+{"linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", 0xc004500a},
+{"linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", 0xc0045103},
+{"linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", 0xc004510e},
+{"linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", 0xc0045401},
+{"linux/soundcard.h", "SNDCTL_TMR_TEMPO", 0xc0045405},
+{"linux/soundcard.h", "SNDCTL_TMR_SOURCE", 0xc0045406},
+{"linux/soundcard.h", "SNDCTL_MIDI_PRETIME", 0xc0046d00},
+{"linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", 0xc0046d01},
+{"linux/if_ppp.h", "PPPIOCGNPMODE", 0xc008744c},
+{"linux/soundcard.h", "SNDCTL_COPR_RDATA", 0xc0144302},
+{"linux/soundcard.h", "SNDCTL_COPR_RCODE", 0xc0144303},
+{"linux/soundcard.h", "SNDCTL_COPR_RUN", 0xc0144306},
+{"linux/soundcard.h", "SNDCTL_COPR_HALT", 0xc0144307},
+{"linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", 0xc0216d02},
+{"linux/isdn_ppp.h", "PPPIOCLINKINFO", 0xc0247480},
+{"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", 0xc0286e04},
+{"linux/soundcard.h", "SNDCTL_MIDI_INFO", 0xc074510c},
+{"linux/soundcard.h", "SNDCTL_SYNTH_INFO", 0xc08c5102},
+{"linux/soundcard.h", "SNDCTL_COPR_LOAD", 0xcfb04301},
+{"linux/soundcard.h", "SNDCTL_PMGR_IFACE", 0xcfb85001},
+{"linux/soundcard.h", "SNDCTL_PMGR_ACCESS", 0xcfb85110},
diff --git a/linux/ioctlent.sh b/linux/ioctlent.sh
new file mode 100644
index 000000000..dd5fd9da8
--- /dev/null
+++ b/linux/ioctlent.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+# All rights reserved.
+#
+# Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+# Files to find.
+file_find='asm/*.h linux/*.h scsi/*.h'
+
+# Files to stop.
+file_stop='asm/byteorder.h linux/config.h linux/pci.h linux/xd.h'
+
+# Defs to find.
+# Work on the kernel source to convert all to df_iowr.
+# Don't know how to find low-numbered ioctls in linux/mc146818rtc.h.
+df_name='^[ ]*#[ ]*define[ ]+[A-Z_][A-Z0-9_]*[ ]+'
+df_iowr='_IO|_IOR|_IOW|_IOWR'
+df_NNNN='0[Xx](03|06|22|46|4B|4C|53|54|56|89|90)[0-9A-Fa-f][0-9A-Fa-f]'
+df_4359='0[Xx]4359[0-9A-Fa-f][0-9A-Fa-f]' # linux/cyclades.h
+df_470N='470[0-9]' # linux/fs.h (only in 1.2.13)
+df_smix='MIXER_READ|MIXER_WRITE' # linux/soundcard.h
+df_12NN='12[3-4][0-9]' # linux/umsdos_fs.h (only in 1.2.13)
+df_tail='([() ]|$)'
+def_find="$df_name($df_iowr|$df_NNNN|$df_4359|$df_470N|$df_smix|$df_12NN)$df_tail"
+
+# Defs to stop.
+ds_tail='_MAGIC|_PATCH'
+ds_fdmp='FD(DEF|GET|SET)MEDIAPRM' # linux/fd.h aliases (only in 1.2.13)
+ds_mtio='MTIOC(GET|SET)CONFIG' # linux/mtio.h needs config (only in 1.2.13)
+def_stop="$ds_tail|$ds_fdmp|$ds_mtio"
+
+# Validate arg count.
+if [ $# -ne 1 ]
+then
+ echo "usage: $0 include-directory" >&2
+ exit 1
+fi
+
+# Grep through the files.
+(
+ # Construct list: find files minus stop files.
+ cd $1 || exit
+ file_list=`(ls $file_find $file_stop $file_stop 2>/dev/null) | sort | uniq -u`
+
+ # Grep matching #define lines.
+ # Transform to C structure form.
+ # Filter out stop list.
+ egrep "$def_find" $file_list |
+ sed -n -e 's/^\(.*\):#[ ]*define[ ]*\([A-Z_][A-Z0-9_]*\).*$/ { "\1", "\2", \2 },/p' |
+ egrep -v "$def_stop"
+) > ioctlent.tmp
+
+# Generate the output file.
+echo '/* This file is automatically generated by ioctlent.sh */'
+echo
+echo '#include <sys/types.h>'
+echo
+echo '/* Needed for <linux/baycom.h> */'
+echo '#define BAYCOM_DEBUG'
+echo
+echo '/* Needed for <linux/cyclades.h> */'
+echo '#include <linux/termios.h>'
+echo '#include <linux/tqueue.h>'
+echo
+awk '{ print "#include <" substr($2, 2, length($2) - 3) ">" }' ioctlent.tmp | sort -u
+echo
+echo 'struct ioctlent ioctlent [] ='
+echo '{'
+cat ioctlent.tmp
+echo '};'
+
+# Clean up.
+rm -f ioctlent.tmp
diff --git a/linux/powerpc/Makefile.in b/linux/powerpc/Makefile.in
new file mode 100644
index 000000000..4c5344df8
--- /dev/null
+++ b/linux/powerpc/Makefile.in
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+CC = @CC@
+CPP = @CPP@
+SHELL = /bin/sh
+
+DEFS = @DEFS@
+LDLIBS = @LIBS@
+
+CFLAGS = -g
+LDFLAGS = -g
+WARNFLAGS = @WARNFLAGS@
+
+CPPFLAGS =
+INCLUDES = -I. -I.. -I$(srcdir)/.. -I../.. -I$(srcdir)
+
+includedir = @includedir@
+
+all: ioctlent.h errnoent.h signalent.h syscallent.h
+
+ioctlent.raw: ioctlent.sh
+ $(SHELL) $(srcdir)/ioctlent.sh $(includedir) >$@
+
+ioctlent.h: ioctlent.raw ioctlsort
+ ./ioctlsort >$@
+
+ioctlsort: ioctlsort.o
+ $(CC) $(LDFLAGS) ioctlsort.o -o ioctlsort
+
+ioctlsort.o: ../../ioctlsort.c
+ $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $(srcdir)/../../ioctlsort.c
+
+ioctlsort.o: ioctlent.raw
+
+errnoent.h: ../../errnoent.sh $(includedir)/asm/errno.h
+ $(SHELL) $(srcdir)/../../errnoent.sh $(includedir)/asm/errno.h >$@
+
+signalent.h: ../../signalent.sh $(includedir)/asm/signal.h
+ $(SHELL) $(srcdir)/../../signalent.sh $(includedir)/asm/signal.h >$@
+
+#syscallent.h: ../../syscallent.sh $(includedir)/sys/syscall.h
+syscallent.h:
+ $(SHELL) $(srcdir)/../../syscallent.sh $(includedir)/sys/syscall.h >$@
+
+clean:
+ rm -f ioctlent.c *.raw *.tmp *.o ioctlsort
+
+distclean: clean
+ rm -f Makefile
+
+maintainer-clean: distclean
+ rm -f ioctlent.h errnoent.h signalent.h
diff --git a/linux/powerpc/errnoent.h b/linux/powerpc/errnoent.h
new file mode 100644
index 000000000..9aaa18166
--- /dev/null
+++ b/linux/powerpc/errnoent.h
@@ -0,0 +1,516 @@
+ "ERRNO_0", /* 0 */
+ "EPERM", /* 1 */
+ "ENOENT", /* 2 */
+ "ESRCH", /* 3 */
+ "EINTR", /* 4 */
+ "EIO", /* 5 */
+ "ENXIO", /* 6 */
+ "E2BIG", /* 7 */
+ "ENOEXEC", /* 8 */
+ "EBADF", /* 9 */
+ "ECHILD", /* 10 */
+ "EAGAIN", /* 11 */
+ "ENOMEM", /* 12 */
+ "EACCES", /* 13 */
+ "EFAULT", /* 14 */
+ "ENOTBLK", /* 15 */
+ "EBUSY", /* 16 */
+ "EEXIST", /* 17 */
+ "EXDEV", /* 18 */
+ "ENODEV", /* 19 */
+ "ENOTDIR", /* 20 */
+ "EISDIR", /* 21 */
+ "EINVAL", /* 22 */
+ "ENFILE", /* 23 */
+ "EMFILE", /* 24 */
+ "ENOTTY", /* 25 */
+ "ETXTBSY", /* 26 */
+ "EFBIG", /* 27 */
+ "ENOSPC", /* 28 */
+ "ESPIPE", /* 29 */
+ "EROFS", /* 30 */
+ "EMLINK", /* 31 */
+ "EPIPE", /* 32 */
+ "EDOM", /* 33 */
+ "ERANGE", /* 34 */
+ "EDEADLK", /* 35 */
+ "ENAMETOOLONG", /* 36 */
+ "ENOLCK", /* 37 */
+ "ENOSYS", /* 38 */
+ "ENOTEMPTY", /* 39 */
+ "ELOOP", /* 40 */
+ "ERRNO_41", /* 41 */
+ "ENOMSG", /* 42 */
+ "EIDRM", /* 43 */
+ "ECHRNG", /* 44 */
+ "EL2NSYNC", /* 45 */
+ "EL3HLT", /* 46 */
+ "EL3RST", /* 47 */
+ "ELNRNG", /* 48 */
+ "EUNATCH", /* 49 */
+ "ENOCSI", /* 50 */
+ "EL2HLT", /* 51 */
+ "EBADE", /* 52 */
+ "EBADR", /* 53 */
+ "EXFULL", /* 54 */
+ "ENOANO", /* 55 */
+ "EBADRQC", /* 56 */
+ "EBADSLT", /* 57 */
+ "EDEADLOCK", /* 58 */
+ "EBFONT", /* 59 */
+ "ENOSTR", /* 60 */
+ "ENODATA", /* 61 */
+ "ETIME", /* 62 */
+ "ENOSR", /* 63 */
+ "ENONET", /* 64 */
+ "ENOPKG", /* 65 */
+ "EREMOTE", /* 66 */
+ "ENOLINK", /* 67 */
+ "EADV", /* 68 */
+ "ESRMNT", /* 69 */
+ "ECOMM", /* 70 */
+ "EPROTO", /* 71 */
+ "EMULTIHOP", /* 72 */
+ "EDOTDOT", /* 73 */
+ "EBADMSG", /* 74 */
+ "EOVERFLOW", /* 75 */
+ "ENOTUNIQ", /* 76 */
+ "EBADFD", /* 77 */
+ "EREMCHG", /* 78 */
+ "ELIBACC", /* 79 */
+ "ELIBBAD", /* 80 */
+ "ELIBSCN", /* 81 */
+ "ELIBMAX", /* 82 */
+ "ELIBEXEC", /* 83 */
+ "EILSEQ", /* 84 */
+ "ERESTART", /* 85 */
+ "ESTRPIPE", /* 86 */
+ "EUSERS", /* 87 */
+ "ENOTSOCK", /* 88 */
+ "EDESTADDRREQ", /* 89 */
+ "EMSGSIZE", /* 90 */
+ "EPROTOTYPE", /* 91 */
+ "ENOPROTOOPT", /* 92 */
+ "EPROTONOSUPPORT", /* 93 */
+ "ESOCKTNOSUPPORT", /* 94 */
+ "EOPNOTSUPP", /* 95 */
+ "EPFNOSUPPORT", /* 96 */
+ "EAFNOSUPPORT", /* 97 */
+ "EADDRINUSE", /* 98 */
+ "EADDRNOTAVAIL", /* 99 */
+ "ENETDOWN", /* 100 */
+ "ENETUNREACH", /* 101 */
+ "ENETRESET", /* 102 */
+ "ECONNABORTED", /* 103 */
+ "ECONNRESET", /* 104 */
+ "ENOBUFS", /* 105 */
+ "EISCONN", /* 106 */
+ "ENOTCONN", /* 107 */
+ "ESHUTDOWN", /* 108 */
+ "ETOOMANYREFS", /* 109 */
+ "ETIMEDOUT", /* 110 */
+ "ECONNREFUSED", /* 111 */
+ "EHOSTDOWN", /* 112 */
+ "EHOSTUNREACH", /* 113 */
+ "EALREADY", /* 114 */
+ "EINPROGRESS", /* 115 */
+ "ESTALE", /* 116 */
+ "EUCLEAN", /* 117 */
+ "ENOTNAM", /* 118 */
+ "ENAVAIL", /* 119 */
+ "EISNAM", /* 120 */
+ "EREMOTEIO", /* 121 */
+ "EDQUOT", /* 122 */
+ "ENOMEDIUM", /* 123 */
+ "EMEDIUMTYPE", /* 124 */
+ "ERRNO_125", /* 125 */
+ "ERRNO_126", /* 126 */
+ "ERRNO_127", /* 127 */
+ "ERRNO_128", /* 128 */
+ "ERRNO_129", /* 129 */
+ "ERRNO_130", /* 130 */
+ "ERRNO_131", /* 131 */
+ "ERRNO_132", /* 132 */
+ "ERRNO_133", /* 133 */
+ "ERRNO_134", /* 134 */
+ "ERRNO_135", /* 135 */
+ "ERRNO_136", /* 136 */
+ "ERRNO_137", /* 137 */
+ "ERRNO_138", /* 138 */
+ "ERRNO_139", /* 139 */
+ "ERRNO_140", /* 140 */
+ "ERRNO_141", /* 141 */
+ "ERRNO_142", /* 142 */
+ "ERRNO_143", /* 143 */
+ "ERRNO_144", /* 144 */
+ "ERRNO_145", /* 145 */
+ "ERRNO_146", /* 146 */
+ "ERRNO_147", /* 147 */
+ "ERRNO_148", /* 148 */
+ "ERRNO_149", /* 149 */
+ "ERRNO_150", /* 150 */
+ "ERRNO_151", /* 151 */
+ "ERRNO_152", /* 152 */
+ "ERRNO_153", /* 153 */
+ "ERRNO_154", /* 154 */
+ "ERRNO_155", /* 155 */
+ "ERRNO_156", /* 156 */
+ "ERRNO_157", /* 157 */
+ "ERRNO_158", /* 158 */
+ "ERRNO_159", /* 159 */
+ "ERRNO_160", /* 160 */
+ "ERRNO_161", /* 161 */
+ "ERRNO_162", /* 162 */
+ "ERRNO_163", /* 163 */
+ "ERRNO_164", /* 164 */
+ "ERRNO_165", /* 165 */
+ "ERRNO_166", /* 166 */
+ "ERRNO_167", /* 167 */
+ "ERRNO_168", /* 168 */
+ "ERRNO_169", /* 169 */
+ "ERRNO_170", /* 170 */
+ "ERRNO_171", /* 171 */
+ "ERRNO_172", /* 172 */
+ "ERRNO_173", /* 173 */
+ "ERRNO_174", /* 174 */
+ "ERRNO_175", /* 175 */
+ "ERRNO_176", /* 176 */
+ "ERRNO_177", /* 177 */
+ "ERRNO_178", /* 178 */
+ "ERRNO_179", /* 179 */
+ "ERRNO_180", /* 180 */
+ "ERRNO_181", /* 181 */
+ "ERRNO_182", /* 182 */
+ "ERRNO_183", /* 183 */
+ "ERRNO_184", /* 184 */
+ "ERRNO_185", /* 185 */
+ "ERRNO_186", /* 186 */
+ "ERRNO_187", /* 187 */
+ "ERRNO_188", /* 188 */
+ "ERRNO_189", /* 189 */
+ "ERRNO_190", /* 190 */
+ "ERRNO_191", /* 191 */
+ "ERRNO_192", /* 192 */
+ "ERRNO_193", /* 193 */
+ "ERRNO_194", /* 194 */
+ "ERRNO_195", /* 195 */
+ "ERRNO_196", /* 196 */
+ "ERRNO_197", /* 197 */
+ "ERRNO_198", /* 198 */
+ "ERRNO_199", /* 199 */
+ "ERRNO_200", /* 200 */
+ "ERRNO_201", /* 201 */
+ "ERRNO_202", /* 202 */
+ "ERRNO_203", /* 203 */
+ "ERRNO_204", /* 204 */
+ "ERRNO_205", /* 205 */
+ "ERRNO_206", /* 206 */
+ "ERRNO_207", /* 207 */
+ "ERRNO_208", /* 208 */
+ "ERRNO_209", /* 209 */
+ "ERRNO_210", /* 210 */
+ "ERRNO_211", /* 211 */
+ "ERRNO_212", /* 212 */
+ "ERRNO_213", /* 213 */
+ "ERRNO_214", /* 214 */
+ "ERRNO_215", /* 215 */
+ "ERRNO_216", /* 216 */
+ "ERRNO_217", /* 217 */
+ "ERRNO_218", /* 218 */
+ "ERRNO_219", /* 219 */
+ "ERRNO_220", /* 220 */
+ "ERRNO_221", /* 221 */
+ "ERRNO_222", /* 222 */
+ "ERRNO_223", /* 223 */
+ "ERRNO_224", /* 224 */
+ "ERRNO_225", /* 225 */
+ "ERRNO_226", /* 226 */
+ "ERRNO_227", /* 227 */
+ "ERRNO_228", /* 228 */
+ "ERRNO_229", /* 229 */
+ "ERRNO_230", /* 230 */
+ "ERRNO_231", /* 231 */
+ "ERRNO_232", /* 232 */
+ "ERRNO_233", /* 233 */
+ "ERRNO_234", /* 234 */
+ "ERRNO_235", /* 235 */
+ "ERRNO_236", /* 236 */
+ "ERRNO_237", /* 237 */
+ "ERRNO_238", /* 238 */
+ "ERRNO_239", /* 239 */
+ "ERRNO_240", /* 240 */
+ "ERRNO_241", /* 241 */
+ "ERRNO_242", /* 242 */
+ "ERRNO_243", /* 243 */
+ "ERRNO_244", /* 244 */
+ "ERRNO_245", /* 245 */
+ "ERRNO_246", /* 246 */
+ "ERRNO_247", /* 247 */
+ "ERRNO_248", /* 248 */
+ "ERRNO_249", /* 249 */
+ "ERRNO_250", /* 250 */
+ "ERRNO_251", /* 251 */
+ "ERRNO_252", /* 252 */
+ "ERRNO_253", /* 253 */
+ "ERRNO_254", /* 254 */
+ "ERRNO_255", /* 255 */
+ "ERRNO_256", /* 256 */
+ "ERRNO_257", /* 257 */
+ "ERRNO_258", /* 258 */
+ "ERRNO_259", /* 259 */
+ "ERRNO_260", /* 260 */
+ "ERRNO_261", /* 261 */
+ "ERRNO_262", /* 262 */
+ "ERRNO_263", /* 263 */
+ "ERRNO_264", /* 264 */
+ "ERRNO_265", /* 265 */
+ "ERRNO_266", /* 266 */
+ "ERRNO_267", /* 267 */
+ "ERRNO_268", /* 268 */
+ "ERRNO_269", /* 269 */
+ "ERRNO_270", /* 270 */
+ "ERRNO_271", /* 271 */
+ "ERRNO_272", /* 272 */
+ "ERRNO_273", /* 273 */
+ "ERRNO_274", /* 274 */
+ "ERRNO_275", /* 275 */
+ "ERRNO_276", /* 276 */
+ "ERRNO_277", /* 277 */
+ "ERRNO_278", /* 278 */
+ "ERRNO_279", /* 279 */
+ "ERRNO_280", /* 280 */
+ "ERRNO_281", /* 281 */
+ "ERRNO_282", /* 282 */
+ "ERRNO_283", /* 283 */
+ "ERRNO_284", /* 284 */
+ "ERRNO_285", /* 285 */
+ "ERRNO_286", /* 286 */
+ "ERRNO_287", /* 287 */
+ "ERRNO_288", /* 288 */
+ "ERRNO_289", /* 289 */
+ "ERRNO_290", /* 290 */
+ "ERRNO_291", /* 291 */
+ "ERRNO_292", /* 292 */
+ "ERRNO_293", /* 293 */
+ "ERRNO_294", /* 294 */
+ "ERRNO_295", /* 295 */
+ "ERRNO_296", /* 296 */
+ "ERRNO_297", /* 297 */
+ "ERRNO_298", /* 298 */
+ "ERRNO_299", /* 299 */
+ "ERRNO_300", /* 300 */
+ "ERRNO_301", /* 301 */
+ "ERRNO_302", /* 302 */
+ "ERRNO_303", /* 303 */
+ "ERRNO_304", /* 304 */
+ "ERRNO_305", /* 305 */
+ "ERRNO_306", /* 306 */
+ "ERRNO_307", /* 307 */
+ "ERRNO_308", /* 308 */
+ "ERRNO_309", /* 309 */
+ "ERRNO_310", /* 310 */
+ "ERRNO_311", /* 311 */
+ "ERRNO_312", /* 312 */
+ "ERRNO_313", /* 313 */
+ "ERRNO_314", /* 314 */
+ "ERRNO_315", /* 315 */
+ "ERRNO_316", /* 316 */
+ "ERRNO_317", /* 317 */
+ "ERRNO_318", /* 318 */
+ "ERRNO_319", /* 319 */
+ "ERRNO_320", /* 320 */
+ "ERRNO_321", /* 321 */
+ "ERRNO_322", /* 322 */
+ "ERRNO_323", /* 323 */
+ "ERRNO_324", /* 324 */
+ "ERRNO_325", /* 325 */
+ "ERRNO_326", /* 326 */
+ "ERRNO_327", /* 327 */
+ "ERRNO_328", /* 328 */
+ "ERRNO_329", /* 329 */
+ "ERRNO_330", /* 330 */
+ "ERRNO_331", /* 331 */
+ "ERRNO_332", /* 332 */
+ "ERRNO_333", /* 333 */
+ "ERRNO_334", /* 334 */
+ "ERRNO_335", /* 335 */
+ "ERRNO_336", /* 336 */
+ "ERRNO_337", /* 337 */
+ "ERRNO_338", /* 338 */
+ "ERRNO_339", /* 339 */
+ "ERRNO_340", /* 340 */
+ "ERRNO_341", /* 341 */
+ "ERRNO_342", /* 342 */
+ "ERRNO_343", /* 343 */
+ "ERRNO_344", /* 344 */
+ "ERRNO_345", /* 345 */
+ "ERRNO_346", /* 346 */
+ "ERRNO_347", /* 347 */
+ "ERRNO_348", /* 348 */
+ "ERRNO_349", /* 349 */
+ "ERRNO_350", /* 350 */
+ "ERRNO_351", /* 351 */
+ "ERRNO_352", /* 352 */
+ "ERRNO_353", /* 353 */
+ "ERRNO_354", /* 354 */
+ "ERRNO_355", /* 355 */
+ "ERRNO_356", /* 356 */
+ "ERRNO_357", /* 357 */
+ "ERRNO_358", /* 358 */
+ "ERRNO_359", /* 359 */
+ "ERRNO_360", /* 360 */
+ "ERRNO_361", /* 361 */
+ "ERRNO_362", /* 362 */
+ "ERRNO_363", /* 363 */
+ "ERRNO_364", /* 364 */
+ "ERRNO_365", /* 365 */
+ "ERRNO_366", /* 366 */
+ "ERRNO_367", /* 367 */
+ "ERRNO_368", /* 368 */
+ "ERRNO_369", /* 369 */
+ "ERRNO_370", /* 370 */
+ "ERRNO_371", /* 371 */
+ "ERRNO_372", /* 372 */
+ "ERRNO_373", /* 373 */
+ "ERRNO_374", /* 374 */
+ "ERRNO_375", /* 375 */
+ "ERRNO_376", /* 376 */
+ "ERRNO_377", /* 377 */
+ "ERRNO_378", /* 378 */
+ "ERRNO_379", /* 379 */
+ "ERRNO_380", /* 380 */
+ "ERRNO_381", /* 381 */
+ "ERRNO_382", /* 382 */
+ "ERRNO_383", /* 383 */
+ "ERRNO_384", /* 384 */
+ "ERRNO_385", /* 385 */
+ "ERRNO_386", /* 386 */
+ "ERRNO_387", /* 387 */
+ "ERRNO_388", /* 388 */
+ "ERRNO_389", /* 389 */
+ "ERRNO_390", /* 390 */
+ "ERRNO_391", /* 391 */
+ "ERRNO_392", /* 392 */
+ "ERRNO_393", /* 393 */
+ "ERRNO_394", /* 394 */
+ "ERRNO_395", /* 395 */
+ "ERRNO_396", /* 396 */
+ "ERRNO_397", /* 397 */
+ "ERRNO_398", /* 398 */
+ "ERRNO_399", /* 399 */
+ "ERRNO_400", /* 400 */
+ "ERRNO_401", /* 401 */
+ "ERRNO_402", /* 402 */
+ "ERRNO_403", /* 403 */
+ "ERRNO_404", /* 404 */
+ "ERRNO_405", /* 405 */
+ "ERRNO_406", /* 406 */
+ "ERRNO_407", /* 407 */
+ "ERRNO_408", /* 408 */
+ "ERRNO_409", /* 409 */
+ "ERRNO_410", /* 410 */
+ "ERRNO_411", /* 411 */
+ "ERRNO_412", /* 412 */
+ "ERRNO_413", /* 413 */
+ "ERRNO_414", /* 414 */
+ "ERRNO_415", /* 415 */
+ "ERRNO_416", /* 416 */
+ "ERRNO_417", /* 417 */
+ "ERRNO_418", /* 418 */
+ "ERRNO_419", /* 419 */
+ "ERRNO_420", /* 420 */
+ "ERRNO_421", /* 421 */
+ "ERRNO_422", /* 422 */
+ "ERRNO_423", /* 423 */
+ "ERRNO_424", /* 424 */
+ "ERRNO_425", /* 425 */
+ "ERRNO_426", /* 426 */
+ "ERRNO_427", /* 427 */
+ "ERRNO_428", /* 428 */
+ "ERRNO_429", /* 429 */
+ "ERRNO_430", /* 430 */
+ "ERRNO_431", /* 431 */
+ "ERRNO_432", /* 432 */
+ "ERRNO_433", /* 433 */
+ "ERRNO_434", /* 434 */
+ "ERRNO_435", /* 435 */
+ "ERRNO_436", /* 436 */
+ "ERRNO_437", /* 437 */
+ "ERRNO_438", /* 438 */
+ "ERRNO_439", /* 439 */
+ "ERRNO_440", /* 440 */
+ "ERRNO_441", /* 441 */
+ "ERRNO_442", /* 442 */
+ "ERRNO_443", /* 443 */
+ "ERRNO_444", /* 444 */
+ "ERRNO_445", /* 445 */
+ "ERRNO_446", /* 446 */
+ "ERRNO_447", /* 447 */
+ "ERRNO_448", /* 448 */
+ "ERRNO_449", /* 449 */
+ "ERRNO_450", /* 450 */
+ "ERRNO_451", /* 451 */
+ "ERRNO_452", /* 452 */
+ "ERRNO_453", /* 453 */
+ "ERRNO_454", /* 454 */
+ "ERRNO_455", /* 455 */
+ "ERRNO_456", /* 456 */
+ "ERRNO_457", /* 457 */
+ "ERRNO_458", /* 458 */
+ "ERRNO_459", /* 459 */
+ "ERRNO_460", /* 460 */
+ "ERRNO_461", /* 461 */
+ "ERRNO_462", /* 462 */
+ "ERRNO_463", /* 463 */
+ "ERRNO_464", /* 464 */
+ "ERRNO_465", /* 465 */
+ "ERRNO_466", /* 466 */
+ "ERRNO_467", /* 467 */
+ "ERRNO_468", /* 468 */
+ "ERRNO_469", /* 469 */
+ "ERRNO_470", /* 470 */
+ "ERRNO_471", /* 471 */
+ "ERRNO_472", /* 472 */
+ "ERRNO_473", /* 473 */
+ "ERRNO_474", /* 474 */
+ "ERRNO_475", /* 475 */
+ "ERRNO_476", /* 476 */
+ "ERRNO_477", /* 477 */
+ "ERRNO_478", /* 478 */
+ "ERRNO_479", /* 479 */
+ "ERRNO_480", /* 480 */
+ "ERRNO_481", /* 481 */
+ "ERRNO_482", /* 482 */
+ "ERRNO_483", /* 483 */
+ "ERRNO_484", /* 484 */
+ "ERRNO_485", /* 485 */
+ "ERRNO_486", /* 486 */
+ "ERRNO_487", /* 487 */
+ "ERRNO_488", /* 488 */
+ "ERRNO_489", /* 489 */
+ "ERRNO_490", /* 490 */
+ "ERRNO_491", /* 491 */
+ "ERRNO_492", /* 492 */
+ "ERRNO_493", /* 493 */
+ "ERRNO_494", /* 494 */
+ "ERRNO_495", /* 495 */
+ "ERRNO_496", /* 496 */
+ "ERRNO_497", /* 497 */
+ "ERRNO_498", /* 498 */
+ "ERRNO_499", /* 499 */
+ "ERRNO_500", /* 500 */
+ "ERRNO_501", /* 501 */
+ "ERRNO_502", /* 502 */
+ "ERRNO_503", /* 503 */
+ "ERRNO_504", /* 504 */
+ "ERRNO_505", /* 505 */
+ "ERRNO_506", /* 506 */
+ "ERRNO_507", /* 507 */
+ "ERRNO_508", /* 508 */
+ "ERRNO_509", /* 509 */
+ "ERRNO_510", /* 510 */
+ "ERRNO_511", /* 511 */
+ "ERESTARTSYS", /* 512 */
+ "ERESTARTNOINTR", /* 513 */
+ "ERESTARTNOHAND", /* 514 */
+ "ENOIOCTLCMD", /* 515 */
diff --git a/linux/powerpc/ioctlent.h b/linux/powerpc/ioctlent.h
new file mode 100644
index 000000000..fedc10c7e
--- /dev/null
+++ b/linux/powerpc/ioctlent.h
@@ -0,0 +1,668 @@
+{"linux/in6.h", "IPV6_PRIORITY_RESERVED1", 0x300},
+{"linux/quota.h", "Q_GETQUOTA", 0x300},
+{"linux/hdreg.h", "HDIO_GETGEO", 0x301},
+{"linux/ps2esdi.h", "HDIO_GETGEO", 0x301},
+{"linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0x302},
+{"linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0x304},
+{"linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0x307},
+{"linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0x308},
+{"linux/hdreg.h", "HDIO_GET_32BIT", 0x309},
+{"linux/hdreg.h", "HDIO_GET_NOWERR", 0x30a},
+{"linux/hdreg.h", "HDIO_GET_DMA", 0x30b},
+{"linux/hdreg.h", "HDIO_GET_NICE", 0x30c},
+{"linux/hdreg.h", "HDIO_GET_IDENTITY", 0x30d},
+{"linux/hdreg.h", "HDIO_DRIVE_CMD", 0x31f},
+{"linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0x321},
+{"linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0x322},
+{"linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0x323},
+{"linux/hdreg.h", "HDIO_SET_32BIT", 0x324},
+{"linux/hdreg.h", "HDIO_SET_NOWERR", 0x325},
+{"linux/hdreg.h", "HDIO_SET_DMA", 0x326},
+{"linux/hdreg.h", "HDIO_SET_PIO_MODE", 0x327},
+{"linux/hdreg.h", "HDIO_SCAN_HWIF", 0x328},
+{"linux/hdreg.h", "HDIO_SET_NICE", 0x329},
+{"linux/zorro.h", "ZORRO_MANUF_CARDCO_1", 0x3ec},
+{"linux/zorro.h", "ZORRO_MANUF_A_SQUARED", 0x3ed},
+{"linux/zorro.h", "ZORRO_MANUF_COMSPEC_COMMUNICATIONS", 0x3ee},
+{"linux/zorro.h", "ZORRO_MANUF_ANAKIN_RESEARCH", 0x3f1},
+{"linux/zorro.h", "ZORRO_MANUF_MICROBOTICS", 0x3f2},
+{"linux/zorro.h", "ZORRO_MANUF_ACCESS_ASSOCIATES_ALEGRA", 0x3f4},
+{"linux/zorro.h", "ZORRO_MANUF_EXPANSION_TECHNOLOGIES", 0x3f6},
+{"linux/zorro.h", "ZORRO_MANUF_ASDG", 0x3ff},
+{"linux/in6.h", "IPV6_PRIORITY_INTERACTIVE", 0x600},
+{"linux/quota.h", "Q_SYNC", 0x600},
+{"linux/lp.h", "LPCHAR", 0x601},
+{"linux/lp_m68k.h", "LPCHAR", 0x601},
+{"linux/lp.h", "LPTIME", 0x602},
+{"linux/lp_m68k.h", "LPTIME", 0x602},
+{"linux/lp.h", "LPABORT", 0x604},
+{"linux/lp_m68k.h", "LPABORT", 0x604},
+{"linux/lp.h", "LPSETIRQ", 0x605},
+{"linux/lp_m68k.h", "LPSETIRQ", 0x605},
+{"linux/lp.h", "LPGETIRQ", 0x606},
+{"linux/lp_m68k.h", "LPGETIRQ", 0x606},
+{"linux/lp.h", "LPWAIT", 0x608},
+{"linux/lp_m68k.h", "LPWAIT", 0x608},
+{"linux/lp.h", "LPCAREFUL", 0x609},
+{"linux/lp_m68k.h", "LPCAREFUL", 0x609},
+{"linux/lp.h", "LPABORTOPEN", 0x60a},
+{"linux/lp_m68k.h", "LPABORTOPEN", 0x60a},
+{"linux/lp.h", "LPGETSTATUS", 0x60b},
+{"linux/lp_m68k.h", "LPGETSTATUS", 0x60b},
+{"linux/lp.h", "LPRESET", 0x60c},
+{"linux/lp_m68k.h", "LPRESET", 0x60c},
+{"linux/lp.h", "LPGETSTATS", 0x60d},
+{"linux/lp.h", "LPGETFLAGS", 0x60e},
+{"linux/zorro.h", "ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_1", 0x6e1},
+{"linux/zorro.h", "ZORRO_MANUF_APOLLO_2", 0x2200},
+{"scsi/sg.h", "SG_SET_TIMEOUT", 0x2201},
+{"scsi/sg.h", "SG_GET_TIMEOUT", 0x2202},
+{"linux/zorro.h", "ZORRO_MANUF_APOLLO_3", 0x2222},
+{"linux/fb.h", "FBIOGET_VSCREENINFO", 0x4600},
+{"linux/fb.h", "FBIOPUT_VSCREENINFO", 0x4601},
+{"linux/ps2esdi.h", "CMD_READ", 0x4601},
+{"linux/fb.h", "FBIOGET_FSCREENINFO", 0x4602},
+{"linux/ps2esdi.h", "CMD_WRITE", 0x4602},
+{"linux/fb.h", "FBIOGETCMAP", 0x4604},
+{"linux/fb.h", "FBIOPUTCMAP", 0x4605},
+{"linux/fb.h", "FBIOPAN_DISPLAY", 0x4606},
+{"linux/fb.h", "FBIOGET_FCURSORINFO", 0x4607},
+{"linux/fb.h", "FBIOGET_VCURSORINFO", 0x4608},
+{"linux/fb.h", "FBIOPUT_VCURSORINFO", 0x4609},
+{"linux/fb.h", "FBIOGET_CURSORSTATE", 0x460a},
+{"linux/fb.h", "FBIOPUT_CURSORSTATE", 0x460b},
+{"linux/fb.h", "FBIOGET_CON2FBMAP", 0x460f},
+{"linux/fb.h", "FBIOPUT_CON2FBMAP", 0x4610},
+{"linux/fb.h", "FBCMD_DRAWLINE", 0x4621},
+{"linux/fb.h", "FBCMD_MOVE", 0x4622},
+{"linux/kd.h", "KIOCSOUND", 0x4b2f},
+{"linux/kd.h", "KDMKTONE", 0x4b30},
+{"linux/kd.h", "KDGETLED", 0x4b31},
+{"linux/kd.h", "KDSETLED", 0x4b32},
+{"linux/kd.h", "KDGKBTYPE", 0x4b33},
+{"linux/kd.h", "KDADDIO", 0x4b34},
+{"linux/kd.h", "KDDELIO", 0x4b35},
+{"linux/kd.h", "KDENABIO", 0x4b36},
+{"linux/kd.h", "KDDISABIO", 0x4b37},
+{"linux/kd.h", "KDSETMODE", 0x4b3a},
+{"linux/kd.h", "KDGETMODE", 0x4b3b},
+{"linux/kd.h", "KDMAPDISP", 0x4b3c},
+{"linux/kd.h", "KDUNMAPDISP", 0x4b3d},
+{"linux/kd.h", "GIO_SCRNMAP", 0x4b40},
+{"linux/kd.h", "PIO_SCRNMAP", 0x4b41},
+{"linux/kd.h", "KDGKBMODE", 0x4b44},
+{"linux/kd.h", "KDSKBMODE", 0x4b45},
+{"linux/kd.h", "KDGKBENT", 0x4b46},
+{"linux/kd.h", "KDSKBENT", 0x4b47},
+{"linux/kd.h", "KDGKBSENT", 0x4b48},
+{"linux/kd.h", "KDSKBSENT", 0x4b49},
+{"linux/kd.h", "KDGKBDIACR", 0x4b4a},
+{"linux/kd.h", "KDSKBDIACR", 0x4b4b},
+{"linux/kd.h", "KDGETKEYCODE", 0x4b4c},
+{"linux/kd.h", "KDSETKEYCODE", 0x4b4d},
+{"linux/kd.h", "KDSIGACCEPT", 0x4b4e},
+{"linux/kd.h", "KDGHWCLK", 0x4b50},
+{"linux/kd.h", "KDSHWCLK", 0x4b51},
+{"linux/kd.h", "KDKBDREP", 0x4b52},
+{"linux/kd.h", "GIO_FONT", 0x4b60},
+{"linux/kd.h", "PIO_FONT", 0x4b61},
+{"linux/kd.h", "KDGKBMETA", 0x4b62},
+{"linux/kd.h", "KDSKBMETA", 0x4b63},
+{"linux/kd.h", "KDGKBLED", 0x4b64},
+{"linux/kd.h", "KDSKBLED", 0x4b65},
+{"linux/kd.h", "GIO_UNIMAP", 0x4b66},
+{"linux/kd.h", "PIO_UNIMAP", 0x4b67},
+{"linux/kd.h", "PIO_UNIMAPCLR", 0x4b68},
+{"linux/kd.h", "GIO_UNISCRNMAP", 0x4b69},
+{"linux/kd.h", "PIO_UNISCRNMAP", 0x4b6a},
+{"linux/kd.h", "GIO_FONTX", 0x4b6b},
+{"linux/kd.h", "PIO_FONTX", 0x4b6c},
+{"linux/kd.h", "PIO_FONTRESET", 0x4b6d},
+{"linux/kd.h", "GIO_CMAP", 0x4b70},
+{"linux/kd.h", "PIO_CMAP", 0x4b71},
+{"linux/kd.h", "KDFONTOP", 0x4b72},
+{"linux/loop.h", "LOOP_SET_FD", 0x4c00},
+{"linux/loop.h", "LOOP_CLR_FD", 0x4c01},
+{"linux/loop.h", "LOOP_SET_STATUS", 0x4c02},
+{"linux/loop.h", "LOOP_GET_STATUS", 0x4c03},
+{"linux/cdrom.h", "CDROMPAUSE", 0x5301},
+{"linux/cdrom.h", "CDROMRESUME", 0x5302},
+{"linux/cdrom.h", "CDROMPLAYMSF", 0x5303},
+{"linux/cdrom.h", "CDROMPLAYTRKIND", 0x5304},
+{"linux/cdrom.h", "CDROMREADTOCHDR", 0x5305},
+{"linux/cdrom.h", "CDROMREADTOCENTRY", 0x5306},
+{"linux/cdrom.h", "CDROMSTOP", 0x5307},
+{"linux/cdrom.h", "CDROMSTART", 0x5308},
+{"linux/cdrom.h", "CDROMEJECT", 0x5309},
+{"linux/cdrom.h", "CDROMVOLCTRL", 0x530a},
+{"linux/cdrom.h", "CDROMSUBCHNL", 0x530b},
+{"linux/cdrom.h", "CDROMREADMODE2", 0x530c},
+{"linux/cdrom.h", "CDROMREADMODE1", 0x530d},
+{"linux/cdrom.h", "CDROMREADAUDIO", 0x530e},
+{"linux/cdrom.h", "CDROMEJECT_SW", 0x530f},
+{"linux/cdrom.h", "CDROMMULTISESSION", 0x5310},
+{"linux/cdrom.h", "CDROM_GET_MCN", 0x5311},
+{"linux/cdrom.h", "CDROMRESET", 0x5312},
+{"linux/cdrom.h", "CDROMVOLREAD", 0x5313},
+{"linux/cdrom.h", "CDROMREADRAW", 0x5314},
+{"linux/cdrom.h", "CDROMREADCOOKED", 0x5315},
+{"linux/cdrom.h", "CDROMSEEK", 0x5316},
+{"linux/cdrom.h", "CDROMPLAYBLK", 0x5317},
+{"linux/cdrom.h", "CDROMREADALL", 0x5318},
+{"linux/cdrom.h", "CDROMCLOSETRAY", 0x5319},
+{"linux/cdrom.h", "CDROM_SET_OPTIONS", 0x5320},
+{"linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0x5321},
+{"linux/cdrom.h", "CDROM_SELECT_SPEED", 0x5322},
+{"linux/cdrom.h", "CDROM_SELECT_DISC", 0x5323},
+{"linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0x5325},
+{"linux/cdrom.h", "CDROM_DRIVE_STATUS", 0x5326},
+{"linux/cdrom.h", "CDROM_DISC_STATUS", 0x5327},
+{"linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0x5328},
+{"linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0x5382},
+{"scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0x5382},
+{"scsi/scsi.h", "SCSI_IOCTL_TAGGED_ENABLE", 0x5383},
+{"scsi/scsi.h", "SCSI_IOCTL_TAGGED_DISABLE", 0x5384},
+{"scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0x5385},
+{"scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0x5386},
+{"asm/ioctls.h", "TIOCEXCL", 0x540c},
+{"asm/termios.h", "TIOCEXCL", 0x540c},
+{"asm/ioctls.h", "TIOCNXCL", 0x540d},
+{"asm/termios.h", "TIOCNXCL", 0x540d},
+{"asm/ioctls.h", "TIOCSCTTY", 0x540e},
+{"asm/termios.h", "TIOCSCTTY", 0x540e},
+{"asm/ioctls.h", "TIOCSTI", 0x5412},
+{"asm/termios.h", "TIOCSTI", 0x5412},
+{"asm/ioctls.h", "TIOCMGET", 0x5415},
+{"asm/termios.h", "TIOCMGET", 0x5415},
+{"asm/ioctls.h", "TIOCMBIS", 0x5416},
+{"asm/termios.h", "TIOCMBIS", 0x5416},
+{"asm/ioctls.h", "TIOCMBIC", 0x5417},
+{"asm/termios.h", "TIOCMBIC", 0x5417},
+{"asm/ioctls.h", "TIOCMSET", 0x5418},
+{"asm/termios.h", "TIOCMSET", 0x5418},
+{"asm/ioctls.h", "TIOCGSOFTCAR", 0x5419},
+{"asm/termios.h", "TIOCGSOFTCAR", 0x5419},
+{"asm/ioctls.h", "TIOCSSOFTCAR", 0x541a},
+{"asm/termios.h", "TIOCSSOFTCAR", 0x541a},
+{"asm/ioctls.h", "TIOCLINUX", 0x541c},
+{"asm/termios.h", "TIOCLINUX", 0x541c},
+{"asm/ioctls.h", "TIOCCONS", 0x541d},
+{"asm/termios.h", "TIOCCONS", 0x541d},
+{"asm/ioctls.h", "TIOCGSERIAL", 0x541e},
+{"asm/termios.h", "TIOCGSERIAL", 0x541e},
+{"asm/ioctls.h", "TIOCSSERIAL", 0x541f},
+{"asm/termios.h", "TIOCSSERIAL", 0x541f},
+{"asm/ioctls.h", "TIOCPKT", 0x5420},
+{"asm/termios.h", "TIOCPKT", 0x5420},
+{"asm/ioctls.h", "TIOCNOTTY", 0x5422},
+{"asm/termios.h", "TIOCNOTTY", 0x5422},
+{"asm/ioctls.h", "TIOCSETD", 0x5423},
+{"asm/termios.h", "TIOCSETD", 0x5423},
+{"asm/ioctls.h", "TIOCGETD", 0x5424},
+{"asm/termios.h", "TIOCGETD", 0x5424},
+{"asm/ioctls.h", "TCSBRKP", 0x5425},
+{"asm/termios.h", "TCSBRKP", 0x5425},
+{"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426},
+{"asm/termios.h", "TIOCTTYGSTRUCT", 0x5426},
+{"asm/ioctls.h", "TIOCSBRK", 0x5427},
+{"asm/ioctls.h", "TIOCCBRK", 0x5428},
+{"asm/ioctls.h", "TIOCGSID", 0x5429},
+{"asm/ioctls.h", "TIOCSERCONFIG", 0x5453},
+{"asm/termios.h", "TIOCSERCONFIG", 0x5453},
+{"asm/ioctls.h", "TIOCSERGWILD", 0x5454},
+{"asm/termios.h", "TIOCSERGWILD", 0x5454},
+{"asm/ioctls.h", "TIOCSERSWILD", 0x5455},
+{"asm/termios.h", "TIOCSERSWILD", 0x5455},
+{"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456},
+{"asm/termios.h", "TIOCGLCKTRMIOS", 0x5456},
+{"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457},
+{"asm/termios.h", "TIOCSLCKTRMIOS", 0x5457},
+{"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458},
+{"asm/termios.h", "TIOCSERGSTRUCT", 0x5458},
+{"asm/ioctls.h", "TIOCSERGETLSR", 0x5459},
+{"asm/termios.h", "TIOCSERGETLSR", 0x5459},
+{"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a},
+{"asm/termios.h", "TIOCSERGETMULTI", 0x545a},
+{"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b},
+{"asm/termios.h", "TIOCSERSETMULTI", 0x545b},
+{"asm/ioctls.h", "TIOCMIWAIT", 0x545c},
+{"asm/termios.h", "TIOCMIWAIT", 0x545c},
+{"asm/ioctls.h", "TIOCGICOUNT", 0x545d},
+{"asm/termios.h", "TIOCGICOUNT", 0x545d},
+{"linux/vt.h", "VT_OPENQRY", 0x5600},
+{"linux/vt.h", "VT_GETMODE", 0x5601},
+{"linux/vt.h", "VT_SETMODE", 0x5602},
+{"linux/vt.h", "VT_GETSTATE", 0x5603},
+{"linux/vt.h", "VT_SENDSIG", 0x5604},
+{"linux/vt.h", "VT_RELDISP", 0x5605},
+{"linux/vt.h", "VT_ACTIVATE", 0x5606},
+{"linux/vt.h", "VT_WAITACTIVE", 0x5607},
+{"linux/vt.h", "VT_DISALLOCATE", 0x5608},
+{"linux/vt.h", "VT_RESIZE", 0x5609},
+{"linux/vt.h", "VT_RESIZEX", 0x560a},
+{"linux/vt.h", "VT_LOCKSWITCH", 0x560b},
+{"linux/vt.h", "VT_UNLOCKSWITCH", 0x560c},
+{"asm/socket.h", "FIOSETOWN", 0x8901},
+{"asm/sockios.h", "FIOSETOWN", 0x8901},
+{"asm/socket.h", "SIOCSPGRP", 0x8902},
+{"asm/sockios.h", "SIOCSPGRP", 0x8902},
+{"asm/socket.h", "FIOGETOWN", 0x8903},
+{"asm/sockios.h", "FIOGETOWN", 0x8903},
+{"asm/socket.h", "SIOCGPGRP", 0x8904},
+{"asm/sockios.h", "SIOCGPGRP", 0x8904},
+{"asm/socket.h", "SIOCATMARK", 0x8905},
+{"asm/sockios.h", "SIOCATMARK", 0x8905},
+{"asm/socket.h", "SIOCGSTAMP", 0x8906},
+{"asm/sockios.h", "SIOCGSTAMP", 0x8906},
+{"linux/sockios.h", "SIOCADDRT", 0x890b},
+{"linux/sockios.h", "SIOCDELRT", 0x890c},
+{"linux/sockios.h", "SIOCRTMSG", 0x890d},
+{"linux/sockios.h", "SIOCGIFNAME", 0x8910},
+{"linux/sockios.h", "SIOCSIFLINK", 0x8911},
+{"linux/sockios.h", "SIOCGIFCONF", 0x8912},
+{"linux/sockios.h", "SIOCGIFFLAGS", 0x8913},
+{"linux/sockios.h", "SIOCSIFFLAGS", 0x8914},
+{"linux/sockios.h", "SIOCGIFADDR", 0x8915},
+{"linux/sockios.h", "SIOCSIFADDR", 0x8916},
+{"linux/sockios.h", "SIOCGIFDSTADDR", 0x8917},
+{"linux/sockios.h", "SIOCSIFDSTADDR", 0x8918},
+{"linux/sockios.h", "SIOCGIFBRDADDR", 0x8919},
+{"linux/sockios.h", "SIOCSIFBRDADDR", 0x891a},
+{"linux/sockios.h", "SIOCGIFNETMASK", 0x891b},
+{"linux/sockios.h", "SIOCSIFNETMASK", 0x891c},
+{"linux/sockios.h", "SIOCGIFMETRIC", 0x891d},
+{"linux/sockios.h", "SIOCSIFMETRIC", 0x891e},
+{"linux/sockios.h", "SIOCGIFMEM", 0x891f},
+{"linux/sockios.h", "SIOCSIFMEM", 0x8920},
+{"linux/sockios.h", "SIOCGIFMTU", 0x8921},
+{"linux/sockios.h", "SIOCSIFMTU", 0x8922},
+{"linux/sockios.h", "SIOCSIFHWADDR", 0x8924},
+{"linux/sockios.h", "SIOCGIFENCAP", 0x8925},
+{"linux/sockios.h", "SIOCSIFENCAP", 0x8926},
+{"linux/sockios.h", "SIOCGIFHWADDR", 0x8927},
+{"linux/sockios.h", "SIOCGIFSLAVE", 0x8929},
+{"linux/sockios.h", "SIOCSIFSLAVE", 0x8930},
+{"linux/sockios.h", "SIOCADDMULTI", 0x8931},
+{"linux/sockios.h", "SIOCDELMULTI", 0x8932},
+{"linux/sockios.h", "SIOCGIFINDEX", 0x8933},
+{"linux/sockios.h", "SIOCSIFPFLAGS", 0x8934},
+{"linux/sockios.h", "SIOCGIFPFLAGS", 0x8935},
+{"linux/sockios.h", "SIOCDIFADDR", 0x8936},
+{"linux/sockios.h", "SIOCSIFHWBROADCAST", 0x8937},
+{"linux/sockios.h", "SIOCGIFCOUNT", 0x8938},
+{"linux/sockios.h", "SIOCGIFBR", 0x8940},
+{"linux/sockios.h", "SIOCSIFBR", 0x8941},
+{"linux/sockios.h", "SIOCGIFTXQLEN", 0x8942},
+{"linux/sockios.h", "SIOCSIFTXQLEN", 0x8943},
+{"linux/sockios.h", "SIOCDARP", 0x8953},
+{"linux/sockios.h", "SIOCGARP", 0x8954},
+{"linux/sockios.h", "SIOCSARP", 0x8955},
+{"linux/sockios.h", "SIOCDRARP", 0x8960},
+{"linux/sockios.h", "SIOCGRARP", 0x8961},
+{"linux/sockios.h", "SIOCSRARP", 0x8962},
+{"linux/sockios.h", "SIOCGIFMAP", 0x8970},
+{"linux/sockios.h", "SIOCSIFMAP", 0x8971},
+{"linux/sockios.h", "SIOCADDDLCI", 0x8980},
+{"linux/sockios.h", "SIOCDELDLCI", 0x8981},
+{"linux/sockios.h", "SIOCPROTOPRIVATE", 0x89e0},
+{"linux/sockios.h", "SIOCDEVPRIVATE", 0x89f0},
+{"linux/elf.h", "EM_ALPHA", 0x9026},
+{"linux/cyclades.h", "CYGETMON", 0x435901},
+{"linux/cyclades.h", "CYGETTHRESH", 0x435902},
+{"linux/cyclades.h", "CYSETTHRESH", 0x435903},
+{"linux/cyclades.h", "CYGETDEFTHRESH", 0x435904},
+{"linux/cyclades.h", "CYSETDEFTHRESH", 0x435905},
+{"linux/cyclades.h", "CYGETTIMEOUT", 0x435906},
+{"linux/cyclades.h", "CYSETTIMEOUT", 0x435907},
+{"linux/cyclades.h", "CYGETDEFTIMEOUT", 0x435908},
+{"linux/cyclades.h", "CYSETDEFTIMEOUT", 0x435909},
+{"linux/cyclades.h", "CYSETRFLOW", 0x43590a},
+{"linux/cyclades.h", "CYGETRFLOW", 0x43590b},
+{"linux/cyclades.h", "CYSETRTSDTR_INV", 0x43590c},
+{"linux/cyclades.h", "CYGETRTSDTR_INV", 0x43590d},
+{"linux/cyclades.h", "CYZPOLLCYCLE", 0x43590e},
+{"linux/cyclades.h", "CYGETCD1400VER", 0x43590f},
+{"linux/cyclades.h", "CYGETCARDINFO", 0x435910},
+{"linux/cyclades.h", "CYSETWAIT", 0x435911},
+{"linux/cyclades.h", "CYGETWAIT", 0x435912},
+{"linux/fs.h", "FIBMAP", 0x20000001},
+{"linux/fs.h", "FIGETBSZ", 0x20000002},
+{"linux/fd.h", "FDCLRPRM", 0x20000241},
+{"linux/fd.h", "FDMSGON", 0x20000245},
+{"linux/fd.h", "FDMSGOFF", 0x20000246},
+{"linux/fd.h", "FDFMTBEG", 0x20000247},
+{"linux/fd.h", "FDFMTEND", 0x20000249},
+{"linux/fd.h", "FDSETEMSGTRESH", 0x2000024a},
+{"linux/fd.h", "FDFLUSH", 0x2000024b},
+{"linux/fd.h", "FDRESET", 0x20000254},
+{"linux/fd.h", "FDWERRORCLR", 0x20000256},
+{"linux/fd.h", "FDRAWCMD", 0x20000258},
+{"linux/fd.h", "FDTWADDLE", 0x20000259},
+{"linux/fd.h", "FDEJECT", 0x2000025a},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_DOS", 0x200004d2},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_DOS", 0x200004d3},
+{"linux/umsdos_fs.h", "UMSDOS_RMDIR_DOS", 0x200004d4},
+{"linux/umsdos_fs.h", "UMSDOS_STAT_DOS", 0x200004d5},
+{"linux/umsdos_fs.h", "UMSDOS_CREAT_EMD", 0x200004d6},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_EMD", 0x200004d7},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_EMD", 0x200004d8},
+{"linux/umsdos_fs.h", "UMSDOS_GETVERSION", 0x200004d9},
+{"linux/umsdos_fs.h", "UMSDOS_INIT_EMD", 0x200004da},
+{"linux/umsdos_fs.h", "UMSDOS_DOS_SETUP", 0x200004db},
+{"linux/umsdos_fs.h", "UMSDOS_RENAME_DOS", 0x200004dc},
+{"linux/md.h", "REGISTER_DEV", 0x20000901},
+{"linux/md.h", "START_MD", 0x20000902},
+{"linux/md.h", "STOP_MD", 0x20000903},
+{"linux/md.h", "REGISTER_DEV_NEW", 0x20000904},
+{"linux/fs.h", "BLKROSET", 0x2000125d},
+{"linux/fs.h", "BLKROGET", 0x2000125e},
+{"linux/fs.h", "BLKRRPART", 0x2000125f},
+{"linux/fs.h", "BLKGETSIZE", 0x20001260},
+{"linux/fs.h", "BLKFLSBUF", 0x20001261},
+{"linux/fs.h", "BLKRASET", 0x20001262},
+{"linux/fs.h", "BLKRAGET", 0x20001263},
+{"linux/fs.h", "BLKFRASET", 0x20001264},
+{"linux/fs.h", "BLKFRAGET", 0x20001265},
+{"linux/fs.h", "BLKSECTSET", 0x20001266},
+{"linux/fs.h", "BLKSECTGET", 0x20001267},
+{"linux/apm_bios.h", "APM_IOC_STANDBY", 0x20004101},
+{"linux/apm_bios.h", "APM_IOC_SUSPEND", 0x20004102},
+{"asm/pmu.h", "PMU_IOC_SLEEP", 0x20004200},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_CLEARRQ", 0x20004803},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_SAMPLEFINISHED", 0x20004808},
+{"linux/isdn.h", "IIOCNETAIF", 0x20004901},
+{"linux/isdn.h", "IIOCNETDIF", 0x20004902},
+{"linux/isdn.h", "IIOCNETSCF", 0x20004903},
+{"linux/isdn.h", "IIOCNETGCF", 0x20004904},
+{"linux/isdn.h", "IIOCNETANM", 0x20004905},
+{"linux/isdn.h", "IIOCNETDNM", 0x20004906},
+{"linux/isdn.h", "IIOCNETGNM", 0x20004907},
+{"linux/isdn.h", "IIOCGETSET", 0x20004908},
+{"linux/isdn.h", "IIOCSETSET", 0x20004909},
+{"linux/isdn.h", "IIOCSETVER", 0x2000490a},
+{"linux/isdn.h", "IIOCNETHUP", 0x2000490b},
+{"linux/isdn.h", "IIOCSETGST", 0x2000490c},
+{"linux/isdn.h", "IIOCSETBRJ", 0x2000490d},
+{"linux/isdn.h", "IIOCSIGPRF", 0x2000490e},
+{"linux/isdn.h", "IIOCGETPRF", 0x2000490f},
+{"linux/isdn.h", "IIOCSETPRF", 0x20004910},
+{"linux/isdn.h", "IIOCGETMAP", 0x20004911},
+{"linux/isdn.h", "IIOCSETMAP", 0x20004912},
+{"linux/isdn.h", "IIOCNETASL", 0x20004913},
+{"linux/isdn.h", "IIOCNETDIL", 0x20004914},
+{"linux/isdn.h", "IIOCGETCPS", 0x20004915},
+{"linux/isdn.h", "IIOCGETDVR", 0x20004916},
+{"linux/isdn.h", "IIOCNETALN", 0x20004920},
+{"linux/isdn.h", "IIOCNETDLN", 0x20004921},
+{"linux/isdn.h", "IIOCDBGVAR", 0x2000497f},
+{"linux/isdn.h", "IIOCDRVCTL", 0x20004980},
+{"linux/random.h", "RNDZAPENTCNT", 0x20005204},
+{"linux/random.h", "RNDCLEARPOOL", 0x20005206},
+{"linux/comstats.h", "COM_GETPORTSTATS", 0x2000631e},
+{"linux/comstats.h", "COM_CLRPORTSTATS", 0x2000631f},
+{"linux/comstats.h", "COM_GETBRDSTATS", 0x20006320},
+{"linux/comstats.h", "COM_READPORT", 0x20006328},
+{"linux/comstats.h", "COM_READBOARD", 0x20006329},
+{"linux/comstats.h", "COM_READPANEL", 0x2000632a},
+{"asm/ioctls.h", "FIOCLEX", 0x20006601},
+{"asm/termios.h", "FIOCLEX", 0x20006601},
+{"asm/ioctls.h", "FIONCLEX", 0x20006602},
+{"asm/termios.h", "FIONCLEX", 0x20006602},
+{"linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", 0x20006e03},
+{"linux/mc146818rtc.h", "RTC_AIE_ON", 0x20007001},
+{"linux/mc146818rtc.h", "RTC_AIE_OFF", 0x20007002},
+{"linux/mc146818rtc.h", "RTC_UIE_ON", 0x20007003},
+{"linux/mc146818rtc.h", "RTC_UIE_OFF", 0x20007004},
+{"linux/mc146818rtc.h", "RTC_PIE_ON", 0x20007005},
+{"linux/mc146818rtc.h", "RTC_PIE_OFF", 0x20007006},
+{"linux/nvram.h", "NVRAM_INIT", 0x20007040},
+{"linux/nvram.h", "NVRAM_SETCKS", 0x20007041},
+{"linux/cdk.h", "STL_BINTR", 0x20007314},
+{"linux/cdk.h", "STL_BSTART", 0x20007315},
+{"linux/cdk.h", "STL_BSTOP", 0x20007316},
+{"linux/cdk.h", "STL_BRESET", 0x20007317},
+{"linux/cdk.h", "STL_GETPFLAG", 0x20007350},
+{"linux/cdk.h", "STL_SETPFLAG", 0x20007351},
+{"asm/ioctls.h", "TCSBRK", 0x2000741d},
+{"asm/termios.h", "TCSBRK", 0x2000741d},
+{"asm/ioctls.h", "TCXONC", 0x2000741e},
+{"asm/termios.h", "TCXONC", 0x2000741e},
+{"asm/ioctls.h", "TCFLSH", 0x2000741f},
+{"asm/termios.h", "TCFLSH", 0x2000741f},
+{"linux/if_ppp.h", "PPPIOCXFERUNIT", 0x2000744e},
+{"asm/ioctls.h", "TIOCSTART", 0x2000746e},
+{"asm/termios.h", "TIOCSTART", 0x2000746e},
+{"asm/ioctls.h", "TIOCSTOP", 0x2000746f},
+{"asm/termios.h", "TIOCSTOP", 0x2000746f},
+{"linux/videodev.h", "VIDIOCSYNC", 0x20007612},
+{"linux/auto_fs.h", "AUTOFS_IOC_READY", 0x20009360},
+{"linux/auto_fs.h", "AUTOFS_IOC_FAIL", 0x20009361},
+{"linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", 0x20009362},
+{"linux/nbd.h", "NBD_SET_SOCK", 0x2000ab00},
+{"linux/nbd.h", "NBD_SET_BLKSIZE", 0x2000ab01},
+{"linux/nbd.h", "NBD_SET_SIZE", 0x2000ab02},
+{"linux/nbd.h", "NBD_DO_IT", 0x2000ab03},
+{"linux/nbd.h", "NBD_CLEAR_SOCK", 0x2000ab04},
+{"linux/nbd.h", "NBD_CLEAR_QUE", 0x2000ab05},
+{"linux/nbd.h", "NBD_PRINT_DEBUG", 0x2000ab06},
+{"linux/joystick.h", "JSIOCGAXES", 0x40016a11},
+{"linux/joystick.h", "JSIOCGBUTTONS", 0x40016a12},
+{"linux/capi.h", "CAPI_GET_ERRCODE", 0x40024321},
+{"linux/capi.h", "CAPI_INSTALLED", 0x40024322},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_GETCURTIME", 0x40044804},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_WAITRQ", 0x40044805},
+{"linux/soundcard.h", "SOUND_MIXER_READ_VOLUME", 0x40044d00},
+{"linux/soundcard.h", "SOUND_MIXER_READ_BASS", 0x40044d01},
+{"linux/soundcard.h", "SOUND_MIXER_READ_TREBLE", 0x40044d02},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SYNTH", 0x40044d03},
+{"linux/soundcard.h", "SOUND_MIXER_READ_PCM", 0x40044d04},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SPEAKER", 0x40044d05},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE", 0x40044d06},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MIC", 0x40044d07},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CD", 0x40044d08},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IMIX", 0x40044d09},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ALTPCM", 0x40044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECLEV", 0x40044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IGAIN", 0x40044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_OGAIN", 0x40044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE1", 0x40044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE2", 0x40044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE3", 0x40044d10},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MUTE", 0x40044d1f},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ENHANCE", 0x40044d1f},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LOUD", 0x40044d1f},
+{"linux/soundcard.h", "SOUND_MIXER_READ_STEREODEVS", 0x40044dfb},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CAPS", 0x40044dfc},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECMASK", 0x40044dfd},
+{"linux/soundcard.h", "SOUND_MIXER_READ_DEVMASK", 0x40044dfe},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECSRC", 0x40044dff},
+{"linux/random.h", "RNDGETENTCNT", 0x40045200},
+{"asm/ioctls.h", "TIOCGPTN", 0x40045430},
+{"linux/watchdog.h", "WDIOC_GETSTATUS", 0x40045701},
+{"linux/watchdog.h", "WDIOC_GETBOOTSTATUS", 0x40045702},
+{"linux/watchdog.h", "WDIOC_GETTEMP", 0x40045703},
+{"linux/watchdog.h", "WDIOC_SETOPTIONS", 0x40045704},
+{"linux/watchdog.h", "WDIOC_KEEPALIVE", 0x40045705},
+{"linux/ext2_fs.h", "EXT2_IOC_GETFLAGS", 0x40046601},
+{"asm/ioctls.h", "FIONREAD", 0x4004667f},
+{"asm/termios.h", "FIONREAD", 0x4004667f},
+{"linux/joystick.h", "JSIOCGVERSION", 0x40046a01},
+{"linux/mtio.h", "MTIOCPOS", 0x40046d03},
+{"linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", 0x40046e06},
+{"linux/mc146818rtc.h", "RTC_IRQP_READ", 0x4004700b},
+{"linux/mc146818rtc.h", "RTC_EPOCH_READ", 0x4004700d},
+{"linux/if_ppp.h", "PPPIOCGDEBUG", 0x40047441},
+{"linux/if_ppp.h", "PPPIOCGMRU", 0x40047453},
+{"linux/if_ppp.h", "PPPIOCGRASYNCMAP", 0x40047455},
+{"linux/if_ppp.h", "PPPIOCGUNIT", 0x40047456},
+{"linux/if_ppp.h", "PPPIOCGASYNCMAP", 0x40047458},
+{"linux/if_ppp.h", "PPPIOCGFLAGS", 0x4004745a},
+{"asm/ioctls.h", "TIOCOUTQ", 0x40047473},
+{"asm/termios.h", "TIOCOUTQ", 0x40047473},
+{"asm/ioctls.h", "TIOCGPGRP", 0x40047477},
+{"asm/termios.h", "TIOCGPGRP", 0x40047477},
+{"linux/isdn_ppp.h", "PPPIOCGMPFLAGS", 0x40047482},
+{"linux/isdn_ppp.h", "PPPIOCGCOMPRESSORS", 0x40047486},
+{"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID", 0x40047501},
+{"linux/ext2_fs.h", "EXT2_IOC_GETVERSION", 0x40047601},
+{"linux/videodev.h", "VIDIOCGFREQ", 0x4004760e},
+{"linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", 0x40049363},
+{"asm/ioctls.h", "TIOCGETP", 0x40067408},
+{"asm/termios.h", "TIOCGETP", 0x40067408},
+{"asm/ioctls.h", "TIOCGETC", 0x40067412},
+{"asm/termios.h", "TIOCGETC", 0x40067412},
+{"asm/ioctls.h", "TIOCGLTC", 0x40067474},
+{"asm/termios.h", "TIOCGLTC", 0x40067474},
+{"linux/random.h", "RNDGETPOOL", 0x40085202},
+{"linux/mtio.h", "MTIOCGETSIZE", 0x40086d09},
+{"linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", 0x40086e0a},
+{"linux/if_ppp.h", "PPPIOCGIDLE", 0x4008743f},
+{"asm/ioctls.h", "TIOCGWINSZ", 0x40087468},
+{"asm/termios.h", "TIOCGWINSZ", 0x40087468},
+{"linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", 0x400c6e01},
+{"linux/ncp_fs.h", "NCP_IOC_SETROOT", 0x400c6e08},
+{"linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", 0x400c6e09},
+{"linux/videodev.h", "VIDIOCKEY", 0x400c760d},
+{"linux/videodev.h", "VIDIOCGPICT", 0x400e7606},
+{"linux/fd.h", "FDGETDRVTYP", 0x4010020f},
+{"linux/fd.h", "FDGETMAXERRS", 0x4014020e},
+{"linux/mtio.h", "MTIOCVOLINFO", 0x40146d08},
+{"linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", 0x40146e07},
+{"asm/ioctls.h", "TCGETA", 0x40147417},
+{"asm/termios.h", "TCGETA", 0x40147417},
+{"linux/videodev.h", "VIDIOCGFBUF", 0x4014760b},
+{"linux/fd.h", "FDWERRORGET", 0x40180217},
+{"linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", 0x40186e05},
+{"linux/fd.h", "FDGETPRM", 0x401c0204},
+{"linux/mtio.h", "MTIOCGET", 0x401c6d02},
+{"linux/fd.h", "FDGETFDCSTAT", 0x40200215},
+{"linux/if_ppp.h", "PPPIOCGXASYNCMAP", 0x40207450},
+{"linux/videodev.h", "VIDIOCGWIN", 0x40207609},
+{"linux/mc146818rtc.h", "RTC_ALM_READ", 0x40247008},
+{"linux/mc146818rtc.h", "RTC_RD_TIME", 0x40247009},
+{"linux/videodev.h", "VIDIOCGAUDIO", 0x40247610},
+{"linux/watchdog.h", "WDIOC_GETSUPPORT", 0x40285700},
+{"asm/ioctls.h", "TCGETS", 0x402c7413},
+{"asm/termios.h", "TCGETS", 0x402c7413},
+{"linux/fd.h", "FDGETDRVSTAT", 0x40340212},
+{"linux/fd.h", "FDPOLLDRVSTAT", 0x40340213},
+{"linux/videodev.h", "VIDIOCGCAP", 0x403c7601},
+{"linux/fd.h", "FDGETDRVPRM", 0x40580211},
+{"linux/joystick.h", "JSIOCGCORR", 0x40906a22},
+{"linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", 0x410c9365},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", 0x42187201},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", 0x42187202},
+{"linux/random.h", "RNDADDTOENTCNT", 0x80045201},
+{"asm/ioctls.h", "TIOCSPTLCK", 0x80045431},
+{"linux/ext2_fs.h", "EXT2_IOC_SETFLAGS", 0x80046602},
+{"asm/ioctls.h", "FIOASYNC", 0x8004667d},
+{"asm/termios.h", "FIOASYNC", 0x8004667d},
+{"asm/ioctls.h", "FIONBIO", 0x8004667e},
+{"asm/termios.h", "FIONBIO", 0x8004667e},
+{"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", 0x80046e02},
+{"linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", 0x80046e06},
+{"linux/mc146818rtc.h", "RTC_IRQP_SET", 0x8004700c},
+{"linux/mc146818rtc.h", "RTC_EPOCH_SET", 0x8004700e},
+{"linux/if_ppp.h", "PPPIOCSDEBUG", 0x80047440},
+{"linux/if_ppp.h", "PPPIOCSMAXCID", 0x80047451},
+{"linux/if_ppp.h", "PPPIOCSMRU", 0x80047452},
+{"linux/if_ppp.h", "PPPIOCSRASYNCMAP", 0x80047454},
+{"linux/if_ppp.h", "PPPIOCSASYNCMAP", 0x80047457},
+{"linux/if_ppp.h", "PPPIOCSFLAGS", 0x80047459},
+{"asm/ioctls.h", "TIOCSPGRP", 0x80047476},
+{"asm/termios.h", "TIOCSPGRP", 0x80047476},
+{"linux/isdn_ppp.h", "PPPIOCBUNDLE", 0x80047481},
+{"linux/isdn_ppp.h", "PPPIOCSMPFLAGS", 0x80047483},
+{"linux/isdn_ppp.h", "PPPIOCSMPMTU", 0x80047484},
+{"linux/isdn_ppp.h", "PPPIOCSMPMRU", 0x80047485},
+{"linux/isdn_ppp.h", "PPPIOCSCOMPRESSOR", 0x80047487},
+{"linux/ext2_fs.h", "EXT2_IOC_SETVERSION", 0x80047602},
+{"linux/videodev.h", "VIDIOCSCHAN", 0x80047603},
+{"linux/videodev.h", "VIDIOCCAPTURE", 0x80047608},
+{"linux/videodev.h", "VIDIOCSFREQ", 0x8004760f},
+{"asm/ioctls.h", "TIOCSETP", 0x80067409},
+{"asm/termios.h", "TIOCSETP", 0x80067409},
+{"asm/ioctls.h", "TIOCSETN", 0x8006740a},
+{"asm/termios.h", "TIOCSETN", 0x8006740a},
+{"asm/ioctls.h", "TIOCSETC", 0x80067411},
+{"asm/termios.h", "TIOCSETC", 0x80067411},
+{"asm/ioctls.h", "TIOCSLTC", 0x80067475},
+{"asm/termios.h", "TIOCSLTC", 0x80067475},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_SAMPLESTART", 0x80084807},
+{"linux/random.h", "RNDADDENTROPY", 0x80085203},
+{"linux/mtio.h", "MTIOCTOP", 0x80086d01},
+{"linux/if_ppp.h", "PPPIOCSNPMODE", 0x8008744b},
+{"asm/ioctls.h", "TIOCSWINSZ", 0x80087467},
+{"asm/termios.h", "TIOCSWINSZ", 0x80087467},
+{"linux/fd.h", "FDFMTTRK", 0x800c0248},
+{"linux/capi.h", "CAPI_REGISTER", 0x800c4301},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_MIXERPARAMS", 0x800c4806},
+{"linux/ncp_fs.h", "NCP_IOC_GETROOT", 0x800c6e08},
+{"linux/if_ppp.h", "PPPIOCSCOMPRESS", 0x800c744d},
+{"linux/videodev.h", "VIDIOCSPICT", 0x800e7607},
+{"linux/videodev.h", "VIDIOCMCAPTURE", 0x80107613},
+{"linux/fd.h", "FDSETMAXERRS", 0x8014024c},
+{"asm/ioctls.h", "TCSETA", 0x80147418},
+{"asm/termios.h", "TCSETA", 0x80147418},
+{"asm/ioctls.h", "TCSETAW", 0x80147419},
+{"asm/termios.h", "TCSETAW", 0x80147419},
+{"asm/ioctls.h", "TCSETAF", 0x8014741c},
+{"asm/termios.h", "TCSETAF", 0x8014741c},
+{"linux/videodev.h", "VIDIOCSFBUF", 0x8014760c},
+{"linux/fd.h", "FDSETPRM", 0x801c0242},
+{"linux/fd.h", "FDDEFPRM", 0x801c0243},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_FSKTXREQUEST", 0x80204800},
+{"linux/hfmodem.h", "HFMODEM_IOCTL_FSKRXREQUEST", 0x80204801},
+{"linux/if_ppp.h", "PPPIOCSXASYNCMAP", 0x8020744f},
+{"linux/videodev.h", "VIDIOCSWIN", 0x8020760a},
+{"linux/mc146818rtc.h", "RTC_ALM_SET", 0x80247007},
+{"linux/mc146818rtc.h", "RTC_SET_TIME", 0x8024700a},
+{"linux/videodev.h", "VIDIOCSAUDIO", 0x80247611},
+{"asm/ioctls.h", "TCSETS", 0x802c7414},
+{"asm/termios.h", "TCSETS", 0x802c7414},
+{"asm/ioctls.h", "TCSETSW", 0x802c7415},
+{"asm/termios.h", "TCSETSW", 0x802c7415},
+{"asm/ioctls.h", "TCSETSF", 0x802c7416},
+{"asm/termios.h", "TCSETSF", 0x802c7416},
+{"linux/smb_fs.h", "SMB_IOC_NEWCONN", 0x802c7502},
+{"linux/videodev.h", "VIDIOCSTUNER", 0x80347605},
+{"linux/fd.h", "FDSETDRVPRM", 0x80580290},
+{"linux/joystick.h", "JSIOCSCORR", 0x80906a21},
+{"linux/capi.h", "CAPI_GET_MANUFACTURER", 0xc0044306},
+{"linux/capi.h", "CAPI_GET_SERIAL", 0xc0044308},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_VOLUME", 0xc0044d00},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_BASS", 0xc0044d01},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_TREBLE", 0xc0044d02},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SYNTH", 0xc0044d03},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_PCM", 0xc0044d04},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SPEAKER", 0xc0044d05},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE", 0xc0044d06},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MIC", 0xc0044d07},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_CD", 0xc0044d08},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IMIX", 0xc0044d09},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ALTPCM", 0xc0044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECLEV", 0xc0044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IGAIN", 0xc0044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_OGAIN", 0xc0044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE1", 0xc0044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE2", 0xc0044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE3", 0xc0044d10},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MUTE", 0xc0044d1f},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ENHANCE", 0xc0044d1f},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LOUD", 0xc0044d1f},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECSRC", 0xc0044dff},
+{"linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", 0xc0049364},
+{"linux/capi.h", "CAPI_MANUFACTURER_CMD", 0xc0084320},
+{"linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", 0xc0086e0a},
+{"linux/if_ppp.h", "PPPIOCGNPMODE", 0xc008744c},
+{"linux/mtio.h", "MTIOCFTFORMAT", 0xc00c6d0a},
+{"linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", 0xc00c6e09},
+{"linux/capi.h", "CAPI_GET_VERSION", 0xc0104307},
+{"linux/mtio.h", "MTIOCRDFTSEG", 0xc0106d06},
+{"linux/mtio.h", "MTIOCWRFTSEG", 0xc0106d07},
+{"linux/mtio.h", "MTIOCFTCMD", 0xc0206d0b},
+{"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", 0xc0286e04},
+{"linux/videodev.h", "VIDIOCGCHAN", 0xc0307602},
+{"linux/videodev.h", "VIDIOCGTUNER", 0xc0347604},
+{"linux/capi.h", "CAPI_GET_PROFILE", 0xc0404309},
+{"linux/isdn_ppp.h", "PPPIOCGCALLINFO", 0xc0887480},
diff --git a/linux/powerpc/ioctlent.sh b/linux/powerpc/ioctlent.sh
new file mode 100644
index 000000000..dd5fd9da8
--- /dev/null
+++ b/linux/powerpc/ioctlent.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+# All rights reserved.
+#
+# Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+# Files to find.
+file_find='asm/*.h linux/*.h scsi/*.h'
+
+# Files to stop.
+file_stop='asm/byteorder.h linux/config.h linux/pci.h linux/xd.h'
+
+# Defs to find.
+# Work on the kernel source to convert all to df_iowr.
+# Don't know how to find low-numbered ioctls in linux/mc146818rtc.h.
+df_name='^[ ]*#[ ]*define[ ]+[A-Z_][A-Z0-9_]*[ ]+'
+df_iowr='_IO|_IOR|_IOW|_IOWR'
+df_NNNN='0[Xx](03|06|22|46|4B|4C|53|54|56|89|90)[0-9A-Fa-f][0-9A-Fa-f]'
+df_4359='0[Xx]4359[0-9A-Fa-f][0-9A-Fa-f]' # linux/cyclades.h
+df_470N='470[0-9]' # linux/fs.h (only in 1.2.13)
+df_smix='MIXER_READ|MIXER_WRITE' # linux/soundcard.h
+df_12NN='12[3-4][0-9]' # linux/umsdos_fs.h (only in 1.2.13)
+df_tail='([() ]|$)'
+def_find="$df_name($df_iowr|$df_NNNN|$df_4359|$df_470N|$df_smix|$df_12NN)$df_tail"
+
+# Defs to stop.
+ds_tail='_MAGIC|_PATCH'
+ds_fdmp='FD(DEF|GET|SET)MEDIAPRM' # linux/fd.h aliases (only in 1.2.13)
+ds_mtio='MTIOC(GET|SET)CONFIG' # linux/mtio.h needs config (only in 1.2.13)
+def_stop="$ds_tail|$ds_fdmp|$ds_mtio"
+
+# Validate arg count.
+if [ $# -ne 1 ]
+then
+ echo "usage: $0 include-directory" >&2
+ exit 1
+fi
+
+# Grep through the files.
+(
+ # Construct list: find files minus stop files.
+ cd $1 || exit
+ file_list=`(ls $file_find $file_stop $file_stop 2>/dev/null) | sort | uniq -u`
+
+ # Grep matching #define lines.
+ # Transform to C structure form.
+ # Filter out stop list.
+ egrep "$def_find" $file_list |
+ sed -n -e 's/^\(.*\):#[ ]*define[ ]*\([A-Z_][A-Z0-9_]*\).*$/ { "\1", "\2", \2 },/p' |
+ egrep -v "$def_stop"
+) > ioctlent.tmp
+
+# Generate the output file.
+echo '/* This file is automatically generated by ioctlent.sh */'
+echo
+echo '#include <sys/types.h>'
+echo
+echo '/* Needed for <linux/baycom.h> */'
+echo '#define BAYCOM_DEBUG'
+echo
+echo '/* Needed for <linux/cyclades.h> */'
+echo '#include <linux/termios.h>'
+echo '#include <linux/tqueue.h>'
+echo
+awk '{ print "#include <" substr($2, 2, length($2) - 3) ">" }' ioctlent.tmp | sort -u
+echo
+echo 'struct ioctlent ioctlent [] ='
+echo '{'
+cat ioctlent.tmp
+echo '};'
+
+# Clean up.
+rm -f ioctlent.tmp
diff --git a/linux/powerpc/signalent.h b/linux/powerpc/signalent.h
new file mode 100644
index 000000000..e2c13374e
--- /dev/null
+++ b/linux/powerpc/signalent.h
@@ -0,0 +1,32 @@
+ "SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGUNUSED", /* 31 */
diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h
new file mode 100644
index 000000000..9c22520c8
--- /dev/null
+++ b/linux/powerpc/syscallent.h
@@ -0,0 +1,338 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+ { 5, 0, printargs, "SYS_0" }, /* 0 */
+ { 1, TP, sys_exit, "exit" }, /* 1 */
+ { 0, TP, sys_fork, "fork" }, /* 2 */
+ { 3, TF, sys_read, "read" }, /* 3 */
+ { 3, TF, sys_write, "write" }, /* 4 */
+ { 3, TF, sys_open, "open" }, /* 5 */
+ { 1, 0, sys_close, "close" }, /* 6 */
+ { 3, TP, printargs, "waitpid" }, /* 7 */
+ { 2, TF, printargs, "creat" }, /* 8 */
+ { 2, TF, sys_link, "link" }, /* 9 */
+ { 1, TF, sys_unlink, "unlink" }, /* 10 */
+ { 3, TF|TP, sys_execve, "execve" }, /* 11 */
+ { 1, TF, sys_chdir, "chdir" }, /* 12 */
+ { 1, 0, sys_time, "time" }, /* 13 */
+ { 3, TF, sys_mknod, "mknod" }, /* 14 */
+ { 2, TF, sys_chmod, "chmod" }, /* 15 */
+ { 3, TF, printargs, "lchown" }, /* 16 */
+ { 5, 0, printargs, "break" }, /* 17 */
+ { 2, TF, sys_stat, "oldstat" }, /* 18 */
+ { 3, TF, sys_lseek, "lseek" }, /* 19 */
+ { 0, 0, sys_getpid, "getpid" }, /* 20 */
+ { 5, TF, sys_mount, "mount" }, /* 21 */
+ { 1, 0, sys_umount, "umount" }, /* 22 */
+ { 1, 0, sys_setuid, "setuid" }, /* 23 */
+ { 0, 0, sys_getuid, "getuid" }, /* 24 */
+ { 1, 0, sys_stime, "stime" }, /* 25 */
+ { 4, 0, sys_ptrace, "ptrace" }, /* 26 */
+ { 5, 0, printargs, "alarm" }, /* 27 */
+ { 2, 0, sys_fstat, "oldfstat" }, /* 28 */
+ { 0, 0, printargs, "pause" }, /* 29 */
+ { 2, 0, sys_utimes, "utime" }, /* 30 */
+ { 5, 0, printargs, "stty" }, /* 31 */
+ { 5, 0, printargs, "gtty" }, /* 32 */
+ { 2, TF, sys_access, "access" }, /* 33 */
+ { 5, 0, printargs, "nice" }, /* 34 */
+ { 5, 0, printargs, "ftime" }, /* 35 */
+ { 0, 0, sys_sync, "sync" }, /* 36 */
+ { 2, TS, sys_kill, "kill" }, /* 37 */
+ { 2, TF, sys_rename, "rename" }, /* 38 */
+ { 2, TF, sys_mkdir, "mkdir" }, /* 39 */
+ { 1, TF, sys_rmdir, "rmdir" }, /* 40 */
+ { 1, 0, sys_dup, "dup" }, /* 41 */
+ { 1, 0, sys_pipe, "pipe" }, /* 42 */
+ { 1, 0, sys_times, "times" }, /* 43 */
+ { 5, 0, printargs, "prof" }, /* 44 */
+ { 1, 0, sys_brk, "brk" }, /* 45 */
+ { 1, 0, sys_setgid, "setgid" }, /* 46 */
+ { 0, 0, printargs, "getgid" }, /* 47 */
+ { 5, 0, printargs, "signal" }, /* 48 */
+ { 0, 0, printargs, "geteuid" }, /* 49 */
+ { 0, 0, printargs, "getegid" }, /* 50 */
+ { 1, TF, sys_acct, "acct" }, /* 51 */
+ { 2, 0, printargs, "umount2" }, /* 52 */
+ { 5, 0, printargs, "lock" }, /* 53 */
+ { 3, 0, sys_ioctl, "ioctl" }, /* 54 */
+ { 3, 0, sys_fcntl, "fcntl" }, /* 55 */
+ { 5, 0, printargs, "mpx" }, /* 56 */
+ { 2, 0, sys_setpgid, "setpgid" }, /* 57 */
+ { 2, 0, printargs, "ulimit" }, /* 58 */
+ { 1, 0, printargs, "oldolduname" }, /* 59 */
+ { 1, 0, sys_umask, "umask" }, /* 60 */
+ { 1, TF, sys_chroot, "chroot" }, /* 61 */
+ { 2, 0, sys_ustat, "ustat" }, /* 62 */
+ { 2, 0, sys_dup2, "dup2" }, /* 63 */
+ { 0, 0, printargs, "getppid" }, /* 64 */
+ { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */
+ { 0, 0, sys_setsid, "setsid" }, /* 66 */
+ { 3, TS, sys_sigaction, "sigaction" }, /* 67 */
+ { 5, 0, printargs, "sgetmask" }, /* 68 */
+ { 5, 0, printargs, "ssetmask" }, /* 69 */
+ { 2, 0, sys_setreuid, "setreuid" }, /* 70 */
+ { 2, 0, sys_setregid, "setregid" }, /* 71 */
+ { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */
+ { 1, TS, sys_sigpending, "sigpending" }, /* 73 */
+ { 2, 0, sys_sethostname, "sethostname" }, /* 74 */
+ { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */
+ { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */
+ { 2, 0, sys_getrusage, "getrusage" }, /* 77 */
+ { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */
+ { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */
+ { 2, 0, sys_getgroups, "getgroups" }, /* 80 */
+ { 2, 0, sys_setgroups, "setgroups" }, /* 81 */
+ { 5, 0, sys_select, "select" }, /* 82 */
+ { 2, TF, sys_symlink, "symlink" }, /* 83 */
+ { 2, TF, sys_lstat, "oldlstat" }, /* 84 */
+ { 3, TF, sys_readlink, "readlink" }, /* 85 */
+ { 1, 0, sys_uselib, "uselib" }, /* 86 */
+ { 1, 0, sys_swapon, "swapon" }, /* 87 */
+ { 3, 0, sys_reboot, "reboot" }, /* 88 */
+ { 1, 0, printargs, "readdir" }, /* 89 */
+ { 1, 0, sys_mmap, "mmap" }, /* 90 */
+ { 2, 0, sys_munmap, "munmap" }, /* 91 */
+ { 2, TF, sys_truncate, "truncate" }, /* 92 */
+ { 2, 0, sys_ftruncate, "ftruncate" }, /* 93 */
+ { 2, 0, sys_fchmod, "fchmod" }, /* 94 */
+ { 3, 0, sys_fchown, "fchown" }, /* 95 */
+ { 2, 0, sys_getpriority, "getpriority" }, /* 96 */
+ { 3, 0, sys_setpriority, "setpriority" }, /* 97 */
+ { 5, 0, printargs, "profil" }, /* 98 */
+ { 2, TF, sys_statfs, "statfs" }, /* 99 */
+ { 2, 0, sys_fstatfs, "fstatfs" }, /* 100 */
+ { 5, 0, printargs, "ioperm" }, /* 101 */
+ { 5, 0, printargs, "socketcall" }, /* 102 */
+ { 3, 0, sys_syslog, "syslog" }, /* 103 */
+ { 3, 0, sys_setitimer, "setitimer" }, /* 104 */
+ { 2, 0, sys_getitimer, "getitimer" }, /* 105 */
+ { 2, TF, sys_stat, "stat" }, /* 106 */
+ { 2, TF, sys_lstat, "lstat" }, /* 107 */
+ { 2, 0, sys_fstat, "fstat" }, /* 108 */
+ { 1, 0, printargs, "olduname" }, /* 109 */
+ { 5, 0, printargs, "iopl" }, /* 110 */
+ { 0, 0, sys_vhangup, "vhangup" }, /* 111 */
+ { 0, 0, sys_idle, "idle" }, /* 112 */
+ { 5, 0, printargs, "vm86" }, /* 113 */
+ { 4, TP, sys_wait4, "wait4" }, /* 114 */
+ { 1, 0, sys_swapoff, "swapoff" }, /* 115 */
+ { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */
+ { 5, 0, printargs, "ipc" }, /* 117 */
+ { 1, 0, sys_fsync, "fsync" }, /* 118 */
+ { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */
+ { 2, TP, sys_clone, "clone" }, /* 120 */
+ { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */
+ { 1, 0, sys_uname, "uname" }, /* 122 */
+ { 5, 0, printargs, "modify_ldt" }, /* 123 */
+ { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */
+ { 3, 0, sys_mprotect, "mprotect" }, /* 125 */
+ { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */
+ { 2, 0, sys_create_module, "create_module" }, /* 127 */
+ { 4, 0, sys_init_module, "init_module" }, /* 128 */
+ { 1, 0, sys_delete_module, "delete_module" }, /* 129 */
+ { 1, 0, sys_get_kernel_syms, "get_kernel_syms" }, /* 130 */
+ { 4, 0, sys_quotactl, "quotactl" }, /* 131 */
+ { 1, 0, sys_getpgid, "getpgid" }, /* 132 */
+ { 1, TF, sys_fchdir, "fchdir" }, /* 133 */
+ { 0, 0, sys_bdflush, "bdflush" }, /* 134 */
+ { 5, 0, sys_sysfs, "sysfs" }, /* 135 */
+ { 1, 0, sys_personality, "personality" }, /* 136 */
+ { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */
+ { 1, 0, sys_setfsuid, "setfsuid" }, /* 138 */
+ { 1, 0, sys_setfsgid, "setfsgid" }, /* 139 */
+ { 5, TF, printargs, "_llseek" }, /* 140 */
+ { 3, 0, sys_getdents, "getdents" }, /* 141 */
+ { 5, 0, printargs, "_newselect" }, /* 142 */
+ { 2, 0, sys_flock, "flock" }, /* 143 */
+ { 3, 0, sys_msync, "msync" }, /* 144 */
+ { 3, 0, sys_readv, "readv" }, /* 145 */
+ { 3, 0, sys_writev, "writev" }, /* 146 */
+ { 1, 0, sys_getsid, "getsid" }, /* 147 */
+ { 5, 0, printargs, "fdatasync" }, /* 148 */
+ { 5, 0, printargs, "_sysctl" }, /* 149 */
+ { 2, 0, sys_mlock, "mlock" }, /* 150 */
+ { 2, 0, sys_munlock, "munlock" }, /* 151 */
+ { 1, 0, sys_mlockall, "mlockall" }, /* 152 */
+ { 1, 0, sys_munlockall, "munlockall" }, /* 153 */
+ { 2, 0, sys_sched_setparam, "sched_setparam" }, /* 154 */
+ { 2, 0, sys_sched_getparam, "sched_getparam" }, /* 155 */
+ { 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 156 */
+ { 2, 0, sys_sched_getscheduler, "sched_getscheduler" }, /* 157 */
+ { 0, 0, sys_sched_yield, "sched_yield" }, /* 158 */
+ { 5, 0, printargs, "SYS_189" }, /* 159 */
+ { 5, 0, printargs, "SYS_189" }, /* 160 */
+ { 5, 0, printargs, "SYS_189" }, /* 161 */
+ { 2, 0, sys_nanosleep, "nanosleep" }, /* 162 */
+ { 4, 0, printargs, "mremap" }, /* 163 */
+ { 3, 0, printargs, "setresuid" }, /* 164 */
+ { 3, 0, printargs, "getresuid" }, /* 165 */
+ { 5, 0, sys_query_module, "query_module" }, /* 166 */
+ { 5, 0, printargs, "poll" }, /* 167 */
+ { 5, 0, printargs, "nfsservctl" }, /* 168 */
+ { 3, 0, printargs, "setresgid" }, /* 169 */
+ { 3, 0, printargs, "getresgid" }, /* 170 */
+ { 5, 0, printargs, "prctl" }, /* 171 */
+ { 1, 0, printargs, "rt_sigreturn" }, /* 172 */
+ { 4, 0, printargs, "rt_sigaction" }, /* 173 */
+ { 4, 0, printargs, "rt_sigprocmask" }, /* 174 */
+ { 2, 0, printargs, "rt_sigpending" }, /* 175 */
+ { 4, 0, printargs, "rt_sigtimedwait" }, /* 176 */
+ { 3, 0, printargs, "rt_sigqueueinfo" }, /* 177 */
+ { 2, 0, printargs, "rt_sigsuspend" }, /* 178 */
+ { 5, 0, printargs, "pread" }, /* 179 */
+ { 5, 0, printargs, "pwrite" }, /* 180 */
+ { 3, TF, sys_chown, "chown" }, /* 181 */
+ { 5, 0, printargs, "getcwd" }, /* 182 */
+ { 2, 0, sys_capget, "capget" }, /* 183 */
+ { 2, 0, sys_capset, "capset" }, /* 184 */
+ { 3, 0, printargs, "sigaltstack" }, /* 185 */
+ { 5, 0, printargs, "sendfile" }, /* 186 */
+ { 5, 0, printargs, "streams1" }, /* 187 */
+ { 5, 0, printargs, "streams2" }, /* 188 */
+ { 5, 0, printargs, "SYS_189" }, /* 189 */
+ { 5, 0, printargs, "SYS_190" }, /* 190 */
+ { 5, 0, printargs, "SYS_191" }, /* 191 */
+ { 5, 0, printargs, "SYS_192" }, /* 192 */
+ { 5, 0, printargs, "SYS_193" }, /* 193 */
+ { 5, 0, printargs, "SYS_194" }, /* 194 */
+ { 5, 0, printargs, "SYS_195" }, /* 195 */
+ { 5, 0, printargs, "SYS_196" }, /* 196 */
+ { 5, 0, printargs, "SYS_197" }, /* 197 */
+ { 5, 0, printargs, "SYS_198" }, /* 198 */
+ { 5, 0, printargs, "SYS_199" }, /* 199 */
+ { 5, 0, printargs, "SYS_200" }, /* 200 */
+ { 5, 0, printargs, "SYS_201" }, /* 201 */
+ { 5, 0, printargs, "SYS_202" }, /* 202 */
+ { 5, 0, printargs, "SYS_203" }, /* 203 */
+ { 5, 0, printargs, "SYS_204" }, /* 204 */
+ { 5, 0, printargs, "SYS_205" }, /* 205 */
+ { 5, 0, printargs, "SYS_206" }, /* 206 */
+ { 5, 0, printargs, "SYS_207" }, /* 207 */
+ { 5, 0, printargs, "SYS_208" }, /* 208 */
+ { 5, 0, printargs, "SYS_209" }, /* 209 */
+ { 5, 0, printargs, "SYS_210" }, /* 210 */
+ { 5, 0, printargs, "SYS_211" }, /* 211 */
+ { 5, 0, printargs, "SYS_212" }, /* 212 */
+ { 5, 0, printargs, "SYS_213" }, /* 213 */
+ { 5, 0, printargs, "SYS_214" }, /* 214 */
+ { 5, 0, printargs, "SYS_215" }, /* 215 */
+ { 5, 0, printargs, "SYS_216" }, /* 216 */
+ { 5, 0, printargs, "SYS_217" }, /* 217 */
+ { 5, 0, printargs, "SYS_218" }, /* 218 */
+ { 5, 0, printargs, "SYS_219" }, /* 219 */
+ { 5, 0, printargs, "SYS_220" }, /* 220 */
+ { 5, 0, printargs, "SYS_221" }, /* 221 */
+ { 5, 0, printargs, "SYS_222" }, /* 222 */
+ { 5, 0, printargs, "SYS_223" }, /* 223 */
+ { 5, 0, printargs, "SYS_224" }, /* 224 */
+ { 5, 0, printargs, "SYS_225" }, /* 225 */
+ { 5, 0, printargs, "SYS_226" }, /* 226 */
+ { 5, 0, printargs, "SYS_227" }, /* 227 */
+ { 5, 0, printargs, "SYS_228" }, /* 228 */
+ { 5, 0, printargs, "SYS_229" }, /* 229 */
+ { 5, 0, printargs, "SYS_230" }, /* 230 */
+ { 5, 0, printargs, "SYS_231" }, /* 231 */
+ { 5, 0, printargs, "SYS_232" }, /* 232 */
+ { 5, 0, printargs, "SYS_233" }, /* 233 */
+ { 5, 0, printargs, "SYS_234" }, /* 234 */
+ { 5, 0, printargs, "SYS_235" }, /* 235 */
+ { 5, 0, printargs, "SYS_236" }, /* 236 */
+ { 5, 0, printargs, "SYS_237" }, /* 237 */
+ { 5, 0, printargs, "SYS_238" }, /* 238 */
+ { 5, 0, printargs, "SYS_239" }, /* 239 */
+ { 5, 0, printargs, "SYS_240" }, /* 240 */
+ { 5, 0, printargs, "SYS_241" }, /* 241 */
+ { 5, 0, printargs, "SYS_242" }, /* 242 */
+ { 5, 0, printargs, "SYS_243" }, /* 243 */
+ { 5, 0, printargs, "SYS_244" }, /* 244 */
+ { 5, 0, printargs, "SYS_245" }, /* 245 */
+ { 5, 0, printargs, "SYS_246" }, /* 246 */
+ { 5, 0, printargs, "SYS_247" }, /* 247 */
+ { 5, 0, printargs, "SYS_248" }, /* 248 */
+ { 5, 0, printargs, "SYS_249" }, /* 249 */
+ { 5, 0, printargs, "SYS_250" }, /* 250 */
+ { 5, 0, printargs, "SYS_251" }, /* 251 */
+ { 5, 0, printargs, "SYS_252" }, /* 252 */
+ { 5, 0, printargs, "SYS_253" }, /* 253 */
+ { 5, 0, printargs, "SYS_254" }, /* 254 */
+ { 5, 0, printargs, "SYS_255" }, /* 255 */
+
+ { 8, 0, printargs, "socket_subcall"}, /* 256 */
+ { 3, TN, sys_socket, "socket" }, /* 257 */
+ { 3, TN, sys_bind, "bind" }, /* 258 */
+ { 3, TN, sys_connect, "connect" }, /* 259 */
+ { 2, TN, sys_listen, "listen" }, /* 260 */
+ { 3, TN, sys_accept, "accept" }, /* 261 */
+ { 3, TN, sys_getsockname, "getsockname" }, /* 262 */
+ { 3, TN, sys_getpeername, "getpeername" }, /* 263 */
+ { 4, TN, sys_socketpair, "socketpair" }, /* 264 */
+ { 4, TN, sys_send, "send" }, /* 265 */
+ { 4, TN, sys_recv, "recv" }, /* 266 */
+ { 6, TN, sys_sendto, "sendto" }, /* 267 */
+ { 6, TN, sys_recvfrom, "recvfrom" }, /* 268 */
+ { 2, TN, sys_shutdown, "shutdown" }, /* 269 */
+ { 5, TN, sys_setsockopt, "setsockopt" }, /* 270 */
+ { 5, TN, sys_getsockopt, "getsockopt" }, /* 271 */
+ { 5, TN, sys_sendmsg, "sendmsg" }, /* 272 */
+ { 5, TN, sys_recvmsg, "recvmsg" }, /* 273 */
+ { 5, 0, printargs, "SYS_274" }, /* 274 */
+ { 5, 0, printargs, "SYS_275" }, /* 275 */
+
+ { 4, 0, printargs, "ipc_subcall" }, /* 276 */
+ { 4, TI, printargs, "semop" }, /* 277 */
+ { 4, TI, sys_semget, "semget" }, /* 278 */
+ { 4, TI, sys_semctl, "semctl" }, /* 279 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 280 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 281 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 282 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 283 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 284 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 285 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 286 */
+ { 4, TI, sys_msgsnd, "msgsnd" }, /* 287 */
+ { 4, TI, sys_msgrcv, "msgrcv" }, /* 288 */
+ { 4, TI, sys_msgget, "msgget" }, /* 289 */
+ { 4, TI, sys_msgctl, "msgctl" }, /* 290 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 291 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 292 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 293 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 294 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 295 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 296 */
+ { 4, TI, sys_shmat, "shmat" }, /* 297 */
+ { 4, TI, sys_shmdt, "shmdt" }, /* 298 */
+ { 4, TI, sys_shmget, "shmget" }, /* 299 */
+ { 4, TI, sys_shmctl, "shmctl" }, /* 300 */
+ { 5, 0, printargs, "SYS_301" }, /* 301 */
+ { 5, 0, printargs, "SYS_302" }, /* 302 */
+ { 5, 0, printargs, "SYS_303" }, /* 303 */
+ { 5, 0, printargs, "SYS_304" }, /* 304 */
+ { 5, 0, printargs, "SYS_305" }, /* 305 */
diff --git a/linux/powerpc/syscallent.sh b/linux/powerpc/syscallent.sh
new file mode 100644
index 000000000..ea0e0f7de
--- /dev/null
+++ b/linux/powerpc/syscallent.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+cat $* |
+ sed -n 's/^#[ ]*define[ ][ ]*__NR_\([^ ]*\)[ ]*[^0-9]*\([0-9]*\).*$/\1 \2/p' |
+ sort +1n |
+ awk '
+ BEGIN {
+ tabs = "\t\t\t\t\t\t\t\t"
+ call = -1;
+ }
+ {
+ while (++call < $2) {
+ f = "printargs"
+ n = "SYS_" call
+ s = "\t{ -1,\t0,\t"
+ s = s f ","
+ s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
+ s = s "\"" n "\""
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
+ s = s "}, /* " call " */"
+ print s
+ }
+ f = "sys_" $1
+ n = $1
+ s = "\t{ -1,\t0,\t"
+ s = s f ","
+ s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
+ s = s "\"" n "\""
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
+ s = s "}, /* " call " */"
+ print s
+ }
+ END {
+ limit = call + 100
+ while (++call < limit) {
+ f = "printargs"
+ n = "SYS_" call
+ s = "\t{ -1,\t0,\t"
+ s = s f ","
+ s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
+ s = s "\"" n "\""
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
+ s = s "}, /* " call " */"
+ print s
+ }
+ }
+ '
diff --git a/linux/signalent.h b/linux/signalent.h
new file mode 100644
index 000000000..e2c13374e
--- /dev/null
+++ b/linux/signalent.h
@@ -0,0 +1,32 @@
+ "SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGUNUSED", /* 31 */
diff --git a/linux/sparc/Makefile.in b/linux/sparc/Makefile.in
new file mode 100644
index 000000000..4c5344df8
--- /dev/null
+++ b/linux/sparc/Makefile.in
@@ -0,0 +1,57 @@
+#
+# $Id$
+#
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+CC = @CC@
+CPP = @CPP@
+SHELL = /bin/sh
+
+DEFS = @DEFS@
+LDLIBS = @LIBS@
+
+CFLAGS = -g
+LDFLAGS = -g
+WARNFLAGS = @WARNFLAGS@
+
+CPPFLAGS =
+INCLUDES = -I. -I.. -I$(srcdir)/.. -I../.. -I$(srcdir)
+
+includedir = @includedir@
+
+all: ioctlent.h errnoent.h signalent.h syscallent.h
+
+ioctlent.raw: ioctlent.sh
+ $(SHELL) $(srcdir)/ioctlent.sh $(includedir) >$@
+
+ioctlent.h: ioctlent.raw ioctlsort
+ ./ioctlsort >$@
+
+ioctlsort: ioctlsort.o
+ $(CC) $(LDFLAGS) ioctlsort.o -o ioctlsort
+
+ioctlsort.o: ../../ioctlsort.c
+ $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $(srcdir)/../../ioctlsort.c
+
+ioctlsort.o: ioctlent.raw
+
+errnoent.h: ../../errnoent.sh $(includedir)/asm/errno.h
+ $(SHELL) $(srcdir)/../../errnoent.sh $(includedir)/asm/errno.h >$@
+
+signalent.h: ../../signalent.sh $(includedir)/asm/signal.h
+ $(SHELL) $(srcdir)/../../signalent.sh $(includedir)/asm/signal.h >$@
+
+#syscallent.h: ../../syscallent.sh $(includedir)/sys/syscall.h
+syscallent.h:
+ $(SHELL) $(srcdir)/../../syscallent.sh $(includedir)/sys/syscall.h >$@
+
+clean:
+ rm -f ioctlent.c *.raw *.tmp *.o ioctlsort
+
+distclean: clean
+ rm -f Makefile
+
+maintainer-clean: distclean
+ rm -f ioctlent.h errnoent.h signalent.h
diff --git a/linux/sparc/dummy2.h b/linux/sparc/dummy2.h
new file mode 100644
index 000000000..8ff464b9e
--- /dev/null
+++ b/linux/sparc/dummy2.h
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+/* still unfinished */
+
+#define solaris_sysmp printargs
+#define solaris_sginap printargs
+#define solaris_sgikopt printargs
+#define solaris_sysmips printargs
+#define solaris_sigreturn printargs
+#define solaris_recvmsg printargs
+#define solaris_sendmsg printargs
+#define solaris_nfssvc printargs
+#define solaris_getfh printargs
+#define solaris_async_daemon printargs
+#define solaris_exportfs printargs
+#define solaris_BSD_getime printargs
+#define solaris_sproc printargs
+#define solaris_procblk printargs
+#define solaris_sprocsp printargs
+#define solaris_msync printargs
+#define solaris_madvise printargs
+#define solaris_pagelock printargs
+#define solaris_quotactl printargs
+#define solaris_cacheflush printargs
+#define solaris_cachectl printargs
+#define solaris_nuname printargs
+#define solaris_sigpoll printargs
+#define solaris_swapctl printargs
+#define solaris_sigstack printargs
+#define solaris_sigsendset printargs
+#define solaris_priocntl printargs
+#define solaris_ksigqueue printargs
+#define solaris_lwp_sema_wait printargs
+#define solaris_memcntl printargs
+#define solaris_syscall printargs
+#define solaris_clocal printargs
+#define solaris_syssun printargs
+#define solaris_sysi86 printargs
+#define solaris_sysmachine printargs
+#define solaris_plock printargs
+#define solaris_pathconf printargs
+#define solaris_sigtimedwait printargs
+#define solaris_ulimit printargs
+#define solaris_ptrace printargs
+#define solaris_stty printargs
+#define solaris_lwp_info printargs
+#define solaris_priocntlsys printargs
+#define solaris_hrtsys printargs
+#define solaris_xenix printargs
+#define solaris_statfs printargs
+#define solaris_fstatfs printargs
+#define solaris_statvfs printargs
+#define solaris_fstatvfs printargs
+#define solaris_fork1 printargs
+#define solaris_sigsendsys printargs
+#define solaris_gtty printargs
+#define solaris_vtrace printargs
+#define solaris_fpathconf printargs
+#define solaris_evsys printargs
+#define solaris_acct printargs
+#define solaris_exec printargs
+#define solaris_lwp_sema_post printargs
+#define solaris_nfssys printargs
+#define solaris_sigaltstack printargs
+#define solaris_uadmin printargs
+#define solaris_umount printargs
+#define solaris_modctl printargs
+#define solaris_acancel printargs
+#define solaris_async printargs
+#define solaris_evtrapret printargs
+#define solaris_lwp_create printargs
+#define solaris_lwp_exit printargs
+#define solaris_lwp_suspend printargs
+#define solaris_lwp_continue printargs
+#define solaris_lwp_kill printargs
+#define solaris_lwp_self printargs
+#define solaris_lwp_setprivate printargs
+#define solaris_lwp_getprivate printargs
+#define solaris_lwp_wait printargs
+#define solaris_lwp_mutex_unlock printargs
+#define solaris_lwp_mutex_lock printargs
+#define solaris_lwp_cond_wait printargs
+#define solaris_lwp_cond_signal printargs
+#define solaris_lwp_cond_broadcast printargs
+#define solaris_llseek printargs
+#define solaris_inst_sync printargs
+#define solaris_auditsys printargs
+#define solaris_processor_bind printargs
+#define solaris_processor_info printargs
+#define solaris_p_online printargs
+#define solaris_sigqueue printargs
+#define solaris_clock_gettime printargs
+#define solaris_clock_settime printargs
+#define solaris_clock_getres printargs
+#define solaris_nanosleep printargs
+#define solaris_timer_create printargs
+#define solaris_timer_delete printargs
+#define solaris_timer_settime printargs
+#define solaris_timer_gettime printargs
+#define solaris_timer_getoverrun printargs
+#define solaris_signal printargs
+#define solaris_sigset printargs
+#define solaris_sighold printargs
+#define solaris_sigrelse printargs
+#define solaris_sigignore printargs
+#define solaris_sigpause printargs
+#define solaris_msgctl printargs
+#define solaris_msgget printargs
+#define solaris_msgrcv printargs
+#define solaris_msgsnd printargs
+#define solaris_shmat printargs
+#define solaris_shmctl printargs
+#define solaris_shmdt printargs
+#define solaris_shmget printargs
+#define solaris_semctl printargs
+#define solaris_semget printargs
+#define solaris_semop printargs
+#define solaris_olduname printargs
+#define solaris_ustat printargs
+#define solaris_fusers printargs
+#define solaris_sysfs1 printargs
+#define solaris_sysfs2 printargs
+#define solaris_sysfs3 printargs
+
+/* like another call */
+#define solaris_lchown solaris_chown
+#define solaris_setuid solaris_close
+#define solaris_seteuid solaris_close
+#define solaris_setgid solaris_close
+#define solaris_setegid solaris_close
+#define solaris_vhangup solaris_close
+#define solaris_fdsync solaris_close
+#define solaris_sigfillset solaris_sigpending
+#define solaris_vfork solaris_fork
+#define solaris_ksigaction solaris_sigaction
+#define solaris_BSDgetpgrp solaris_getpgrp
+#define solaris_BSDsetpgrp solaris_setpgrp
+#define solaris_waitsys solaris_waitid
+
+/* printargs does the right thing */
+#define solaris_sync printargs
+#define solaris_profil printargs
+#define solaris_yield printargs
+#define solaris_pause printargs
+#define solaris_sethostid printargs
+
+/* subfunction entry points */
+#define solaris_pgrpsys printargs
+#define solaris_sigcall printargs
+#define solaris_msgsys printargs
+#define solaris_shmsys printargs
+#define solaris_semsys printargs
+#define solaris_utssys printargs
+#define solaris_sysfs printargs
+#define solaris_spcall printargs
+#define solaris_context printargs
+
+/* same as linux */
+#define solaris_exit sys_exit
+#define solaris_fork sys_fork
+#define solaris_read sys_read
+#define solaris_write sys_write
+#define solaris_close sys_close
+#define solaris_creat sys_creat
+#define solaris_link sys_link
+#define solaris_unlink sys_unlink
+#define solaris_chdir sys_chdir
+#define solaris_time sys_time
+#define solaris_chmod sys_chmod
+#define solaris_lseek sys_lseek
+#define solaris_stime sys_stime
+#define solaris_alarm sys_alarm
+#define solaris_utime sys_utime
+#define solaris_access sys_access
+#define solaris_nice sys_nice
+#define solaris_dup sys_dup
+#define solaris_pipe sys_pipe
+#define solaris_times sys_times
+#define solaris_execve sys_execve
+#define solaris_umask sys_umask
+#define solaris_chroot sys_chroot
+#define solaris_rmdir sys_rmdir
+#define solaris_mkdir sys_mkdir
+#define solaris_getdents sys_getdents
+#define solaris_poll sys_poll
+#define solaris_symlink sys_symlink
+#define solaris_readlink sys_readlink
+#define solaris_setgroups sys_setgroups
+#define solaris_getgroups sys_getgroups
+#define solaris_fchmod sys_fchmod
+#define solaris_fchown sys_fchown
+#define solaris_mprotect sys_mprotect
+#define solaris_munmap sys_munmap
+#define solaris_readv sys_readv
+#define solaris_writev sys_writev
+#define solaris_chown sys_chown
+#define solaris_rename sys_rename
+#define solaris_gettimeofday sys_gettimeofday
+#define solaris_getitimer sys_getitimer
+#define solaris_setitimer sys_setitimer
+#define solaris_brk sys_brk
+#define solaris_mmap sys_mmap
+#define solaris_getsid sys_getsid
+#define solaris_setsid sys_setsid
+#define solaris_getpgid sys_getpgid
+#define solaris_setpgid sys_setpgid
+#define solaris_getpgrp sys_getpgrp
+
+/* These are handled according to current_personality */
+#define solaris_xstat sys_xstat
+#define solaris_fxstat sys_fxstat
+#define solaris_lxstat sys_lxstat
+#define solaris_xmknod sys_xmknod
+#define solaris_stat sys_stat
+#define solaris_fstat sys_fstat
+#define solaris_lstat sys_lstat
+#define solaris_pread sys_pread
+#define solaris_pwrite sys_pwrite
+#define solaris_ioctl sys_ioctl
+#define solaris_mknod sys_mknod
+
+/* To be done */
+#define solaris_mount printargs
+#define solaris_sysinfo printargs
+#define solaris_sysconfig printargs
+#define solaris_getpmsg printargs
+#define solaris_putpmsg printargs
+#define solaris_wait printargs
+#define solaris_waitid printargs
+#define solaris_sigsuspend printargs
+#define solaris_setpgrp printargs
+#define solaris_getcontext printargs
+#define solaris_setcontext printargs
+#define solaris_getpid printargs
+#define solaris_getuid printargs
+#define solaris_kill printargs
+#define solaris_getgid printargs
+#define solaris_fcntl printargs
+#define solaris_getmsg printargs
+#define solaris_putmsg printargs
+#define solaris_sigprocmask printargs
+#define solaris_sigaction printargs
+#define solaris_sigpending printargs
+#define solaris_mincore printargs
+#define solaris_fchdir printargs
+#define solaris_setrlimit printargs
+#define solaris_getrlimit printargs
+#define solaris_uname printargs
+#define solaris_adjtime printargs
+#define solaris_fchroot printargs
+#define solaris_utimes printargs
+
+#if DONE
+#define solaris_open printargs
+#endif
diff --git a/linux/sparc/errnoent.h b/linux/sparc/errnoent.h
new file mode 100644
index 000000000..cca460edb
--- /dev/null
+++ b/linux/sparc/errnoent.h
@@ -0,0 +1,125 @@
+ "ERRNO_0", /* 0 */
+ "EPERM", /* 1 */
+ "ENOENT", /* 2 */
+ "ESRCH", /* 3 */
+ "EINTR", /* 4 */
+ "EIO", /* 5 */
+ "ENXIO", /* 6 */
+ "E2BIG", /* 7 */
+ "ENOEXEC", /* 8 */
+ "EBADF", /* 9 */
+ "ECHILD", /* 10 */
+ "EAGAIN", /* 11 */
+ "ENOMEM", /* 12 */
+ "EACCES", /* 13 */
+ "EFAULT", /* 14 */
+ "ENOTBLK", /* 15 */
+ "EBUSY", /* 16 */
+ "EEXIST", /* 17 */
+ "EXDEV", /* 18 */
+ "ENODEV", /* 19 */
+ "ENOTDIR", /* 20 */
+ "EISDIR", /* 21 */
+ "EINVAL", /* 22 */
+ "ENFILE", /* 23 */
+ "EMFILE", /* 24 */
+ "ENOTTY", /* 25 */
+ "ETXTBSY", /* 26 */
+ "EFBIG", /* 27 */
+ "ENOSPC", /* 28 */
+ "ESPIPE", /* 29 */
+ "EROFS", /* 30 */
+ "EMLINK", /* 31 */
+ "EPIPE", /* 32 */
+ "EDOM", /* 33 */
+ "ERANGE", /* 34 */
+ "EWOULDBLOCK", /* 35 */
+ "EINPROGRESS", /* 36 */
+ "EALREADY", /* 37 */
+ "ENOTSOCK", /* 38 */
+ "EDESTADDRREQ", /* 39 */
+ "EMSGSIZE", /* 40 */
+ "EPROTOTYPE", /* 41 */
+ "ENOPROTOOPT", /* 42 */
+ "EPROTONOSUPPORT", /* 43 */
+ "ESOCKTNOSUPPORT", /* 44 */
+ "EOPNOTSUPP", /* 45 */
+ "EPFNOSUPPORT", /* 46 */
+ "EAFNOSUPPORT", /* 47 */
+ "EADDRINUSE", /* 48 */
+ "EADDRNOTAVAIL", /* 49 */
+ "ENETDOWN", /* 50 */
+ "ENETUNREACH", /* 51 */
+ "ENETRESET", /* 52 */
+ "ECONNABORTED", /* 53 */
+ "ECONNRESET", /* 54 */
+ "ENOBUFS", /* 55 */
+ "EISCONN", /* 56 */
+ "ENOTCONN", /* 57 */
+ "ESHUTDOWN", /* 58 */
+ "ETOOMANYREFS", /* 59 */
+ "ETIMEDOUT", /* 60 */
+ "ECONNREFUSED", /* 61 */
+ "ELOOP", /* 62 */
+ "ENAMETOOLONG", /* 63 */
+ "EHOSTDOWN", /* 64 */
+ "EHOSTUNREACH", /* 65 */
+ "ENOTEMPTY", /* 66 */
+ "EPROCLIM", /* 67 */
+ "EUSERS", /* 68 */
+ "EDQUOT", /* 69 */
+ "ESTALE", /* 70 */
+ "EREMOTE", /* 71 */
+ "ENOSTR", /* 72 */
+ "ETIME", /* 73 */
+ "ENOSR", /* 74 */
+ "ENOMSG", /* 75 */
+ "EBADMSG", /* 76 */
+ "EIDRM", /* 77 */
+ "EDEADLK", /* 78 */
+ "ENOLCK", /* 79 */
+ "ENONET", /* 80 */
+ "ERREMOTE", /* 81 */
+ "ENOLINK", /* 82 */
+ "EADV", /* 83 */
+ "ESRMNT", /* 84 */
+ "ECOMM", /* 85 */
+ "EPROTO", /* 86 */
+ "EMULTIHOP", /* 87 */
+ "EDOTDOT", /* 88 */
+ "EREMCHG", /* 89 */
+ "ENOSYS", /* 90 */
+ "ESTRPIPE", /* 91 */
+ "EOVERFLOW", /* 92 */
+ "EBADFD", /* 93 */
+ "ECHRNG", /* 94 */
+ "EL2NSYNC", /* 95 */
+ "EL3HLT", /* 96 */
+ "EL3RST", /* 97 */
+ "ELNRNG", /* 98 */
+ "EUNATCH", /* 99 */
+ "ENOCSI", /* 100 */
+ "EL2HLT", /* 101 */
+ "EBADE", /* 102 */
+ "EBADR", /* 103 */
+ "EXFULL", /* 104 */
+ "ENOANO", /* 105 */
+ "EBADRQC", /* 106 */
+ "EBADSLT", /* 107 */
+ "EDEADLOCK", /* 108 */
+ "EBFONT", /* 109 */
+ "ELIBEXEC", /* 110 */
+ "ENODATA", /* 111 */
+ "ELIBBAD", /* 112 */
+ "ENOPKG", /* 113 */
+ "ELIBACC", /* 114 */
+ "ENOTUNIQ", /* 115 */
+ "ERESTART", /* 116 */
+ "EUCLEAN", /* 117 */
+ "ENOTNAM", /* 118 */
+ "ENAVAIL", /* 119 */
+ "EISNAM", /* 120 */
+ "EREMOTEIO", /* 121 */
+ "EILSEQ", /* 122 */
+ "ELIBMAX", /* 123 */
+ "ELIBSCN", /* 124 */
diff --git a/linux/sparc/errnoent1.h b/linux/sparc/errnoent1.h
new file mode 100644
index 000000000..4d750bdb2
--- /dev/null
+++ b/linux/sparc/errnoent1.h
@@ -0,0 +1 @@
+#include "../svr4/errnoent.h"
diff --git a/linux/sparc/gen.pl b/linux/sparc/gen.pl
new file mode 100644
index 000000000..1a320ee65
--- /dev/null
+++ b/linux/sparc/gen.pl
@@ -0,0 +1,38 @@
+open SPARC, "syscallent.h" || die "no puedo abrir el de la sparc";
+open ALPHA, "../alpha/syscallent.h" || die "no puedo abrir el de la alpha";
+open PC, "../syscallent.h" || die "no puedo abrir PC\n";
+
+while (<SPARC>) {
+ chop;
+ ($i1, $i2, $i3, $syscall, $syscall_name) = split;
+ $strn[$index] = $syscall_name;
+ $name[$index++] = $syscall;
+}
+
+while (<ALPHA>){
+ if (/\{/) {
+ ($i1, $n, $pr, $syscall) = split;
+ $par{$syscall} = $n;
+ $prr{$syscall} = $pr;
+ }
+}
+
+while (<PC>){
+ if (/\{/) {
+ ($i1, $n, $pr, $syscall) = split;
+ $par{$syscall} = $n;
+ $prr{$syscall} = $pr;
+ }
+}
+
+print "missing \n";
+
+for ($i = 0; $i < $index; $i++){
+ $x = $name[$i];
+ $y = $strn[$i];
+ $n = $par{$x};
+ $p = $prr{$x};
+ $j++;
+ print "\t{ $n\t$p\t$x\t$y },\t /* $j */\n";
+}
+
diff --git a/linux/sparc/ioctlent.h b/linux/sparc/ioctlent.h
new file mode 100644
index 000000000..64e0a8080
--- /dev/null
+++ b/linux/sparc/ioctlent.h
@@ -0,0 +1,600 @@
+{"asm/contregs.h", "AC_M_SFSR", 0x300},
+{"linux/ip_fw.h", "IP_FW_TYPE", 0x300},
+{"linux/quota.h", "Q_GETQUOTA", 0x300},
+{"linux/hdreg.h", "HDIO_GETGEO", 0x301},
+{"linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0x302},
+{"linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0x304},
+{"linux/hdreg.h", "HDIO_GET_IDENTITY", 0x307},
+{"linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0x308},
+{"linux/hdreg.h", "HDIO_GET_32BIT", 0x309},
+{"linux/hdreg.h", "HDIO_GET_NOWERR", 0x30a},
+{"linux/hdreg.h", "HDIO_GET_DMA", 0x30b},
+{"linux/hdreg.h", "HDIO_DRIVE_CMD", 0x31f},
+{"linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0x321},
+{"linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0x322},
+{"linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0x323},
+{"linux/hdreg.h", "HDIO_SET_32BIT", 0x324},
+{"linux/hdreg.h", "HDIO_SET_NOWERR", 0x325},
+{"linux/hdreg.h", "HDIO_SET_DMA", 0x326},
+{"linux/hdreg.h", "HDIO_SET_PIO_MODE", 0x327},
+{"asm/contregs.h", "AC_M_AFAR", 0x600},
+{"linux/quota.h", "Q_SYNC", 0x600},
+{"linux/lp.h", "LPCHAR", 0x601},
+{"linux/lp_m68k.h", "LPCHAR", 0x601},
+{"linux/lp.h", "LPTIME", 0x602},
+{"linux/lp_m68k.h", "LPTIME", 0x602},
+{"linux/lp.h", "LPABORT", 0x604},
+{"linux/lp_m68k.h", "LPABORT", 0x604},
+{"linux/lp.h", "LPSETIRQ", 0x605},
+{"linux/lp_m68k.h", "LPSETIRQ", 0x605},
+{"linux/lp.h", "LPGETIRQ", 0x606},
+{"linux/lp_m68k.h", "LPGETIRQ", 0x606},
+{"linux/lp.h", "LPWAIT", 0x608},
+{"linux/lp_m68k.h", "LPWAIT", 0x608},
+{"linux/lp.h", "LPCAREFUL", 0x609},
+{"linux/lp_m68k.h", "LPCAREFUL", 0x609},
+{"linux/lp.h", "LPABORTOPEN", 0x60a},
+{"linux/lp_m68k.h", "LPABORTOPEN", 0x60a},
+{"linux/lp.h", "LPGETSTATUS", 0x60b},
+{"linux/lp_m68k.h", "LPGETSTATUS", 0x60b},
+{"linux/lp.h", "LPRESET", 0x60c},
+{"linux/lp_m68k.h", "LPRESET", 0x60c},
+{"linux/lp.h", "LPGETSTATS", 0x60d},
+{"linux/lp.h", "LPGETFLAGS", 0x60e},
+{"linux/scc.h", "TIOCSCCCFG", 0x2200},
+{"linux/scc.h", "TIOCSCCINI", 0x2201},
+{"linux/scc.h", "TIOCCHANINI", 0x2202},
+{"linux/scc.h", "TIOCCHANMEM", 0x2210},
+{"linux/scc.h", "TIOCGKISS", 0x2282},
+{"linux/scc.h", "TIOCSKISS", 0x2283},
+{"linux/scc.h", "TIOCSCCSTAT", 0x2284},
+{"linux/fb.h", "FBIOGET_VSCREENINFO", 0x4600},
+{"linux/fb.h", "FBIOPUT_VSCREENINFO", 0x4601},
+{"linux/fb.h", "FBIOGET_FSCREENINFO", 0x4602},
+{"asm/fbio.h", "FBIOGETCMAP", 0x4604},
+{"linux/fb.h", "FBIOGETCMAP", 0x4604},
+{"asm/fbio.h", "FBIOPUTCMAP", 0x4605},
+{"linux/fb.h", "FBIOPUTCMAP", 0x4605},
+{"linux/fb.h", "FBIOPAN_DISPLAY", 0x4606},
+{"linux/fb.h", "FBIOGET_FCURSORINFO", 0x4607},
+{"linux/fb.h", "FBIOGET_VCURSORINFO", 0x4608},
+{"linux/fb.h", "FBIOPUT_VCURSORINFO", 0x4609},
+{"linux/fb.h", "FBIOGET_CURSORSTATE", 0x460a},
+{"linux/fb.h", "FBIOPUT_CURSORSTATE", 0x460b},
+{"linux/fb.h", "FBCMD_DRAWLINE", 0x4621},
+{"linux/fb.h", "FBCMD_MOVE", 0x4622},
+{"linux/kd.h", "KIOCSOUND", 0x4b2f},
+{"linux/kd.h", "KDMKTONE", 0x4b30},
+{"linux/kd.h", "KDGETLED", 0x4b31},
+{"linux/kd.h", "KDSETLED", 0x4b32},
+{"linux/kd.h", "KDGKBTYPE", 0x4b33},
+{"linux/kd.h", "KDADDIO", 0x4b34},
+{"linux/kd.h", "KDDELIO", 0x4b35},
+{"linux/kd.h", "KDENABIO", 0x4b36},
+{"linux/kd.h", "KDDISABIO", 0x4b37},
+{"linux/kd.h", "KDSETMODE", 0x4b3a},
+{"linux/kd.h", "KDGETMODE", 0x4b3b},
+{"linux/kd.h", "KDMAPDISP", 0x4b3c},
+{"linux/kd.h", "KDUNMAPDISP", 0x4b3d},
+{"linux/kd.h", "GIO_SCRNMAP", 0x4b40},
+{"linux/kd.h", "PIO_SCRNMAP", 0x4b41},
+{"linux/kd.h", "KDGKBMODE", 0x4b44},
+{"linux/kd.h", "KDSKBMODE", 0x4b45},
+{"linux/kd.h", "KDGKBENT", 0x4b46},
+{"linux/kd.h", "KDSKBENT", 0x4b47},
+{"linux/kd.h", "KDGKBSENT", 0x4b48},
+{"linux/kd.h", "KDSKBSENT", 0x4b49},
+{"linux/kd.h", "KDGKBDIACR", 0x4b4a},
+{"linux/kd.h", "KDSKBDIACR", 0x4b4b},
+{"linux/kd.h", "KDGETKEYCODE", 0x4b4c},
+{"linux/kd.h", "KDSETKEYCODE", 0x4b4d},
+{"linux/kd.h", "KDSIGACCEPT", 0x4b4e},
+{"linux/kd.h", "GIO_FONT", 0x4b60},
+{"linux/kd.h", "PIO_FONT", 0x4b61},
+{"linux/kd.h", "KDGKBMETA", 0x4b62},
+{"linux/kd.h", "KDSKBMETA", 0x4b63},
+{"linux/kd.h", "KDGKBLED", 0x4b64},
+{"linux/kd.h", "KDSKBLED", 0x4b65},
+{"linux/kd.h", "GIO_UNIMAP", 0x4b66},
+{"linux/kd.h", "PIO_UNIMAP", 0x4b67},
+{"linux/kd.h", "PIO_UNIMAPCLR", 0x4b68},
+{"linux/kd.h", "GIO_UNISCRNMAP", 0x4b69},
+{"linux/kd.h", "PIO_UNISCRNMAP", 0x4b6a},
+{"linux/kd.h", "GIO_FONTX", 0x4b6b},
+{"linux/kd.h", "PIO_FONTX", 0x4b6c},
+{"linux/kd.h", "PIO_FONTRESET", 0x4b6d},
+{"linux/kd.h", "GIO_CMAP", 0x4b70},
+{"linux/kd.h", "PIO_CMAP", 0x4b71},
+{"linux/loop.h", "LOOP_SET_FD", 0x4c00},
+{"linux/loop.h", "LOOP_CLR_FD", 0x4c01},
+{"linux/loop.h", "LOOP_SET_STATUS", 0x4c02},
+{"linux/loop.h", "LOOP_GET_STATUS", 0x4c03},
+{"linux/cdrom.h", "CDROMPAUSE", 0x5301},
+{"linux/cdrom.h", "CDROMRESUME", 0x5302},
+{"linux/cdrom.h", "CDROMPLAYMSF", 0x5303},
+{"linux/cdrom.h", "CDROMPLAYTRKIND", 0x5304},
+{"linux/cdrom.h", "CDROMREADTOCHDR", 0x5305},
+{"linux/cdrom.h", "CDROMREADTOCENTRY", 0x5306},
+{"linux/cdrom.h", "CDROMSTOP", 0x5307},
+{"linux/cdrom.h", "CDROMSTART", 0x5308},
+{"linux/cdrom.h", "CDROMEJECT", 0x5309},
+{"linux/cdrom.h", "CDROMVOLCTRL", 0x530a},
+{"linux/cdrom.h", "CDROMSUBCHNL", 0x530b},
+{"linux/cdrom.h", "CDROMREADMODE2", 0x530c},
+{"linux/cdrom.h", "CDROMREADMODE1", 0x530d},
+{"linux/cdrom.h", "CDROMREADAUDIO", 0x530e},
+{"linux/cdrom.h", "CDROMEJECT_SW", 0x530f},
+{"linux/cdrom.h", "CDROMMULTISESSION", 0x5310},
+{"linux/cdrom.h", "CDROM_GET_UPC", 0x5311},
+{"linux/cm206.h", "CDROM_GET_UPC", 0x5311},
+{"linux/cdrom.h", "CDROMRESET", 0x5312},
+{"linux/cm206.h", "CDROMRESET", 0x5312},
+{"linux/cdrom.h", "CDROMVOLREAD", 0x5313},
+{"linux/cdrom.h", "CDROMREADRAW", 0x5314},
+{"linux/cdrom.h", "CDROMREADCOOKED", 0x5315},
+{"linux/cdrom.h", "CDROMSEEK", 0x5316},
+{"linux/cdrom.h", "CDROMPLAYBLK", 0x5317},
+{"linux/cdrom.h", "CDROMREADALL", 0x5318},
+{"linux/cdrom.h", "CDROMCLOSETRAY", 0x5319},
+{"linux/cdrom.h", "CDROMLOADFROMSLOT", 0x531a},
+{"linux/ucdrom.h", "CDROM_SET_OPTIONS", 0x5320},
+{"linux/ucdrom.h", "CDROM_CLEAR_OPTIONS", 0x5321},
+{"linux/ucdrom.h", "CDROM_SELECT_SPEED", 0x5322},
+{"linux/ucdrom.h", "CDROM_SELECT_DISC", 0x5323},
+{"linux/ucdrom.h", "CDROM_MEDIA_CHANGED", 0x5325},
+{"linux/ucdrom.h", "CDROM_DRIVE_STATUS", 0x5326},
+{"linux/ucdrom.h", "CDROM_DISC_STATUS", 0x5327},
+{"linux/sbpcd.h", "CDROMAUDIOBUFSIZ", 0x5382},
+{"asm/ioctls.h", "TIOCLINUX", 0x541c},
+{"asm/ioctls.h", "TIOCGSERIAL", 0x541e},
+{"asm/ioctls.h", "TIOCSSERIAL", 0x541f},
+{"asm/ioctls.h", "TCSBRKP", 0x5425},
+{"asm/ioctls.h", "TIOCTTYGSTRUCT", 0x5426},
+{"asm/ioctls.h", "TIOCSERCONFIG", 0x5453},
+{"asm/ioctls.h", "TIOCSERGWILD", 0x5454},
+{"asm/ioctls.h", "TIOCSERSWILD", 0x5455},
+{"asm/ioctls.h", "TIOCGLCKTRMIOS", 0x5456},
+{"asm/ioctls.h", "TIOCSLCKTRMIOS", 0x5457},
+{"asm/ioctls.h", "TIOCSERGSTRUCT", 0x5458},
+{"asm/ioctls.h", "TIOCSERGETLSR", 0x5459},
+{"asm/ioctls.h", "TIOCSERGETMULTI", 0x545a},
+{"asm/ioctls.h", "TIOCSERSETMULTI", 0x545b},
+{"linux/vt.h", "VT_OPENQRY", 0x5600},
+{"linux/vt.h", "VT_GETMODE", 0x5601},
+{"linux/vt.h", "VT_SETMODE", 0x5602},
+{"linux/vt.h", "VT_GETSTATE", 0x5603},
+{"linux/vt.h", "VT_SENDSIG", 0x5604},
+{"linux/vt.h", "VT_RELDISP", 0x5605},
+{"linux/vt.h", "VT_ACTIVATE", 0x5606},
+{"linux/vt.h", "VT_WAITACTIVE", 0x5607},
+{"linux/vt.h", "VT_DISALLOCATE", 0x5608},
+{"linux/vt.h", "VT_RESIZE", 0x5609},
+{"linux/vt.h", "VT_RESIZEX", 0x560a},
+{"linux/vt.h", "VT_LOCKSWITCH", 0x560b},
+{"linux/vt.h", "VT_UNLOCKSWITCH", 0x560c},
+{"asm/sockios.h", "FIOSETOWN", 0x8901},
+{"asm/sockios.h", "SIOCSPGRP", 0x8902},
+{"asm/sockios.h", "FIOGETOWN", 0x8903},
+{"asm/sockios.h", "SIOCGPGRP", 0x8904},
+{"asm/sockios.h", "SIOCATMARK", 0x8905},
+{"asm/sockios.h", "SIOCGSTAMP", 0x8906},
+{"linux/sockios.h", "SIOCADDRT", 0x890b},
+{"linux/sockios.h", "SIOCDELRT", 0x890c},
+{"linux/sockios.h", "SIOCGIFNAME", 0x8910},
+{"linux/sockios.h", "SIOCSIFLINK", 0x8911},
+{"linux/sockios.h", "SIOCGIFCONF", 0x8912},
+{"linux/sockios.h", "SIOCGIFFLAGS", 0x8913},
+{"linux/sockios.h", "SIOCSIFFLAGS", 0x8914},
+{"linux/sockios.h", "SIOCGIFADDR", 0x8915},
+{"linux/sockios.h", "SIOCSIFADDR", 0x8916},
+{"linux/sockios.h", "SIOCGIFDSTADDR", 0x8917},
+{"linux/sockios.h", "SIOCSIFDSTADDR", 0x8918},
+{"linux/sockios.h", "SIOCGIFBRDADDR", 0x8919},
+{"linux/sockios.h", "SIOCSIFBRDADDR", 0x891a},
+{"linux/sockios.h", "SIOCGIFNETMASK", 0x891b},
+{"linux/sockios.h", "SIOCSIFNETMASK", 0x891c},
+{"linux/sockios.h", "SIOCGIFMETRIC", 0x891d},
+{"linux/sockios.h", "SIOCSIFMETRIC", 0x891e},
+{"linux/sockios.h", "SIOCGIFMEM", 0x891f},
+{"linux/sockios.h", "SIOCSIFMEM", 0x8920},
+{"linux/sockios.h", "SIOCGIFMTU", 0x8921},
+{"linux/sockios.h", "SIOCSIFMTU", 0x8922},
+{"linux/sockios.h", "SIOCSIFHWADDR", 0x8924},
+{"linux/sockios.h", "SIOCGIFENCAP", 0x8925},
+{"linux/sockios.h", "SIOCSIFENCAP", 0x8926},
+{"linux/sockios.h", "SIOCGIFHWADDR", 0x8927},
+{"linux/sockios.h", "SIOCGIFSLAVE", 0x8929},
+{"linux/sockios.h", "SIOCSIFSLAVE", 0x8930},
+{"linux/sockios.h", "SIOCADDMULTI", 0x8931},
+{"linux/sockios.h", "SIOCDELMULTI", 0x8932},
+{"linux/sockios.h", "SIOCGIFBR", 0x8940},
+{"linux/sockios.h", "SIOCSIFBR", 0x8941},
+{"linux/sockios.h", "OLD_SIOCDARP", 0x8950},
+{"linux/sockios.h", "OLD_SIOCGARP", 0x8951},
+{"linux/sockios.h", "OLD_SIOCSARP", 0x8952},
+{"linux/sockios.h", "SIOCDARP", 0x8953},
+{"linux/sockios.h", "SIOCGARP", 0x8954},
+{"linux/sockios.h", "SIOCSARP", 0x8955},
+{"linux/sockios.h", "SIOCDRARP", 0x8960},
+{"linux/sockios.h", "SIOCGRARP", 0x8961},
+{"linux/sockios.h", "SIOCSRARP", 0x8962},
+{"linux/sockios.h", "SIOCGIFMAP", 0x8970},
+{"linux/sockios.h", "SIOCSIFMAP", 0x8971},
+{"linux/sockios.h", "SIOCADDDLCI", 0x8980},
+{"linux/sockios.h", "SIOCDELDLCI", 0x8981},
+{"linux/sockios.h", "SIOCPROTOPRIVATE", 0x89e0},
+{"linux/sockios.h", "SIOCDEVPRIVATE", 0x89f0},
+{"linux/sbpcd.h", "DDIOCSDBG", 0x9000},
+{"linux/cyclades.h", "CYGETMON", 0x435901},
+{"linux/cyclades.h", "CYGETTHRESH", 0x435902},
+{"linux/cyclades.h", "CYSETTHRESH", 0x435903},
+{"linux/cyclades.h", "CYGETDEFTHRESH", 0x435904},
+{"linux/cyclades.h", "CYSETDEFTHRESH", 0x435905},
+{"linux/cyclades.h", "CYGETTIMEOUT", 0x435906},
+{"linux/cyclades.h", "CYSETTIMEOUT", 0x435907},
+{"linux/cyclades.h", "CYGETDEFTIMEOUT", 0x435908},
+{"linux/cyclades.h", "CYSETDEFTIMEOUT", 0x435909},
+{"linux/fs.h", "FIBMAP", 0x20000001},
+{"linux/fs.h", "FIGETBSZ", 0x20000002},
+{"linux/fd.h", "FDCLRPRM", 0x20000241},
+{"linux/fd.h", "FDMSGON", 0x20000245},
+{"linux/fd.h", "FDMSGOFF", 0x20000246},
+{"linux/fd.h", "FDFMTBEG", 0x20000247},
+{"linux/fd.h", "FDFMTEND", 0x20000249},
+{"linux/fd.h", "FDSETEMSGTRESH", 0x2000024a},
+{"linux/fd.h", "FDFLUSH", 0x2000024b},
+{"linux/fd.h", "FDRESET", 0x20000254},
+{"linux/fd.h", "FDWERRORCLR", 0x20000256},
+{"linux/fd.h", "FDRAWCMD", 0x20000258},
+{"linux/fd.h", "FDTWADDLE", 0x20000259},
+{"linux/fd.h", "FDEJECT", 0x2000025a},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_DOS", 0x200004d2},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_DOS", 0x200004d3},
+{"linux/umsdos_fs.h", "UMSDOS_RMDIR_DOS", 0x200004d4},
+{"linux/umsdos_fs.h", "UMSDOS_STAT_DOS", 0x200004d5},
+{"linux/umsdos_fs.h", "UMSDOS_CREAT_EMD", 0x200004d6},
+{"linux/umsdos_fs.h", "UMSDOS_UNLINK_EMD", 0x200004d7},
+{"linux/umsdos_fs.h", "UMSDOS_READDIR_EMD", 0x200004d8},
+{"linux/umsdos_fs.h", "UMSDOS_GETVERSION", 0x200004d9},
+{"linux/umsdos_fs.h", "UMSDOS_INIT_EMD", 0x200004da},
+{"linux/umsdos_fs.h", "UMSDOS_DOS_SETUP", 0x200004db},
+{"linux/umsdos_fs.h", "UMSDOS_RENAME_DOS", 0x200004dc},
+{"linux/md.h", "REGISTER_DEV", 0x20000901},
+{"linux/md.h", "START_MD", 0x20000902},
+{"linux/md.h", "STOP_MD", 0x20000903},
+{"linux/fs.h", "BLKROSET", 0x2000125d},
+{"linux/fs.h", "BLKROGET", 0x2000125e},
+{"linux/fs.h", "BLKRRPART", 0x2000125f},
+{"linux/fs.h", "BLKGETSIZE", 0x20001260},
+{"linux/fs.h", "BLKFLSBUF", 0x20001261},
+{"linux/fs.h", "BLKRASET", 0x20001262},
+{"linux/fs.h", "BLKRAGET", 0x20001263},
+{"linux/cm206.h", "CM206CTL_GET_STAT", 0x20002000},
+{"linux/cm206.h", "CM206CTL_GET_LAST_STAT", 0x20002001},
+{"linux/apm_bios.h", "APM_IOC_STANDBY", 0x20004101},
+{"linux/apm_bios.h", "APM_IOC_SUSPEND", 0x20004102},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_TXDELAY", 0x20004202},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_PPERSIST", 0x20004203},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_SLOTTIME", 0x20004204},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_TXTAIL", 0x20004205},
+{"linux/baycom.h", "BAYCOMCTL_PARAM_FULLDUP", 0x20004206},
+{"linux/baycom.h", "BAYCOMCTL_CALIBRATE", 0x2000420a},
+{"linux/soundcard.h", "SNDCTL_COPR_RESET", 0x20004300},
+{"linux/isdn.h", "IIOCNETAIF", 0x20004901},
+{"linux/isdn.h", "IIOCNETDIF", 0x20004902},
+{"linux/isdn.h", "IIOCNETSCF", 0x20004903},
+{"linux/isdn.h", "IIOCNETGCF", 0x20004904},
+{"linux/isdn.h", "IIOCNETANM", 0x20004905},
+{"linux/isdn.h", "IIOCNETDNM", 0x20004906},
+{"linux/isdn.h", "IIOCNETGNM", 0x20004907},
+{"linux/isdn.h", "IIOCGETSET", 0x20004908},
+{"linux/isdn.h", "IIOCSETSET", 0x20004909},
+{"linux/isdn.h", "IIOCSETVER", 0x2000490a},
+{"linux/isdn.h", "IIOCNETHUP", 0x2000490b},
+{"linux/isdn.h", "IIOCSETGST", 0x2000490c},
+{"linux/isdn.h", "IIOCSETBRJ", 0x2000490d},
+{"linux/isdn.h", "IIOCSIGPRF", 0x2000490e},
+{"linux/isdn.h", "IIOCGETPRF", 0x2000490f},
+{"linux/isdn.h", "IIOCSETPRF", 0x20004910},
+{"linux/isdn.h", "IIOCGETMAP", 0x20004911},
+{"linux/isdn.h", "IIOCSETMAP", 0x20004912},
+{"linux/isdn.h", "IIOCNETASL", 0x20004913},
+{"linux/isdn.h", "IIOCNETDIL", 0x20004914},
+{"linux/isdn.h", "IIOCGETCPS", 0x20004915},
+{"linux/isdn.h", "IIOCNETALN", 0x20004920},
+{"linux/isdn.h", "IIOCNETDLN", 0x20004921},
+{"linux/isdn.h", "IIOCDBGVAR", 0x2000497f},
+{"linux/isdn.h", "IIOCDRVCTL", 0x20004980},
+{"linux/soundcard.h", "SNDCTL_DSP_RESET", 0x20005000},
+{"linux/soundcard.h", "SNDCTL_DSP_SYNC", 0x20005001},
+{"linux/soundcard.h", "SNDCTL_DSP_POST", 0x20005008},
+{"linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", 0x2000500e},
+{"linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", 0x20005015},
+{"linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", 0x20005016},
+{"linux/soundcard.h", "SNDCTL_SEQ_RESET", 0x20005100},
+{"linux/soundcard.h", "SNDCTL_SEQ_SYNC", 0x20005101},
+{"linux/soundcard.h", "SNDCTL_SEQ_PANIC", 0x20005111},
+{"linux/random.h", "RNDZAPENTCNT", 0x20005204},
+{"linux/random.h", "RNDCLEARPOOL", 0x20005206},
+{"linux/soundcard.h", "SNDCTL_TMR_START", 0x20005402},
+{"linux/soundcard.h", "SNDCTL_TMR_STOP", 0x20005403},
+{"linux/soundcard.h", "SNDCTL_TMR_CONTINUE", 0x20005404},
+{"asm/ioctls.h", "TCSBRK", 0x20005405},
+{"asm/ioctls.h", "TCXONC", 0x20005406},
+{"asm/ioctls.h", "TCFLSH", 0x20005407},
+{"asm/ioctls.h", "__TCGETSTAT", 0x200054c8},
+{"asm/ioctls.h", "__TCSETSTAT", 0x200054c9},
+{"linux/comstats.h", "COM_GETPORTSTATS", 0x2000631e},
+{"linux/comstats.h", "COM_CLRPORTSTATS", 0x2000631f},
+{"linux/comstats.h", "COM_GETBRDSTATS", 0x20006320},
+{"linux/comstats.h", "COM_READPORT", 0x20006328},
+{"linux/comstats.h", "COM_READBOARD", 0x20006329},
+{"linux/comstats.h", "COM_READPANEL", 0x2000632a},
+{"asm/ioctls.h", "FIOCLEX", 0x20006601},
+{"asm/ioctls.h", "FIONCLEX", 0x20006602},
+{"linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", 0x20006e03},
+{"linux/mc146818rtc.h", "RTC_AIE_ON", 0x20007001},
+{"linux/mc146818rtc.h", "RTC_AIE_OFF", 0x20007002},
+{"linux/mc146818rtc.h", "RTC_UIE_ON", 0x20007003},
+{"linux/mc146818rtc.h", "RTC_UIE_OFF", 0x20007004},
+{"linux/mc146818rtc.h", "RTC_PIE_ON", 0x20007005},
+{"linux/mc146818rtc.h", "RTC_PIE_OFF", 0x20007006},
+{"linux/cdk.h", "STL_BINTR", 0x20007314},
+{"linux/cdk.h", "STL_BSTART", 0x20007315},
+{"linux/cdk.h", "STL_BSTOP", 0x20007316},
+{"linux/cdk.h", "STL_BRESET", 0x20007317},
+{"linux/cdk.h", "STL_GETPFLAG", 0x20007350},
+{"linux/cdk.h", "STL_SETPFLAG", 0x20007351},
+{"asm/ioctls.h", "__TIOCHPCL", 0x20007402},
+{"asm/ioctls.h", "TIOCEXCL", 0x2000740d},
+{"asm/ioctls.h", "TIOCNXCL", 0x2000740e},
+{"asm/ioctls.h", "TIOCCONS", 0x20007424},
+{"linux/if_ppp.h", "PPPIOCXFERUNIT", 0x2000744e},
+{"asm/ioctls.h", "__TIOCSTART", 0x2000746e},
+{"asm/ioctls.h", "__TIOCSTOP", 0x2000746f},
+{"asm/ioctls.h", "TIOCNOTTY", 0x20007471},
+{"asm/ioctls.h", "__TIOCCDTR", 0x20007478},
+{"asm/ioctls.h", "__TIOCSDTR", 0x20007479},
+{"asm/ioctls.h", "__TIOCCBRK", 0x2000747a},
+{"asm/ioctls.h", "__TIOCSBRK", 0x2000747b},
+{"asm/ioctls.h", "TIOCSCTTY", 0x20007484},
+{"linux/baycom.h", "BAYCOMCTL_GETDCD", 0x40014200},
+{"linux/baycom.h", "BAYCOMCTL_GETPTT", 0x40014201},
+{"linux/baycom.h", "BAYCOMCTL_GETSAMPLES", 0x40014210},
+{"linux/baycom.h", "BAYCOMCTL_GETBITS", 0x40014211},
+{"linux/smb_fs.h", "SMB_IOC_GETMOUNTUID", 0x40027501},
+{"linux/baycom.h", "BAYCOMCTL_DEBUG1", 0x40044212},
+{"linux/baycom.h", "BAYCOMCTL_DEBUG2", 0x40044213},
+{"linux/baycom.h", "BAYCOMCTL_DEBUG3", 0x40044214},
+{"asm/fbio.h", "FBIOGVIDEO", 0x40044608},
+{"asm/fbio.h", "FBIOGCURMAX", 0x4004461c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_VOLUME", 0x40044d00},
+{"linux/soundcard.h", "SOUND_MIXER_READ_BASS", 0x40044d01},
+{"linux/soundcard.h", "SOUND_MIXER_READ_TREBLE", 0x40044d02},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SYNTH", 0x40044d03},
+{"linux/soundcard.h", "SOUND_MIXER_READ_PCM", 0x40044d04},
+{"linux/soundcard.h", "SOUND_MIXER_READ_SPEAKER", 0x40044d05},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE", 0x40044d06},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MIC", 0x40044d07},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CD", 0x40044d08},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IMIX", 0x40044d09},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ALTPCM", 0x40044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECLEV", 0x40044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_READ_IGAIN", 0x40044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_OGAIN", 0x40044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE1", 0x40044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE2", 0x40044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LINE3", 0x40044d10},
+{"linux/soundcard.h", "SOUND_MIXER_READ_MUTE", 0x40044d1c},
+{"linux/soundcard.h", "SOUND_MIXER_READ_ENHANCE", 0x40044d1d},
+{"linux/soundcard.h", "SOUND_MIXER_READ_LOUD", 0x40044d1e},
+{"linux/soundcard.h", "SOUND_MIXER_READ_STEREODEVS", 0x40044dfb},
+{"linux/soundcard.h", "SOUND_MIXER_READ_CAPS", 0x40044dfc},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECMASK", 0x40044dfd},
+{"linux/soundcard.h", "SOUND_MIXER_READ_DEVMASK", 0x40044dfe},
+{"linux/soundcard.h", "SOUND_MIXER_READ_RECSRC", 0x40044dff},
+{"linux/soundcard.h", "SOUND_PCM_READ_RATE", 0x40045002},
+{"linux/soundcard.h", "SOUND_PCM_READ_BITS", 0x40045005},
+{"linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", 0x40045006},
+{"linux/soundcard.h", "SOUND_PCM_READ_FILTER", 0x40045007},
+{"linux/soundcard.h", "SNDCTL_DSP_GETFMTS", 0x4004500b},
+{"linux/soundcard.h", "SNDCTL_DSP_GETCAPS", 0x4004500f},
+{"linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", 0x40045010},
+{"linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", 0x40045104},
+{"linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", 0x40045105},
+{"linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", 0x4004510a},
+{"linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", 0x4004510b},
+{"linux/random.h", "RNDGETENTCNT", 0x40045200},
+{"linux/ext2_fs.h", "EXT2_IOC_GETFLAGS", 0x40046601},
+{"asm/ioctls.h", "FIONREAD", 0x4004667f},
+{"asm/kbio.h", "KIOCGTRANS", 0x40046b05},
+{"asm/kbio.h", "KIOCTYPE", 0x40046b09},
+{"asm/kbio.h", "KIOCLAYOUT", 0x40046b14},
+{"linux/mtio.h", "MTIOCPOS", 0x40046d03},
+{"linux/mc146818rtc.h", "RTC_IRQP_READ", 0x4004700b},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", 0x40047201},
+{"asm/ioctls.h", "TIOCGETD", 0x40047400},
+{"asm/ioctls.h", "__TIOCMODG", 0x40047403},
+{"asm/ioctls.h", "__TIOCGETX", 0x40047423},
+{"linux/if_ppp.h", "PPPIOCGDEBUG", 0x40047441},
+{"linux/if_ppp.h", "PPPIOCGMRU", 0x40047453},
+{"linux/if_ppp.h", "PPPIOCGRASYNCMAP", 0x40047455},
+{"linux/if_ppp.h", "PPPIOCGUNIT", 0x40047456},
+{"linux/if_ppp.h", "PPPIOCGASYNCMAP", 0x40047458},
+{"linux/if_ppp.h", "PPPIOCGFLAGS", 0x4004745a},
+{"asm/ioctls.h", "TIOCGSOFTCAR", 0x40047464},
+{"asm/ioctls.h", "TIOCMGET", 0x4004746a},
+{"asm/ioctls.h", "TIOCOUTQ", 0x40047473},
+{"asm/ioctls.h", "__TIOCISPACE", 0x40047480},
+{"asm/ioctls.h", "__TIOCISIZE", 0x40047481},
+{"linux/isdn_ppp.h", "PPPIOCGMPFLAGS", 0x40047482},
+{"asm/ioctls.h", "TIOCGPGRP", 0x40047483},
+{"linux/ext2_fs.h", "EXT2_IOC_GETVERSION", 0x40047601},
+{"asm/vuid_event.h", "VUIDGFORMAT", 0x40047602},
+{"asm/ioctls.h", "__TIOCGETP", 0x40067408},
+{"asm/ioctls.h", "__TIOCGETC", 0x40067412},
+{"asm/ioctls.h", "__TIOCGLTC", 0x40067474},
+{"linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", 0x40085013},
+{"linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", 0x40085014},
+{"linux/random.h", "RNDGETPOOL", 0x40085202},
+{"asm/ioctls.h", "__TIOCGSIZE", 0x40087426},
+{"linux/if_ppp.h", "PPPIOCGIDLE", 0x4008743f},
+{"asm/ioctls.h", "TIOCGWINSZ", 0x40087468},
+{"linux/soundcard.h", "SNDCTL_DSP_GETIPTR", 0x400c5011},
+{"linux/soundcard.h", "SNDCTL_DSP_GETOPTR", 0x400c5012},
+{"linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", 0x400c6e01},
+{"linux/fd.h", "FDGETDRVTYP", 0x4010020f},
+{"linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", 0x4010500c},
+{"linux/soundcard.h", "SNDCTL_DSP_GETISPACE", 0x4010500d},
+{"asm/ioctls.h", "TCGETA", 0x40125401},
+{"linux/fd.h", "FDGETMAXERRS", 0x4014020e},
+{"linux/baycom.h", "BAYCOMCTL_GETSTAT", 0x40144207},
+{"linux/fd.h", "FDWERRORGET", 0x40180217},
+{"asm/fbio.h", "FBIOGTYPE", 0x40184600},
+{"linux/fd.h", "FDGETPRM", 0x401c0204},
+{"linux/mtio.h", "MTIOCGET", 0x401c6d02},
+{"linux/fd.h", "FDGETFDCSTAT", 0x40200215},
+{"linux/if_ppp.h", "PPPIOCGXASYNCMAP", 0x40207450},
+{"linux/baycom.h", "BAYCOMCTL_GETPARAMS", 0x40244208},
+{"linux/baycom.h", "BAYCOMCTL_SETPARAMS", 0x40244209},
+{"asm/ioctls.h", "TCGETS", 0x40245408},
+{"linux/mc146818rtc.h", "RTC_ALM_READ", 0x40247008},
+{"linux/mc146818rtc.h", "RTC_RD_TIME", 0x40247009},
+{"linux/fd.h", "FDGETDRVSTAT", 0x40340212},
+{"linux/fd.h", "FDPOLLDRVSTAT", 0x40340213},
+{"linux/fd.h", "FDGETDRVPRM", 0x40580211},
+{"asm/fbio.h", "FBIOGATTR", 0x40584606},
+{"linux/soundcard.h", "SNDCTL_COPR_RCVMSG", 0x4fa44309},
+{"asm/ioctls.h", "TIOCSTI", 0x80017472},
+{"linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", 0x80026e02},
+{"asm/fbio.h", "FBIOSVIDEO", 0x80044607},
+{"asm/fbio.h", "FBIOSCURPOS", 0x8004461a},
+{"asm/fbio.h", "FBIOGCURPOS", 0x8004461b},
+{"linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", 0x80045010},
+{"linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", 0x80045106},
+{"linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", 0x80045108},
+{"linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", 0x80045109},
+{"linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", 0x8004510d},
+{"linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", 0x8004510f},
+{"linux/random.h", "RNDADDTOENTCNT", 0x80045201},
+{"linux/soundcard.h", "SNDCTL_TMR_METRONOME", 0x80045407},
+{"linux/soundcard.h", "SNDCTL_TMR_SELECT", 0x80045408},
+{"linux/ext2_fs.h", "EXT2_IOC_SETFLAGS", 0x80046602},
+{"asm/ioctls.h", "FIOASYNC", 0x8004667d},
+{"asm/ioctls.h", "FIONBIO", 0x8004667e},
+{"asm/kbio.h", "KIOCTRANS", 0x80046b00},
+{"asm/kbio.h", "KIOCCMD", 0x80046b08},
+{"asm/kbio.h", "KIOCSDIRECT", 0x80046b0a},
+{"linux/mc146818rtc.h", "RTC_IRQP_SET", 0x8004700c},
+{"linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", 0x80047202},
+{"asm/ioctls.h", "TIOCSETD", 0x80047401},
+{"asm/ioctls.h", "__TIOCMODS", 0x80047404},
+{"asm/ioctls.h", "__TIOCFLUSH", 0x80047410},
+{"asm/ioctls.h", "__TIOCTCNTL", 0x80047420},
+{"asm/ioctls.h", "__TIOCSIGNAL", 0x80047421},
+{"asm/ioctls.h", "__TIOCSETX", 0x80047422},
+{"linux/if_ppp.h", "PPPIOCSDEBUG", 0x80047440},
+{"linux/if_ppp.h", "PPPIOCSMAXCID", 0x80047451},
+{"linux/if_ppp.h", "PPPIOCSMRU", 0x80047452},
+{"linux/if_ppp.h", "PPPIOCSRASYNCMAP", 0x80047454},
+{"linux/if_ppp.h", "PPPIOCSASYNCMAP", 0x80047457},
+{"linux/if_ppp.h", "PPPIOCSFLAGS", 0x80047459},
+{"asm/ioctls.h", "TIOCSSOFTCAR", 0x80047465},
+{"asm/ioctls.h", "__TIOCUCNTL", 0x80047466},
+{"asm/ioctls.h", "__TIOCREMOTE", 0x80047469},
+{"asm/ioctls.h", "TIOCMBIC", 0x8004746b},
+{"asm/ioctls.h", "TIOCMBIS", 0x8004746c},
+{"asm/ioctls.h", "TIOCMSET", 0x8004746d},
+{"asm/ioctls.h", "TIOCPKT", 0x80047470},
+{"asm/ioctls.h", "__TIOCLGET", 0x8004747c},
+{"asm/ioctls.h", "__TIOCLSET", 0x8004747d},
+{"asm/ioctls.h", "__TIOCLBIC", 0x8004747e},
+{"asm/ioctls.h", "__TIOCLBIS", 0x8004747f},
+{"linux/isdn_ppp.h", "PPPIOCBUNDLE", 0x80047481},
+{"asm/ioctls.h", "TIOCSPGRP", 0x80047482},
+{"linux/isdn_ppp.h", "PPPIOCSMPFLAGS", 0x80047483},
+{"linux/isdn_ppp.h", "PPPIOCSMPMTU", 0x80047484},
+{"linux/isdn_ppp.h", "PPPIOCSMPMRU", 0x80047485},
+{"asm/vuid_event.h", "VUIDSFORMAT", 0x80047601},
+{"linux/ext2_fs.h", "EXT2_IOC_SETVERSION", 0x80047602},
+{"asm/ioctls.h", "__TIOCSETP", 0x80067409},
+{"asm/ioctls.h", "__TIOCSETN", 0x8006740a},
+{"asm/ioctls.h", "__TIOCSETC", 0x80067411},
+{"asm/ioctls.h", "__TIOCSLTC", 0x80067475},
+{"linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", 0x80085112},
+{"linux/random.h", "RNDADDENTROPY", 0x80085203},
+{"linux/mtio.h", "MTIOCTOP", 0x80086d01},
+{"asm/ioctls.h", "__TIOCSSIZE", 0x80087425},
+{"linux/if_ppp.h", "PPPIOCSNPMODE", 0x8008744b},
+{"asm/ioctls.h", "TIOCSWINSZ", 0x80087467},
+{"linux/fd.h", "FDFMTTRK", 0x800c0248},
+{"linux/if_ppp.h", "PPPIOCSCOMPRESS", 0x800c744d},
+{"asm/ioctls.h", "TCSETA", 0x80125402},
+{"asm/ioctls.h", "TCSETAW", 0x80125403},
+{"asm/ioctls.h", "TCSETAF", 0x80125404},
+{"linux/fd.h", "FDSETMAXERRS", 0x8014024c},
+{"linux/soundcard.h", "SNDCTL_COPR_WDATA", 0x80144304},
+{"linux/soundcard.h", "SNDCTL_COPR_WCODE", 0x80144305},
+{"linux/fd.h", "FDSETPRM", 0x801c0242},
+{"linux/fd.h", "FDDEFPRM", 0x801c0243},
+{"linux/if_ppp.h", "PPPIOCSXASYNCMAP", 0x8020744f},
+{"asm/ioctls.h", "TCSETS", 0x80245409},
+{"asm/ioctls.h", "TCSETSW", 0x8024540a},
+{"asm/ioctls.h", "TCSETSF", 0x8024540b},
+{"linux/mc146818rtc.h", "RTC_ALM_SET", 0x80247007},
+{"linux/mc146818rtc.h", "RTC_SET_TIME", 0x8024700a},
+{"linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", 0x80285107},
+{"asm/fbio.h", "FBIOSCURSOR", 0x802c4618},
+{"linux/fd.h", "FDSETDRVPRM", 0x80580290},
+{"asm/fbio.h", "FBIOSATTR", 0x80584605},
+{"linux/soundcard.h", "SNDCTL_COPR_SENDMSG", 0x8fa44308},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_VOLUME", 0xc0044d00},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_BASS", 0xc0044d01},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_TREBLE", 0xc0044d02},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SYNTH", 0xc0044d03},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_PCM", 0xc0044d04},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_SPEAKER", 0xc0044d05},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE", 0xc0044d06},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MIC", 0xc0044d07},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_CD", 0xc0044d08},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IMIX", 0xc0044d09},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ALTPCM", 0xc0044d0a},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECLEV", 0xc0044d0b},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_IGAIN", 0xc0044d0c},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_OGAIN", 0xc0044d0d},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE1", 0xc0044d0e},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE2", 0xc0044d0f},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LINE3", 0xc0044d10},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_MUTE", 0xc0044d1c},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_ENHANCE", 0xc0044d1d},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_LOUD", 0xc0044d1e},
+{"linux/soundcard.h", "SOUND_MIXER_WRITE_RECSRC", 0xc0044dff},
+{"linux/soundcard.h", "SNDCTL_DSP_SPEED", 0xc0045002},
+{"linux/soundcard.h", "SNDCTL_DSP_STEREO", 0xc0045003},
+{"linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", 0xc0045004},
+{"linux/soundcard.h", "SNDCTL_DSP_SETFMT", 0xc0045005},
+{"linux/soundcard.h", "SOUND_PCM_WRITE_CHANNELS", 0xc0045006},
+{"linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", 0xc0045007},
+{"linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", 0xc0045009},
+{"linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", 0xc004500a},
+{"linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", 0xc0045103},
+{"linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", 0xc004510e},
+{"linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", 0xc0045401},
+{"linux/soundcard.h", "SNDCTL_TMR_TEMPO", 0xc0045405},
+{"linux/soundcard.h", "SNDCTL_TMR_SOURCE", 0xc0045406},
+{"linux/soundcard.h", "SNDCTL_MIDI_PRETIME", 0xc0046d00},
+{"linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", 0xc0046d01},
+{"linux/if_ppp.h", "PPPIOCGNPMODE", 0xc008744c},
+{"linux/soundcard.h", "SNDCTL_COPR_RDATA", 0xc0144302},
+{"linux/soundcard.h", "SNDCTL_COPR_RCODE", 0xc0144303},
+{"linux/soundcard.h", "SNDCTL_COPR_RUN", 0xc0144306},
+{"linux/soundcard.h", "SNDCTL_COPR_HALT", 0xc0144307},
+{"linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", 0xc0216d02},
+{"linux/isdn_ppp.h", "PPPIOCLINKINFO", 0xc0247480},
+{"linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", 0xc0286e04},
+{"asm/fbio.h", "FBIOGCURSOR", 0xc02c4619},
+{"linux/soundcard.h", "SNDCTL_MIDI_INFO", 0xc074510c},
+{"linux/soundcard.h", "SNDCTL_SYNTH_INFO", 0xc08c5102},
+{"linux/soundcard.h", "SNDCTL_COPR_LOAD", 0xcfb04301},
+{"linux/soundcard.h", "SNDCTL_PMGR_IFACE", 0xcfb85001},
+{"linux/soundcard.h", "SNDCTL_PMGR_ACCESS", 0xcfb85110},
diff --git a/linux/sparc/ioctlent1.h b/linux/sparc/ioctlent1.h
new file mode 100644
index 000000000..5d536cf79
--- /dev/null
+++ b/linux/sparc/ioctlent1.h
@@ -0,0 +1 @@
+#include "../svr4/ioctlent.h"
diff --git a/linux/sparc/signalent.h b/linux/sparc/signalent.h
new file mode 100644
index 000000000..e059b5d01
--- /dev/null
+++ b/linux/sparc/signalent.h
@@ -0,0 +1,32 @@
+ "SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGURG", /* 16 */
+ "SIGSTOP", /* 17 */
+ "SIGTSTP", /* 18 */
+ "SIGCONT", /* 19 */
+ "SIGCHLD", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGIO", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGLOST", /* 29 */
+ "SIGUSR1", /* 30 */
+ "SIGUSR2", /* 31 */
diff --git a/linux/sparc/signalent1.h b/linux/sparc/signalent1.h
new file mode 100644
index 000000000..6be7a261f
--- /dev/null
+++ b/linux/sparc/signalent1.h
@@ -0,0 +1 @@
+#include "../svr4/signalent.h"
diff --git a/linux/sparc/syscall.h b/linux/sparc/syscall.h
new file mode 100644
index 000000000..9c7f46cd2
--- /dev/null
+++ b/linux/sparc/syscall.h
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+#include "dummy.h"
+
+int sys_nosys();
+int sys_nullsys();
+int sys_errsys();
+
+/* 1.1 processes and protection */
+int sys_gethostid(),sys_sethostname(),sys_gethostname(),sys_getpid();
+int sys_setdomainname(),sys_getdomainname();
+int sys_fork(),sys_exit(),sys_execv(),sys_execve(),sys_wait4(),sys_waitpid();
+int sys_setuid(),sys_setgid(),sys_getuid(),sys_setreuid(),sys_getgid(),sys_getgroups(),sys_setregid(),sys_setgroups();
+int sys_getpgrp(),sys_setpgrp();
+int sys_setsid(), sys_setpgid();
+int sys_uname(), sys_sysinfo();
+
+/* 1.2 memory management */
+int sys_brk(),sys_sbrk(),sys_sstk();
+int sys_getpagesize(),sys_mmap(),sys_mctl(),sys_munmap(),sys_mprotect(),sys_mincore();
+int sys_omsync(),sys_omadvise();
+
+/* 1.3 signals */
+int sys_sigvec(),sys_sigblock(),sys_sigsetmask(),sys_sigpause(),sys_sigstack(),sys_sigcleanup(), sys_sigreturn();
+int sys_kill(), sys_killpg(), sys_sigpending(), sys_signal(), sys_sigaction(), sys_sigsuspend(), sys_sigprocmask();
+
+/* 1.4 timing and statistics */
+int sys_gettimeofday(),sys_settimeofday();
+int sys_adjtime(), sys_adjtimex();
+int sys_getitimer(),sys_setitimer();
+
+/* 1.5 descriptors */
+int sys_getdtablesize(),sys_dup(),sys_dup2(),sys_close();
+int sys_select(),sys_getdopt(),sys_setdopt(),sys_fcntl(),sys_flock();
+
+/* 1.6 resource controls */
+int sys_getpriority(),sys_setpriority(),sys_getrusage(),sys_getrlimit(),sys_setrlimit();
+int sys_oldquota(), sys_quotactl();
+int sys_rtschedule(), sys_personality();
+
+/* 1.7 system operation support */
+int sys_mount(),sys_unmount(),sys_swapon();
+int sys_sync(),sys_reboot();
+int sys_sysacct();
+int sys_auditsys();
+
+/* 2.1 generic operations */
+int sys_read(),sys_write(),sys_readv(),sys_writev(),sys_ioctl();
+
+/* 2.1.1 asynch operations */
+int sys_aioread(), sys_aiowrite(), sys_aiowait(), sys_aiocancel();
+
+/* 2.2 file system */
+int sys_chdir(),sys_chroot();
+int sys_fchdir(),sys_fchroot();
+int sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents(),sys_readdir();
+int sys_creat(),sys_open(),sys_mknod(),sys_unlink(),sys_stat(),sys_fstat(),sys_lstat();
+int sys_chown(),sys_fchown(),sys_chmod(),sys_fchmod(),sys_utimes();
+int sys_link(),sys_symlink(),sys_readlink(),sys_rename();
+int sys_lseek(),sys_truncate(),sys_ftruncate(),sys_access(),sys_fsync();
+int sys_statfs(),sys_fstatfs(),sys_msync();
+
+/* 2.3 communications */
+int sys_socket(),sys_bind(),sys_listen(),sys_accept(),sys_connect();
+int sys_socketpair(),sys_sendto(),sys_send(),sys_recvfrom(),sys_recv();
+int sys_sendmsg(),sys_recvmsg(),sys_shutdown(),sys_setsockopt(),sys_getsockopt();
+int sys_getsockname(),sys_getpeername(),sys_pipe();
+
+int sys_umask(); /* XXX */
+
+/* 2.3.1 SystemV-compatible IPC */
+int sys_semsys(), sys_semctl(), sys_semget();
+#define SYS_semsys_subcall 200
+#define SYS_semsys_nsubcalls 3
+#define SYS_semctl (SYS_semsys_subcall + 0)
+#define SYS_semget (SYS_semsys_subcall + 1)
+#define SYS_semop (SYS_semsys_subcall + 2)
+int sys_msgsys(), sys_msgget(), sys_msgctl(), sys_msgrcv(), sys_msgsnd();
+#define SYS_msgsys_subcall 203
+#define SYS_msgsys_nsubcalls 4
+#define SYS_msgget (SYS_msgsys_subcall + 0)
+#define SYS_msgctl (SYS_msgsys_subcall + 1)
+#define SYS_msgrcv (SYS_msgsys_subcall + 2)
+#define SYS_msgsnd (SYS_msgsys_subcall + 3)
+int sys_shmsys(), sys_shmat(), sys_shmctl(), sys_shmdt(), sys_shmget();
+#define SYS_shmsys_subcall 207
+#define SYS_shmsys_nsubcalls 4
+#define SYS_shmat (SYS_shmsys_subcall + 0)
+#define SYS_shmctl (SYS_shmsys_subcall + 1)
+#define SYS_shmdt (SYS_shmsys_subcall + 2)
+#define SYS_shmget (SYS_shmsys_subcall + 3)
+
+/* 2.4 processes */
+int sys_ptrace();
+
+/* 2.5 terminals */
+
+/* emulations for backwards compatibility */
+int sys_otime(); /* now use gettimeofday */
+int sys_ostime(); /* now use settimeofday */
+int sys_oalarm(); /* now use setitimer */
+int sys_outime(); /* now use utimes */
+int sys_opause(); /* now use sigpause */
+int sys_onice(); /* now use setpriority,getpriority */
+int sys_oftime(); /* now use gettimeofday */
+int sys_osetpgrp(); /* ??? */
+int sys_otimes(); /* now use getrusage */
+int sys_ossig(); /* now use sigvec, etc */
+int sys_ovlimit(); /* now use setrlimit,getrlimit */
+int sys_ovtimes(); /* now use getrusage */
+int sys_osetuid(); /* now use setreuid */
+int sys_osetgid(); /* now use setregid */
+int sys_ostat(); /* now use stat */
+int sys_ofstat(); /* now use fstat */
+
+/* BEGIN JUNK */
+int sys_profil(); /* 'cuz sys calls are interruptible */
+int sys_vhangup(); /* should just do in sys_exit() */
+int sys_vfork(); /* XXX - was awaiting fork w/ copy on write */
+int sys_ovadvise(); /* awaiting new madvise */
+int sys_indir(); /* indirect system call */
+int sys_ustat(); /* System V compatibility */
+int sys_owait(); /* should use wait4 interface */
+int sys_owait3(); /* should use wait4 interface */
+int sys_umount(); /* still more Sys V (and 4.2?) compatibility */
+int sys_pathconf(); /* posix */
+int sys_fpathconf(); /* posix */
+int sys_sysconf(); /* posix */
+int sys_delete_module();
+int sys_debug();
+/* END JUNK */
+
+int sys_vtrace(); /* kernel event tracing */
+
+/* nfs */
+int sys_async_daemon(); /* client async daemon */
+int sys_nfs_svc(); /* run nfs server */
+int sys_nfs_getfh(); /* get file handle */
+int sys_exportfs(); /* export file systems */
+
+int sys_rfssys(); /* RFS-related calls */
+
+int sys_getmsg();
+int sys_putmsg();
+int sys_poll();
+
+int sys_vpixsys(); /* VP/ix system calls */
+
+#include "syscall1.h"
diff --git a/linux/sparc/syscall.h.2 b/linux/sparc/syscall.h.2
new file mode 100644
index 000000000..19d3b4a3b
--- /dev/null
+++ b/linux/sparc/syscall.h.2
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "dummy.h"
+
+/* primary syscalls */
+
+int sys_setup(), sys_exit(), sys_fork(), sys_read(), sys_write();
+int sys_open(), sys_close(), sys_waitpid(), sys_creat(), sys_link();
+int sys_unlink(), sys_execve(), sys_chdir(), sys_time(), sys_mknod();
+int sys_chmod(), sys_chown(), sys_break(), sys_oldstat();
+int sys_lseek(), sys_getpid(), sys_mount(), sys_umount();
+int sys_setuid(), sys_getuid(), sys_stime(), sys_ptrace();
+int sys_alarm(), sys_oldfstat(), sys_pause(), sys_utime();
+int sys_stty(), sys_gtty(), sys_access(), sys_nice(), sys_ftime();
+int sys_sync(), sys_kill(), sys_rename(), sys_mkdir(), sys_rmdir();
+int sys_dup(), sys_pipe(), sys_times(), sys_prof(), sys_brk();
+int sys_setgid(), sys_getgid(), sys_signal(), sys_geteuid();
+int sys_getegid(), sys_acct(), sys_phys(), sys_lock(), sys_ioctl();
+int sys_fcntl(), sys_mpx(), sys_setpgid(), sys_ulimit();
+int sys_olduname(), sys_umask(), sys_chroot(), sys_ustat();
+int sys_dup2(), sys_getppid(), sys_getpgrp(), sys_setsid();
+int sys_sigaction(), sys_siggetmask(), sys_sigsetmask();
+int sys_setreuid(), sys_setregid(), sys_sigsuspend();
+int sys_sigpending(), sys_sethostname(), sys_setrlimit();
+int sys_getrlimit(), sys_getrusage(), sys_gettimeofday();
+int sys_settimeofday(), sys_getgroups(), sys_setgroups();
+int sys_oldselect(), sys_symlink(), sys_oldlstat(), sys_readlink();
+int sys_uselib(), sys_swapon(), sys_reboot(), sys_readdir();
+int sys_mmap(), sys_munmap(), sys_truncate(), sys_ftruncate();
+int sys_fchmod(), sys_fchown(), sys_getpriority();
+int sys_setpriority(), sys_profil(), sys_statfs(), sys_fstatfs();
+int sys_ioperm(), sys_socketcall(), sys_syslog(), sys_setitimer();
+int sys_getitimer(), sys_stat(), sys_lstat(), sys_fstat();
+int sys_uname(), sys_iopl(), sys_vhangup(), sys_idle(), sys_vm86();
+int sys_wait4(), sys_swapoff(), sys_ipc(), sys_sigreturn();
+int sys_fsync(), sys_clone(), sys_setdomainname(), sys_sysinfo();
+int sys_modify_ldt(), sys_adjtimex(), sys_mprotect();
+int sys_sigprocmask(), sys_create_module(), sys_init_module();
+int sys_delete_module(), sys_get_kernel_syms(), sys_quotactl();
+int sys_getpgid(), sys_fchdir(), sys_bdflush();
+int sys_sysfs(), sys_personality(), sys_afs_syscall();
+int sys_setfsuid(), sys_setfsgid(), sys_llseek();
+int sys_getdents(), sys_flock(), sys_msync();
+int sys_readv(), sys_writev(), sys_select();
+int sys_getsid(), sys_fdatasync(), sys_sysctl();
+int sys_mlock(), sys_munlock(), sys_mlockall(), sys_munlockall();
+int sys_sched_setparam(), sys_sched_getparam();
+int sys_sched_setscheduler(), sys_sched_getscheduler(), sys_sched_yield();
+int sys_sched_get_priority_max(), sys_sched_get_priority_min();
+int sys_sched_rr_get_interval(), sys_nanosleep(), sys_mremap();
+int sys_sendmsg(), sys_recvmsg();
+
+/* sys_socketcall subcalls */
+
+int sys_socket(), sys_bind(), sys_connect(), sys_listen();
+int sys_accept(), sys_getsockname(), sys_getpeername(), sys_socketpair();
+int sys_send(), sys_recv(), sys_sendto(), sys_recvfrom();
+int sys_shutdown(), sys_setsockopt(), sys_getsockopt();
+
+#ifndef ALPHA
+#define SYS_socket_subcall 180
+#define SYS_socket (SYS_socket_subcall + 1)
+#define SYS_bind (SYS_socket_subcall + 2)
+#define SYS_connect (SYS_socket_subcall + 3)
+#define SYS_listen (SYS_socket_subcall + 4)
+#define SYS_accept (SYS_socket_subcall + 5)
+#define SYS_getsockname (SYS_socket_subcall + 6)
+#define SYS_getpeername (SYS_socket_subcall + 7)
+#define SYS_socketpair (SYS_socket_subcall + 8)
+#define SYS_send (SYS_socket_subcall + 9)
+#define SYS_recv (SYS_socket_subcall + 10)
+#define SYS_sendto (SYS_socket_subcall + 11)
+#define SYS_recvfrom (SYS_socket_subcall + 12)
+#define SYS_shutdown (SYS_socket_subcall + 13)
+#define SYS_setsockopt (SYS_socket_subcall + 14)
+#define SYS_getsockopt (SYS_socket_subcall + 15)
+
+#define SYS_socket_nsubcalls 16
+#endif /* !ALPHA */
+
+/* sys_ipc subcalls */
+
+int sys_semget(), sys_semctl();
+int sys_msgsnd(), sys_msgrcv(), sys_msgget(), sys_msgctl();
+int sys_shmat(), sys_shmdt(), sys_shmget(), sys_shmctl();
+
+#ifndef ALPHA
+#define SYS_ipc_subcall 200
+#define SYS_semop (SYS_ipc_subcall + 1)
+#define SYS_semget (SYS_ipc_subcall + 2)
+#define SYS_semctl (SYS_ipc_subcall + 3)
+#define SYS_msgsnd (SYS_ipc_subcall + 11)
+#define SYS_msgrcv (SYS_ipc_subcall + 12)
+#define SYS_msgget (SYS_ipc_subcall + 13)
+#define SYS_msgctl (SYS_ipc_subcall + 14)
+#define SYS_shmat (SYS_ipc_subcall + 21)
+#define SYS_shmdt (SYS_ipc_subcall + 22)
+#define SYS_shmget (SYS_ipc_subcall + 23)
+#define SYS_shmctl (SYS_ipc_subcall + 24)
+
+#define SYS_ipc_nsubcalls 25
+#endif /* ALPHA */
+
+#ifdef ALPHA
+int osf_statfs(), osf_fstatfs(), sys_getpagesize(), sys_madvise();
+int sys_setpgrp(), sys_gethostname(), sys_getdtablesize(), sys_utimes();
+#endif
+
+int sys__llseek(), sys__newselect(), sys__sysctl(), sys_klog();
+int sys_prev_fstat(), sys_prev_lstat(), sys_prev_mknod(), sys_prev_stat();
+int sys_prev_ustat(), sys_syscall_flock(), sys_syscall_readv();
+int sys_syscall_writev();
+
+#include "syscall1.h"
diff --git a/linux/sparc/syscall1.h b/linux/sparc/syscall1.h
new file mode 100644
index 000000000..f6328a951
--- /dev/null
+++ b/linux/sparc/syscall1.h
@@ -0,0 +1,501 @@
+/*
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#define SOLARIS_syscall 0
+#define SOLARIS_exit 1
+#define SOLARIS_fork 2
+#define SOLARIS_read 3
+#define SOLARIS_write 4
+#define SOLARIS_open 5
+#define SOLARIS_close 6
+#define SOLARIS_wait 7
+#define SOLARIS_creat 8
+#define SOLARIS_link 9
+#define SOLARIS_unlink 10
+#define SOLARIS_exec 11
+#define SOLARIS_chdir 12
+#define SOLARIS_time 13
+#define SOLARIS_mknod 14
+#define SOLARIS_chmod 15
+#define SOLARIS_chown 16
+#define SOLARIS_brk 17
+#define SOLARIS_stat 18
+#define SOLARIS_lseek 19
+#define SOLARIS_getpid 20
+#define SOLARIS_mount 21
+#define SOLARIS_umount 22
+#define SOLARIS_setuid 23
+#define SOLARIS_getuid 24
+#define SOLARIS_stime 25
+#define SOLARIS_ptrace 26
+#define SOLARIS_alarm 27
+#define SOLARIS_fstat 28
+#define SOLARIS_pause 29
+#define SOLARIS_utime 30
+#define SOLARIS_stty 31
+#define SOLARIS_gtty 32
+#define SOLARIS_access 33
+#define SOLARIS_nice 34
+#define SOLARIS_statfs 35
+#define SOLARIS_sync 36
+#define SOLARIS_kill 37
+#define SOLARIS_fstatfs 38
+#define SOLARIS_pgrpsys 39
+#define SOLARIS_xenix 40
+#define SOLARIS_dup 41
+#define SOLARIS_pipe 42
+#define SOLARIS_times 43
+#define SOLARIS_profil 44
+#define SOLARIS_plock 45
+#define SOLARIS_setgid 46
+#define SOLARIS_getgid 47
+#define SOLARIS_signal 48
+#define SOLARIS_msgsys 49
+#define SOLARIS_syssun 50
+#define SOLARIS_acct 51
+#define SOLARIS_shmsys 52
+#define SOLARIS_semsys 53
+#define SOLARIS_ioctl 54
+#define SOLARIS_uadmin 55
+#define SOLARIS_utssys 57
+#define SOLARIS_fdsync 58
+#define SOLARIS_execve 59
+#define SOLARIS_umask 60
+#define SOLARIS_chroot 61
+#define SOLARIS_fcntl 62
+#define SOLARIS_ulimit 63
+#define SOLARIS_rmdir 79
+#define SOLARIS_mkdir 80
+#define SOLARIS_getdents 81
+#define SOLARIS_sysfs 84
+#define SOLARIS_getmsg 85
+#define SOLARIS_putmsg 86
+#define SOLARIS_poll 87
+#define SOLARIS_lstat 88
+#define SOLARIS_symlink 89
+#define SOLARIS_readlink 90
+#define SOLARIS_setgroups 91
+#define SOLARIS_getgroups 92
+#define SOLARIS_fchmod 93
+#define SOLARIS_fchown 94
+#define SOLARIS_sigprocmask 95
+#define SOLARIS_sigsuspend 96
+#define SOLARIS_sigaltstack 97
+#define SOLARIS_sigaction 98
+#define SOLARIS_sigpending 99
+#define SOLARIS_context 100
+#define SOLARIS_evsys 101
+#define SOLARIS_evtrapret 102
+#define SOLARIS_statvfs 103
+#define SOLARIS_fstatvfs 104
+#define SOLARIS_nfssys 106
+#define SOLARIS_waitsys 107
+#define SOLARIS_sigsendsys 108
+#define SOLARIS_hrtsys 109
+#define SOLARIS_acancel 110
+#define SOLARIS_async 111
+#define SOLARIS_priocntlsys 112
+#define SOLARIS_pathconf 113
+#define SOLARIS_mincore 114
+#define SOLARIS_mmap 115
+#define SOLARIS_mprotect 116
+#define SOLARIS_munmap 117
+#define SOLARIS_fpathconf 118
+#define SOLARIS_vfork 119
+#define SOLARIS_fchdir 120
+#define SOLARIS_readv 121
+#define SOLARIS_writev 122
+#define SOLARIS_xstat 123
+#define SOLARIS_lxstat 124
+#define SOLARIS_fxstat 125
+#define SOLARIS_xmknod 126
+#define SOLARIS_clocal 127
+#define SOLARIS_setrlimit 128
+#define SOLARIS_getrlimit 129
+#define SOLARIS_lchown 130
+#define SOLARIS_memcntl 131
+#define SOLARIS_getpmsg 132
+#define SOLARIS_putpmsg 133
+#define SOLARIS_rename 134
+#define SOLARIS_uname 135
+#define SOLARIS_setegid 136
+#define SOLARIS_sysconfig 137
+#define SOLARIS_adjtime 138
+#define SOLARIS_systeminfo 139
+#define SOLARIS_seteuid 141
+#define SOLARIS_vtrace 142
+#define SOLARIS_fork1 143
+#define SOLARIS_sigtimedwait 144
+#define SOLARIS_lwp_info 145
+#define SOLARIS_yield 146
+#define SOLARIS_lwp_sema_wait 147
+#define SOLARIS_lwp_sema_post 148
+#define SOLARIS_modctl 152
+#define SOLARIS_fchroot 153
+#define SOLARIS_utimes 154
+#define SOLARIS_vhangup 155
+#define SOLARIS_gettimeofday 156
+#define SOLARIS_getitimer 157
+#define SOLARIS_setitimer 158
+#define SOLARIS_lwp_create 159
+#define SOLARIS_lwp_exit 160
+#define SOLARIS_lwp_suspend 161
+#define SOLARIS_lwp_continue 162
+#define SOLARIS_lwp_kill 163
+#define SOLARIS_lwp_self 164
+#define SOLARIS_lwp_setprivate 165
+#define SOLARIS_lwp_getprivate 166
+#define SOLARIS_lwp_wait 167
+#define SOLARIS_lwp_mutex_unlock 168
+#define SOLARIS_lwp_mutex_lock 169
+#define SOLARIS_lwp_cond_wait 170
+#define SOLARIS_lwp_cond_signal 171
+#define SOLARIS_lwp_cond_broadcast 172
+#define SOLARIS_pread 173
+#define SOLARIS_pwrite 174
+#define SOLARIS_llseek 175
+#define SOLARIS_inst_sync 176
+#define SOLARIS_kaio 178
+#define SOLARIS_tsolsys 184
+#define SOLARIS_acl 185
+#define SOLARIS_auditsys 186
+#define SOLARIS_processor_bind 187
+#define SOLARIS_processor_info 188
+#define SOLARIS_p_online 189
+#define SOLARIS_sigqueue 190
+#define SOLARIS_clock_gettime 191
+#define SOLARIS_clock_settime 192
+#define SOLARIS_clock_getres 193
+#define SOLARIS_timer_create 194
+#define SOLARIS_timer_delete 195
+#define SOLARIS_timer_settime 196
+#define SOLARIS_timer_gettime 197
+#define SOLARIS_timer_getoverrun 198
+#define SOLARIS_nanosleep 199
+#define SOLARIS_facl 200
+#define SOLARIS_door 201
+#define SOLARIS_setreuid 202
+#define SOLARIS_setregid 203
+#define SOLARIS_signotifywait 210
+#define SOLARIS_lwp_sigredirect 211
+#define SOLARIS_lwp_alarm 212
+
+#include "dummy2.h"
+
+extern int solaris_syscall();
+extern int solaris_exit();
+extern int solaris_fork();
+extern int solaris_read();
+extern int solaris_write();
+extern int solaris_open();
+extern int solaris_close();
+extern int solaris_wait();
+extern int solaris_creat();
+extern int solaris_link();
+extern int solaris_unlink();
+extern int solaris_exec();
+extern int solaris_chdir();
+extern int solaris_time();
+extern int solaris_mknod();
+extern int solaris_chmod();
+extern int solaris_chown();
+extern int solaris_brk();
+extern int solaris_stat();
+extern int solaris_lseek();
+extern int solaris_getpid();
+extern int solaris_mount();
+extern int solaris_umount();
+extern int solaris_setuid();
+extern int solaris_getuid();
+extern int solaris_stime();
+extern int solaris_ptrace();
+extern int solaris_alarm();
+extern int solaris_fstat();
+extern int solaris_pause();
+extern int solaris_utime();
+extern int solaris_stty();
+extern int solaris_gtty();
+extern int solaris_access();
+extern int solaris_nice();
+extern int solaris_statfs();
+extern int solaris_sync();
+extern int solaris_kill();
+extern int solaris_fstatfs();
+extern int solaris_pgrpsys();
+extern int solaris_setpgrp();
+extern int solaris_xenix();
+extern int solaris_syssgi();
+extern int solaris_dup();
+extern int solaris_pipe();
+extern int solaris_times();
+extern int solaris_profil();
+extern int solaris_plock();
+extern int solaris_setgid();
+extern int solaris_getgid();
+extern int solaris_sigcall();
+extern int solaris_msgsys();
+extern int solaris_syssun();
+extern int solaris_sysi86();
+extern int solaris_sysmips();
+extern int solaris_sysmachine();
+extern int solaris_acct();
+extern int solaris_shmsys();
+extern int solaris_semsys();
+extern int solaris_ioctl();
+extern int solaris_uadmin();
+extern int solaris_utssys();
+extern int solaris_fdsync();
+extern int solaris_execve();
+extern int solaris_umask();
+extern int solaris_chroot();
+extern int solaris_fcntl();
+extern int solaris_ulimit();
+extern int solaris_rmdir();
+extern int solaris_mkdir();
+extern int solaris_getdents();
+extern int solaris_sysfs();
+extern int solaris_getmsg();
+extern int solaris_putmsg();
+extern int solaris_poll();
+extern int solaris_lstat();
+extern int solaris_symlink();
+extern int solaris_readlink();
+extern int solaris_setgroups();
+extern int solaris_getgroups();
+extern int solaris_fchmod();
+extern int solaris_fchown();
+extern int solaris_sigprocmask();
+extern int solaris_sigsuspend();
+extern int solaris_sigaltstack();
+extern int solaris_sigaction();
+extern int solaris_spcall();
+extern int solaris_context();
+extern int solaris_evsys();
+extern int solaris_evtrapret();
+extern int solaris_statvfs();
+extern int solaris_fstatvfs();
+extern int solaris_nfssys();
+extern int solaris_waitid();
+extern int solaris_sigsendsys();
+extern int solaris_hrtsys();
+extern int solaris_acancel();
+extern int solaris_async();
+extern int solaris_priocntlsys();
+extern int solaris_pathconf();
+extern int solaris_mincore();
+extern int solaris_mmap();
+extern int solaris_mprotect();
+extern int solaris_munmap();
+extern int solaris_fpathconf();
+extern int solaris_vfork();
+extern int solaris_fchdir();
+extern int solaris_readv();
+extern int solaris_writev();
+extern int solaris_xstat();
+extern int solaris_lxstat();
+extern int solaris_fxstat();
+extern int solaris_xmknod();
+extern int solaris_clocal();
+extern int solaris_setrlimit();
+extern int solaris_getrlimit();
+extern int solaris_lchown();
+extern int solaris_memcntl();
+extern int solaris_getpmsg();
+extern int solaris_putpmsg();
+extern int solaris_rename();
+extern int solaris_uname();
+extern int solaris_setegid();
+extern int solaris_sysconfig();
+extern int solaris_adjtime();
+extern int solaris_sysinfo();
+extern int solaris_seteuid();
+extern int solaris_vtrace();
+extern int solaris_fork1();
+extern int solaris_sigtimedwait();
+extern int solaris_lwp_info();
+extern int solaris_yield();
+extern int solaris_lwp_sema_wait();
+extern int solaris_lwp_sema_post();
+extern int solaris_modctl();
+extern int solaris_fchroot();
+extern int solaris_utimes();
+extern int solaris_vhangup();
+extern int solaris_gettimeofday();
+extern int solaris_getitimer();
+extern int solaris_setitimer();
+extern int solaris_lwp_create();
+extern int solaris_lwp_exit();
+extern int solaris_lwp_suspend();
+extern int solaris_lwp_continue();
+extern int solaris_lwp_kill();
+extern int solaris_lwp_self();
+extern int solaris_lwp_setprivate();
+extern int solaris_lwp_getprivate();
+extern int solaris_lwp_wait();
+extern int solaris_lwp_mutex_unlock();
+extern int solaris_lwp_mutex_lock();
+extern int solaris_lwp_cond_wait();
+extern int solaris_lwp_cond_signal();
+extern int solaris_lwp_cond_broadcast();
+extern int solaris_pread();
+extern int solaris_pwrite();
+extern int solaris_llseek();
+extern int solaris_inst_sync();
+extern int solaris_auditsys();
+extern int solaris_processor_bind();
+extern int solaris_processor_info();
+extern int solaris_p_online();
+extern int solaris_sigqueue();
+extern int solaris_clock_gettime();
+extern int solaris_clock_settime();
+extern int solaris_clock_getres();
+extern int solaris_timer_create();
+extern int solaris_timer_delete();
+extern int solaris_timer_settime();
+extern int solaris_timer_gettime();
+extern int solaris_timer_getoverrun();
+extern int solaris_nanosleep();
+
+/* solaris_pgrpsys subcalls */
+
+extern int solaris_getpgrp(), solaris_setpgrp(), solaris_getsid();
+extern int solaris_setsid(), solaris_getpgid(), solaris_setpgid();
+
+#define SOLARIS_pgrpsys_subcall 300
+#define SOLARIS_getpgrp (SOLARIS_pgrpsys_subcall + 0)
+#define SOLARIS_setpgrp (SOLARIS_pgrpsys_subcall + 1)
+#define SOLARIS_getsid (SOLARIS_pgrpsys_subcall + 2)
+#define SOLARIS_setsid (SOLARIS_pgrpsys_subcall + 3)
+#define SOLARIS_getpgid (SOLARIS_pgrpsys_subcall + 4)
+#define SOLARIS_setpgid (SOLARIS_pgrpsys_subcall + 5)
+
+#define SOLARIS_pgrpsys_nsubcalls 6
+
+/* solaris_sigcall subcalls */
+
+#undef SOLARIS_signal
+#define SOLARIS_sigcall 48
+
+extern int solaris_signal(), solaris_sigset(), solaris_sighold();
+extern int solaris_sigrelse(), solaris_sigignore(), solaris_sigpause();
+
+#define SOLARIS_sigcall_subcall 310
+#define SOLARIS_signal (SOLARIS_sigcall_subcall + 0)
+#define SOLARIS_sigset (SOLARIS_sigcall_subcall + 1)
+#define SOLARIS_sighold (SOLARIS_sigcall_subcall + 2)
+#define SOLARIS_sigrelse (SOLARIS_sigcall_subcall + 3)
+#define SOLARIS_sigignore (SOLARIS_sigcall_subcall + 4)
+#define SOLARIS_sigpause (SOLARIS_sigcall_subcall + 5)
+
+#define SOLARIS_sigcall_nsubcalls 6
+
+/* msgsys subcalls */
+
+extern int solaris_msgget(), solaris_msgctl(), solaris_msgrcv(), solaris_msgsnd();
+
+#define SOLARIS_msgsys_subcall 320
+#define SOLARIS_msgget (SOLARIS_msgsys_subcall + 0)
+#define SOLARIS_msgctl (SOLARIS_msgsys_subcall + 1)
+#define SOLARIS_msgrcv (SOLARIS_msgsys_subcall + 2)
+#define SOLARIS_msgsnd (SOLARIS_msgsys_subcall + 3)
+
+#define SOLARIS_msgsys_nsubcalls 4
+
+/* shmsys subcalls */
+
+extern int solaris_shmat(), solaris_shmctl(), solaris_shmdt(), solaris_shmget();
+
+#define SOLARIS_shmsys_subcall 330
+#define SOLARIS_shmat (SOLARIS_shmsys_subcall + 0)
+#define SOLARIS_shmctl (SOLARIS_shmsys_subcall + 1)
+#define SOLARIS_shmdt (SOLARIS_shmsys_subcall + 2)
+#define SOLARIS_shmget (SOLARIS_shmsys_subcall + 3)
+
+#define SOLARIS_shmsys_nsubcalls 4
+
+/* semsys subcalls */
+
+extern int solaris_semctl(), solaris_semget(), solaris_semop();
+
+#define SOLARIS_semsys_subcall 340
+#define SOLARIS_semctl (SOLARIS_semsys_subcall + 0)
+#define SOLARIS_semget (SOLARIS_semsys_subcall + 1)
+#define SOLARIS_semop (SOLARIS_semsys_subcall + 2)
+
+#define SOLARIS_semsys_nsubcalls 3
+
+/* utssys subcalls */
+
+extern int solaris_olduname(), solaris_ustat(), solaris_fusers();
+
+#define SOLARIS_utssys_subcall 350
+
+#define SOLARIS_olduname (SOLARIS_utssys_subcall + 0)
+ /* 1 is unused */
+#define SOLARIS_ustat (SOLARIS_utssys_subcall + 2)
+#define SOLARIS_fusers (SOLARIS_utssys_subcall + 3)
+
+#define SOLARIS_utssys_nsubcalls 4
+
+/* sysfs subcalls */
+
+extern int solaris_sysfs1(), solaris_sysfs2(), solaris_sysfs3();
+
+#define SOLARIS_sysfs_subcall 360
+ /* 0 is unused */
+#define SOLARIS_sysfs1 (SOLARIS_sysfs_subcall + 1)
+#define SOLARIS_sysfs2 (SOLARIS_sysfs_subcall + 2)
+#define SOLARIS_sysfs3 (SOLARIS_sysfs_subcall + 3)
+
+#define SOLARIS_sysfs_nsubcalls 4
+
+/* solaris_spcall subcalls */
+
+#undef SOLARIS_sigpending
+#define SOLARIS_spcall 99
+
+extern int solaris_sigpending(), solaris_sigfillset();
+
+#define SOLARIS_spcall_subcall 370
+ /* 0 is unused */
+#define SOLARIS_sigpending (SOLARIS_spcall_subcall + 1)
+#define SOLARIS_sigfillset (SOLARIS_spcall_subcall + 2)
+
+#define SOLARIS_spcall_nsubcalls 3
+
+/* solaris_context subcalls */
+
+extern int solaris_getcontext(), solaris_setcontext();
+
+#define SOLARIS_context_subcall 380
+#define SOLARIS_getcontext (SOLARIS_context_subcall + 0)
+#define SOLARIS_setcontext (SOLARIS_context_subcall + 1)
+
+#define SOLARIS_context_nsubcalls 2
+
diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h
new file mode 100644
index 000000000..4be6d5e23
--- /dev/null
+++ b/linux/sparc/syscallent.h
@@ -0,0 +1,357 @@
+ { 1, 0, sys_setup, "setup" }, /* 0 */
+ { 1, TP, sys_exit, "exit" }, /* 1 */
+ { 0, TP, sys_fork, "fork" }, /* 2 */
+ { 3, 0, sys_read, "read" }, /* 3 */
+ { 3, 0, sys_write, "write" }, /* 4 */
+ { 3, TF, sys_open, "open" }, /* 5 */
+ { 1, 0, sys_close, "close" }, /* 6 */
+ { 4, TP, sys_wait4, "wait4" }, /* 7 */
+ { 2, TF, sys_creat, "creat" }, /* 8 */
+ { 2, TF, sys_link, "link" }, /* 9 */
+ { 1, TF, sys_unlink, "unlink" }, /* 10 */
+ { 2, TF|TP, sys_execv, "execv" }, /* 11 */
+ { 1, TF, sys_chdir, "chdir" }, /* 12 */
+ { 0, 0, printargs, "sunos-time!"}, /* 13 */
+ { 3, TF, sys_mknod, "mknod" }, /* 14 */
+ { 2, TF, sys_chmod, "chmod" }, /* 15 */
+ { 3, TF, sys_chown, "chown" }, /* 16 */
+ { 1, 0, sys_brk, "brk" }, /* 17 */
+ { 2, 0, printargs, "SYS_18" }, /* 18 */
+ { 3, 0, sys_lseek, "lseek" }, /* 19 */
+ { 0, 0, sys_getpid, "getpid" }, /* 20 */
+ { 0, 0, printargs, "SYS_21" }, /* 21 */
+ { 1, TF, printargs, "SYS_22" }, /* 22 */
+ { 1, 0, sys_setuid, "setuid" }, /* 23 */
+ { 0, 0, sys_getuid, "getuid" }, /* 24 */
+ { 1, 0, printargs, "SYS_25" }, /* 25 */
+ { 5, 0, sys_ptrace, "ptrace" }, /* 26 */
+ { 1, 0, sys_alarm, "alarm" }, /* 27 */
+ { 2, 0, printargs, "SYS_28" }, /* 28 */
+ { 0, TS, sys_pause, "pause" }, /* 29 */
+ { 2, TF, sys_utime, "utime" }, /* 30 */
+ { 2, 0, sys_stty, "stty" }, /* 31 */
+ { 2, 0, sys_gtty, "gtty" }, /* 32 */
+ { 2, TF, sys_access, "access" }, /* 33 */
+ { 1, 0, sys_nice, "nice" }, /* 34 */
+ { 1, 0, sys_ftime, "ftime" }, /* 35 */
+ { 0, 0, sys_sync, "sync" }, /* 36 */
+ { 2, TS, sys_kill, "kill" }, /* 37 */
+ { 2, TF, sys_stat, "stat" }, /* 38 */
+ { 2, 0, printargs, "SYS_39" }, /* 39 */
+ { 2, TF, sys_lstat, "lstat" }, /* 40 */
+ { 2, 0, sys_dup, "dup" }, /* 41 */
+ { 0, 0, sys_pipe, "pipe" }, /* 42 */
+ { 1, 0, sys_times, "times" }, /* 43 */
+ { 4, 0, sys_profil, "profil" }, /* 44 */
+ { 0, 0, printargs, "SYS_45" }, /* 45 */
+ { 1, 0, sys_setgid, "setgid" }, /* 46 */
+ { 0, 0, sys_getgid, "getgid" }, /* 47 */
+ { 2, 0, sys_signal, "signal" }, /* 48 */
+ { 0, 0, sys_geteuid, "geteuid" }, /* 49 */
+ { 0, 0, sys_getegid, "getegid" }, /* 50 */
+ { 1, 0, sys_acct, "acct" }, /* 51 */
+ { 0, 0, printargs, "SYS_52" }, /* 52 */
+ { 4, 0, sys_mctl, "mctl" }, /* 53 */
+ { 3, 0, sys_ioctl, "ioctl" }, /* 54 */
+ { 2, 0, sys_reboot, "reboot" }, /* 55 */
+ { 3, 0, printargs, "SYS_56" }, /* 56 */
+ { 2, TF, sys_symlink, "symlink" }, /* 57 */
+ { 3, TF, sys_readlink, "readlink" }, /* 58 */
+ { 3, TF|TP, sys_execve, "execve" }, /* 59 */
+ { 1, 0, sys_umask, "umask" }, /* 60 */
+ { 1, TF, sys_chroot, "chroot" }, /* 61 */
+ { 2, 0, sys_fstat, "fstat" }, /* 62 */
+ { 0, 0, printargs, "SYS_63" }, /* 63 */
+ { 1, 0, sys_getpagesize,"getpagesize" }, /* 64 */
+ { 3, 0, sys_msync, "msync" }, /* 65 */
+ { 0, TP, printargs, "SYS_66" }, /* 66 */
+ { 0, 0, printargs, "SYS_67" }, /* 67 */
+ { 0, 0, printargs, "SYS_68" }, /* 68 */
+ { 1, 0, sys_sbrk, "sbrk" }, /* 69 */
+ { 1, 0, printargs, "sstk" }, /* 70 */
+ { 6, 0, sys_mmap, "mmap" }, /* 71 */
+ { 1, 0, printargs, "vadvise" }, /* 72 */
+ { 2, 0, sys_munmap, "munmap" }, /* 73 */
+ { 3, 0, sys_mprotect, "mprotect" }, /* 74 */
+ { 3, 0, printargs, "madvise" }, /* 75 */
+ { 1, 0, sys_vhangup, "vhangup" }, /* 76 */
+ { 2, 0, printargs, "SYS_77" }, /* 77 */
+ { 3, 0, sys_mincore, "mincore" }, /* 78 */
+ { 2, 0, sys_getgroups, "getgroups" }, /* 79 */
+ { 2, 0, sys_setgroups, "setgroups" }, /* 80 */
+ { 1, 0, sys_getpgrp, "getpgrp" }, /* 81 */
+ { 2, 0, sys_setpgrp, "setpgrp" }, /* 82 */
+ { 3, 0, sys_setitimer, "setitimer" }, /* 83 */
+ { 0, 0, printargs, "SYS_84" }, /* 84 */
+ { 1, TF, sys_swapon, "swapon" }, /* 85 */
+ { 2, 0, sys_getitimer, "getitimer" }, /* 86 */
+ { 2, 0, sys_gethostname,"gethostname" }, /* 87 */
+ { 2, 0, sys_sethostname,"sethostname" }, /* 88 */
+ { 0, 0, sys_getdtablesize,"getdtablesize" }, /* 89 */
+ { 2, 0, sys_dup2, "dup2" }, /* 90 */
+ { 2, 0, printargs, "getdopt" }, /* 91 */
+ { 3, 0, sys_fcntl, "fcntl" }, /* 92 */
+ { 5, 0, sys_select, "select" }, /* 93 */
+ { 2, 0, printargs, "setdopt" }, /* 94 */
+ { 1, 0, sys_fsync, "fsync" }, /* 95 */
+ { 3, 0, sys_setpriority,"setpriority" }, /* 96 */
+ { 3, TN, sys_socket, "socket" }, /* 97 */
+ { 3, TN, sys_connect, "connect" }, /* 98 */
+ { 3, TN, sys_accept, "accept" }, /* 99 */
+ { 2, 0, sys_getpriority,"getpriority" }, /* 100 */
+ { 4, TN, sys_send, "send" }, /* 101 */
+ { 4, TN, sys_recv, "recv" }, /* 102 */
+ { 0, 0, printargs, "SYS_103" }, /* 103 */
+ { 3, TN, sys_bind, "bind" }, /* 104 */
+ { 5, TN, sys_setsockopt, "setsockopt" }, /* 105 */
+ { 2, TN, sys_listen, "listen" }, /* 106 */
+ { 2, 0, printargs, "SYS_107" }, /* 107 */
+ { 3, TS, printargs, "sigvec" }, /* 108 */
+ { 1, TS, sys_sigblock, "sigblock" }, /* 109 */
+ { 1, TS, sys_sigsetmask, "sigsetmask" }, /* 110 */
+ { 1, TS, printargs, "sigpause" }, /* 111 */
+ { 2, TS, printargs, "sigstack" }, /* 112 */
+ { 3, TN, sys_recvmsg, "recvmsg" }, /* 113 */
+ { 3, TN, sys_sendmsg, "sendmsg" }, /* 114 */
+ { 3, 0, printargs, "vtrace" }, /* 115 */
+ { 2, 0, sys_gettimeofday,"gettimeofday" }, /* 116 */
+ { 2, 0, sys_getrusage, "getrusage" }, /* 117 */
+ { 5, TN, sys_getsockopt, "getsockopt" }, /* 118 */
+ { 0, 0, printargs, "SYS_119" }, /* 119 */
+ { 3, 0, sys_readv, "readv" }, /* 120 */
+ { 3, 0, sys_writev, "writev" }, /* 121 */
+ { 2, 0, sys_settimeofday,"settimeofday" }, /* 122 */
+ { 3, 0, sys_fchown, "fchown" }, /* 123 */
+ { 2, 0, sys_fchmod, "fchmod" }, /* 124 */
+ { 6, TN, sys_recvfrom, "recvfrom" }, /* 125 */
+ { 2, 0, sys_setreuid, "setreuid" }, /* 126 */
+ { 2, 0, sys_setregid, "setregid" }, /* 127 */
+ { 2, TF, sys_rename, "rename" }, /* 128 */
+ { 2, TF, sys_truncate, "truncate" }, /* 129 */
+ { 2, 0, sys_ftruncate, "ftruncate" }, /* 130 */
+ { 2, 0, sys_flock, "flock" }, /* 131 */
+ { 0, 0, printargs, "SYS_132" }, /* 132 */
+ { 6, TN, sys_sendto, "sendto" }, /* 133 */
+ { 2, TN, sys_shutdown, "shutdown" }, /* 134 */
+ { 5, TN, sys_socketpair, "socketpair" }, /* 135 */
+ { 2, TF, sys_mkdir, "mkdir" }, /* 136 */
+ { 1, TF, sys_rmdir, "rmdir" }, /* 137 */
+ { 2, TF, sys_utimes, "utimes" }, /* 138 */
+ { 0, TS, printargs, "SYS_139" }, /* 139 */
+ { 2, 0, sys_adjtime, "adjtime" }, /* 140 */
+ { 3, TN, sys_getpeername,"getpeername" }, /* 141 */
+ { 2, 0, sys_gethostid, "gethostid" }, /* 142 */
+ { 0, 0, printargs, "SYS_143" }, /* 143 */
+ { 2, 0, sys_getrlimit, "getrlimit" }, /* 144 */
+ { 2, 0, sys_setrlimit, "setrlimit" }, /* 145 */
+ { 2, TS, sys_killpg, "killpg" }, /* 146 */
+ { 0, 0, printargs, "SYS_147" }, /* 147 */
+ { 0, 0, printargs, "SYS_148" }, /* 148 */
+ { 0, 0, printargs, "SYS_149" }, /* 149 */
+ { 3, TN, sys_getsockname,"getsockname" }, /* 150 */
+ { 4, TN, sys_getmsg, "getmsg" }, /* 151 */
+ { 4, TN, sys_putmsg, "putmsg" }, /* 152 */
+ { 4, TN, printargs, "poll" }, /* 153 */
+ { 0, 0, printargs, "SYS_154" }, /* 154 */
+ { 1, 0, printargs, "nfssvc" }, /* 155 */
+ { 4, 0, printargs, "getdirentries" }, /* 156 */
+ { 2, TF, sys_statfs, "statfs" }, /* 157 */
+ { 2, 0, sys_fstatfs, "fstatfs" }, /* 158 */
+ { 1, TF, sys_umount, "umount" }, /* 159 */
+ { 0, 0, printargs, "async_daemon" }, /* 160 */
+ { 2, 0, printargs, "getfh" }, /* 161 */
+ { 2, 0, printargs, "getdomainname" }, /* 162 */
+ { 2, 0, sys_setdomainname,"setdomainname" }, /* 163 */
+ { 5, 0, printargs, "SYS_164" }, /* 164 */
+ { 4, 0, sys_quotactl, "quotactl" }, /* 165 */
+ { 2, 0, printargs, "exportfs" }, /* 166 */
+ { 4, TF, sys_mount, "mount" }, /* 167 */
+ { 2, 0, sys_ustat, "ustat" }, /* 168 */
+ { 5, TI, printargs, "semsys" }, /* 169 */
+ { 5, TI, printargs, "msgsys" }, /* 170 */
+ { 5, TI, printargs, "shmsys" }, /* 171 */
+ { 4, 0, printargs, "auditsys" }, /* 172 */
+ { 5, 0, printargs, "rfssys" }, /* 173 */
+ { 3, 0, sys_getdents, "getdents" }, /* 174 */
+ { 1, 0, sys_setsid, "setsid" }, /* 175 */
+ { 1, 0, sys_fchdir, "fchdir" }, /* 176 */
+ { 1, 0, sys_fchroot, "fchroot" }, /* 177 */
+ { 2, 0, printargs, "vpixsys" }, /* 178 */
+ { 6, 0, printargs, "aioread" }, /* 179 */
+ { 6, 0, printargs, "aiowrite" }, /* 180 */
+ { 1, 0, printargs, "aiowait" }, /* 181 */
+ { 1, 0, printargs, "aiocancel" }, /* 182 */
+ { 1, TS, sys_sigpending, "sigpending" }, /* 183 */
+ { 0, 0, printargs, "SYS_184" }, /* 184 */
+ { 2, 0, sys_setpgid, "setpgid" }, /* 185 */
+ { 2, TF, printargs, "pathconf" }, /* 186 */
+ { 2, 0, printargs, "fpathconf" }, /* 187 */
+ { 1, 0, printargs, "sysconf" }, /* 188 */
+ { 1, 0, sys_uname, "uname" }, /* 189 */
+
+ /* Linux only system calls */
+
+ { 4, 0, sys_init_module,"init_module" }, /* 190 */
+ { 1, 0, sys_personality,"personality" }, /* 191 */
+ { 0, 0, sys_prof, "prof" }, /* 192 */
+ { 0, 0, sys_break, "break" }, /* 193 */
+ { 0, 0, sys_lock, "lock" }, /* 194 */
+ { 0, 0, sys_mpx, "mpx" }, /* 195 */
+ { 2, 0, sys_ulimit, "ulimit" }, /* 196 */
+ { 0, 0, sys_getppid, "getppid" }, /* 197 */
+ { 3, TS, sys_sigaction, "sigaction" }, /* 198 */
+ { 5, 0, printargs, "sgetmask" }, /* 199 */
+ { 5, 0, printargs, "ssetmask" }, /* 200 */
+ { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 201 */
+ { 2, TF, sys_oldlstat, "oldlstat" }, /* 202 */
+ { 1, TF, sys_uselib, "uselib" }, /* 203 */
+ { 3, 0, sys_readdir, "readdir" }, /* 204 */
+ { 3, 0, sys_ioperm, "ioperm" }, /* 205 */
+ { 2, 0, sys_socketcall, "socketcall" }, /* 206 */
+ { 3, 0, sys_syslog, "syslog" }, /* 207 */
+ { 1, 0, sys_olduname, "olduname" }, /* 208 */
+ { 1, 0, sys_iopl, "iopl" }, /* 209 */
+ { 0, 0, sys_idle, "idle" }, /* 210 */
+ { 1, 0, sys_vm86, "vm86" }, /* 211 */
+ { 3, TP, sys_waitpid, "waitpid" }, /* 212 */
+ { 1, 0, sys_swapoff, "swapoff" }, /* 213 */
+ { 1, 0, sys_sysinfo, "sysinfo" }, /* 214 */
+ { 5, 0, sys_ipc, "ipc" }, /* 215 */
+ { 1, TS, sys_sigreturn, "sigreturn" }, /* 216 */
+ { 2, TP, sys_clone, "clone" }, /* 217 */
+ { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 218 */
+ { 1, 0, sys_adjtimex, "adjtimex" }, /* 219 */
+ { 3, TS, sys_sigprocmask,"sigprocmask" }, /* 220 */
+ { 2, 0, sys_create_module,"create_module" }, /* 221 */
+ { 1, 0, sys_delete_module,"delete_module" },
+ { 1, 0, sys_get_kernel_syms,"get_kernel_syms"}, /* 223 */
+ { 1, 0, sys_getpgid, "getpgid" }, /* 224 */
+ { 0, 0, sys_bdflush, "bdflush" }, /* 225 */
+ { 3, 0, sys_sysfs, "sysfs" }, /* 226 */
+ { 5, 0, sys_afs_syscall,"afs_syscall" }, /* 227 */
+ { 1, 0, sys_setfsuid, "setfsuid" }, /* 228 */
+ { 1, 0, sys_setfsgid, "setfsgid" }, /* 229 */
+ { 5, 0, printargs, "_newselect" }, /* 230 */
+ { 1, 0, sys_time, "time" }, /* 231 */
+ { 2, TF, sys_oldstat, "oldstat" }, /* 232 */
+ { 1, 0, sys_stime, "stime" }, /* 233 */
+ { 2, 0, sys_oldfstat, "oldfstat" }, /* 234 */
+ { 0, 0, sys_phys, "phys" }, /* 235 */
+ { 5, 0, printargs, "_llseek" }, /* 236 */
+ { 5, 0, sys_mlock, "mlock" }, /* 237 */
+ { 5, 0, sys_munlock, "munlock" }, /* 238 */
+ { 5, 0, sys_mlockall, "mlockall" }, /* 239 */
+ { 5, 0, sys_munlockall, "munlockall" }, /* 240 */
+ { 5, 0, sys_sched_setparam,"sched_setparam"}, /* 241 */
+ { 5, 0, sys_sched_getparam,"sched_getparam"}, /* 242 */
+{ 5, 0, sys_sched_setscheduler,"sched_setscheduler"}, /* 243 */
+{ 5, 0, sys_sched_getscheduler,"sched_getscheduler"}, /* 244 */
+{ 5, 0, sys_sched_yield,"sched_yield" }, /* 245 */
+{ 5, 0,sys_sched_get_priority_max,"sched_get_priority_max"}, /* 246 */
+{ 5, 0,sys_sched_get_priority_min,"sched_get_priority_min"}, /* 247 */
+{ 5, 0,sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 248 */
+ { 5, 0, sys_nanosleep, "nanosleep" }, /* 249 */
+ { 5, 0, sys_mremap, "mremap" }, /* 250 */
+ { 5, 0, sys_sysctl, "_sysctl" }, /* 251 */
+ { 5, 0, sys_getsid, "getsid" }, /* 252 */
+ { 5, 0, sys_fdatasync, "fdatasync" }, /* 253 */
+ { 5, 0, printargs, "SYS_254" }, /* 254 */
+ { 5, 0, printargs, "SYS_255" }, /* 255 */
+ { 5, 0, printargs, "SYS_256" }, /* 256 */
+ { 5, 0, printargs, "SYS_257" }, /* 257 */
+ { 5, 0, printargs, "SYS_258" }, /* 258 */
+ { 5, 0, printargs, "SYS_259" }, /* 259 */
+ { 5, 0, printargs, "SYS_260" }, /* 260 */
+ { 5, 0, printargs, "SYS_261" }, /* 261 */
+ { 5, 0, printargs, "SYS_262" }, /* 262 */
+ { 5, 0, printargs, "SYS_263" }, /* 263 */
+ { 5, 0, printargs, "SYS_264" }, /* 264 */
+ { 5, 0, printargs, "SYS_265" }, /* 265 */
+ { 5, 0, printargs, "SYS_266" }, /* 266 */
+ { 5, 0, printargs, "SYS_267" }, /* 267 */
+ { 5, 0, printargs, "SYS_268" }, /* 268 */
+ { 5, 0, printargs, "SYS_269" }, /* 269 */
+ { 5, 0, printargs, "SYS_270" }, /* 270 */
+ { 5, 0, printargs, "SYS_271" }, /* 271 */
+ { 5, 0, printargs, "SYS_272" }, /* 272 */
+ { 5, 0, printargs, "SYS_273" }, /* 273 */
+ { 5, 0, printargs, "SYS_274" }, /* 274 */
+ { 5, 0, printargs, "SYS_275" }, /* 275 */
+ { 5, 0, printargs, "SYS_276" }, /* 276 */
+ { 5, 0, printargs, "SYS_277" }, /* 277 */
+ { 5, 0, printargs, "SYS_278" }, /* 278 */
+ { 5, 0, printargs, "SYS_279" }, /* 279 */
+ { 5, 0, printargs, "SYS_280" }, /* 280 */
+ { 5, 0, printargs, "SYS_281" }, /* 281 */
+ { 5, 0, printargs, "SYS_282" }, /* 282 */
+ { 5, 0, printargs, "SYS_283" }, /* 283 */
+ { 5, 0, printargs, "SYS_284" }, /* 284 */
+ { 5, 0, printargs, "SYS_285" }, /* 285 */
+ { 5, 0, printargs, "SYS_286" }, /* 286 */
+ { 5, 0, printargs, "SYS_287" }, /* 287 */
+ { 5, 0, printargs, "SYS_288" }, /* 288 */
+ { 5, 0, printargs, "SYS_289" }, /* 289 */
+ { 5, 0, printargs, "SYS_290" }, /* 290 */
+ { 5, 0, printargs, "SYS_291" }, /* 291 */
+ { 5, 0, printargs, "SYS_292" }, /* 292 */
+ { 5, 0, printargs, "SYS_293" }, /* 293 */
+ { 5, 0, printargs, "SYS_294" }, /* 294 */
+ { 5, 0, printargs, "SYS_295" }, /* 295 */
+ { 5, 0, printargs, "SYS_296" }, /* 296 */
+ { 5, 0, printargs, "SYS_297" }, /* 297 */
+ { 5, 0, printargs, "SYS_298" }, /* 298 */
+ { 5, 0, printargs, "SYS_299" }, /* 299 */
+ { 5, 0, printargs, "SYS_300" }, /* 300 */
+ { 5, 0, printargs, "SYS_301" }, /* 301 */
+ { 5, 0, printargs, "SYS_302" }, /* 302 */
+ { 5, 0, printargs, "SYS_303" }, /* 303 */
+ { 5, 0, printargs, "SYS_304" }, /* 304 */
+ { 5, 0, printargs, "SYS_305" }, /* 305 */
+ { 5, 0, printargs, "SYS_306" }, /* 306 */
+ { 5, 0, printargs, "SYS_307" }, /* 307 */
+ { 5, 0, printargs, "SYS_308" }, /* 308 */
+ { 5, 0, printargs, "SYS_309" }, /* 309 */
+ { 5, 0, printargs, "SYS_310" }, /* 310 */
+ { 5, 0, printargs, "SYS_311" }, /* 311 */
+ { 5, 0, printargs, "SYS_312" }, /* 312 */
+ { 5, 0, printargs, "SYS_313" }, /* 313 */
+ { 5, 0, printargs, "SYS_314" }, /* 314 */
+ { 5, 0, printargs, "SYS_315" }, /* 315 */
+ { 5, 0, printargs, "SYS_316" }, /* 316 */
+ { 5, 0, printargs, "SYS_317" }, /* 317 */
+ { 5, 0, printargs, "SYS_318" }, /* 318 */
+ { 5, 0, printargs, "SYS_319" }, /* 319 */
+ { 5, 0, printargs, "SYS_320" }, /* 320 */
+ { 5, 0, printargs, "SYS_321" }, /* 321 */
+ { 5, 0, printargs, "SYS_322" }, /* 322 */
+ { 5, 0, printargs, "SYS_323" }, /* 323 */
+ { 5, 0, printargs, "SYS_324" }, /* 324 */
+ { 5, 0, printargs, "SYS_325" }, /* 325 */
+ { 5, 0, printargs, "SYS_326" }, /* 326 */
+ { 5, 0, printargs, "SYS_327" }, /* 327 */
+ { 5, 0, printargs, "SYS_328" }, /* 328 */
+ { 5, 0, printargs, "SYS_329" }, /* 329 */
+ { 5, 0, printargs, "SYS_330" }, /* 330 */
+ { 5, 0, printargs, "SYS_331" }, /* 331 */
+ { 5, 0, printargs, "SYS_332" }, /* 332 */
+ { 5, 0, printargs, "SYS_333" }, /* 333 */
+ { 5, 0, printargs, "SYS_334" }, /* 334 */
+ { 5, 0, printargs, "SYS_335" }, /* 335 */
+ { 5, 0, printargs, "SYS_336" }, /* 336 */
+ { 5, 0, printargs, "SYS_337" }, /* 337 */
+ { 5, 0, printargs, "SYS_338" }, /* 338 */
+ { 5, 0, printargs, "SYS_339" }, /* 339 */
+ { 5, 0, printargs, "SYS_340" }, /* 340 */
+ { 5, 0, printargs, "SYS_341" }, /* 341 */
+ { 5, 0, printargs, "SYS_342" }, /* 342 */
+ { 5, 0, printargs, "SYS_343" }, /* 343 */
+ { 5, 0, printargs, "SYS_344" }, /* 344 */
+ { 5, 0, printargs, "SYS_345" }, /* 345 */
+ { 5, 0, printargs, "SYS_346" }, /* 346 */
+ { 5, 0, printargs, "SYS_347" }, /* 347 */
+ { 5, 0, printargs, "SYS_348" }, /* 348 */
+ { 5, 0, printargs, "SYS_349" }, /* 349 */
+ { 5, 0, printargs, "SYS_350" }, /* 350 */
+ { 5, 0, printargs, "SYS_351" }, /* 351 */
+ { 5, 0, printargs, "SYS_352" }, /* 352 */
+
diff --git a/linux/sparc/syscallent1.h b/linux/sparc/syscallent1.h
new file mode 100644
index 000000000..821b3a95f
--- /dev/null
+++ b/linux/sparc/syscallent1.h
@@ -0,0 +1,439 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+ { 6, 0, solaris_syscall, "syscall" }, /* 0 */
+ { 6, TP, solaris_exit, "_exit" }, /* 1 */
+ { 6, TP, solaris_fork, "fork" }, /* 2 */
+ { 6, 0, solaris_read, "read" }, /* 3 */
+ { 6, 0, solaris_write, "write" }, /* 4 */
+ { 6, TF, solaris_open, "open" }, /* 5 */
+ { 6, 0, solaris_close, "close" }, /* 6 */
+ { 6, TP, solaris_wait, "wait" }, /* 7 */
+ { 6, TF, solaris_creat, "creat" }, /* 8 */
+ { 6, TF, solaris_link, "link" }, /* 9 */
+ { 6, TF, solaris_unlink, "unlink" }, /* 10 */
+ { 6, TF|TP, solaris_exec, "exec" }, /* 11 */
+ { 6, TF, solaris_chdir, "chdir" }, /* 12 */
+ { 6, 0, solaris_time, "time" }, /* 13 */
+ { 6, TF, solaris_mknod, "mknod" }, /* 14 */
+ { 6, TF, solaris_chmod, "chmod" }, /* 15 */
+ { 6, TF, solaris_chown, "chown" }, /* 16 */
+ { 6, 0, solaris_brk, "brk" }, /* 17 */
+ { 6, TF, solaris_stat, "stat" }, /* 18 */
+ { 6, 0, solaris_lseek, "lseek" }, /* 19 */
+ { 6, 0, solaris_getpid, "getpid" }, /* 20 */
+ { 6, TF, solaris_mount, "mount" }, /* 21 */
+ { 6, TF, solaris_umount, "umount" }, /* 22 */
+ { 6, 0, solaris_setuid, "setuid" }, /* 23 */
+ { 6, 0, solaris_getuid, "getuid" }, /* 24 */
+ { 6, 0, solaris_stime, "stime" }, /* 25 */
+ { 6, 0, solaris_ptrace, "ptrace" }, /* 26 */
+ { 6, 0, solaris_alarm, "alarm" }, /* 27 */
+ { 6, 0, solaris_fstat, "fstat" }, /* 28 */
+ { 6, TS, solaris_pause, "pause" }, /* 29 */
+ { 6, TF, solaris_utime, "utime" }, /* 30 */
+ { 6, 0, solaris_stty, "stty" }, /* 31 */
+ { 6, 0, solaris_gtty, "gtty" }, /* 32 */
+ { 6, TF, solaris_access, "access" }, /* 33 */
+ { 6, 0, solaris_nice, "nice" }, /* 34 */
+ { 6, TF, solaris_statfs, "statfs" }, /* 35 */
+ { 6, 0, solaris_sync, "sync" }, /* 36 */
+ { 6, TS, solaris_kill, "kill" }, /* 37 */
+ { 6, 0, solaris_fstatfs, "fstatfs" }, /* 38 */
+ { 6, 0, solaris_pgrpsys, "pgrpsys" }, /* 39 */
+ { 6, 0, solaris_xenix, "xenix" }, /* 40 */
+ { 6, 0, solaris_dup, "dup" }, /* 41 */
+ { 6, 0, solaris_pipe, "pipe" }, /* 42 */
+ { 6, 0, solaris_times, "times" }, /* 43 */
+ { 6, 0, solaris_profil, "profil" }, /* 44 */
+ { 6, 0, solaris_plock, "plock" }, /* 45 */
+ { 6, 0, solaris_setgid, "setgid" }, /* 46 */
+ { 6, 0, solaris_getgid, "getgid" }, /* 47 */
+ { 6, 0, solaris_sigcall, "sigcall" }, /* 48 */
+ { 6, TI, solaris_msgsys, "msgsys" }, /* 49 */
+ { 6, 0, solaris_syssun, "syssun" }, /* 50 */
+ { 6, TF, solaris_acct, "acct" }, /* 51 */
+ { 6, TI, solaris_shmsys, "shmsys" }, /* 52 */
+ { 6, TI, solaris_semsys, "semsys" }, /* 53 */
+ { 6, 0, solaris_ioctl, "ioctl" }, /* 54 */
+ { 6, 0, solaris_uadmin, "uadmin" }, /* 55 */
+ { 6, 0, solaris_sysmp, "sysmp" }, /* 56 */
+ { 6, 0, solaris_utssys, "utssys" }, /* 57 */
+ { 6, 0, solaris_fdsync, "fdsync" }, /* 58 */
+ { 6, TF|TP, solaris_execve, "execve" }, /* 59 */
+ { 6, 0, solaris_umask, "umask" }, /* 60 */
+ { 6, TF, solaris_chroot, "chroot" }, /* 61 */
+ { 6, 0, solaris_fcntl, "fcntl" }, /* 62 */
+ { 6, 0, solaris_ulimit, "ulimit" }, /* 63 */
+ { 6, 0, printargs, "SYS_64" }, /* 64 */
+ { 6, 0, printargs, "SYS_65" }, /* 65 */
+ { 6, 0, printargs, "SYS_66" }, /* 66 */
+ { 6, 0, printargs, "SYS_67" }, /* 67 */
+ { 6, 0, printargs, "SYS_68" }, /* 68 */
+ { 6, 0, printargs, "SYS_69" }, /* 69 */
+ { 6, 0, printargs, "SYS_70" }, /* 70 */
+ { 6, 0, printargs, "SYS_71" }, /* 71 */
+ { 6, 0, printargs, "SYS_72" }, /* 72 */
+ { 6, 0, printargs, "SYS_73" }, /* 73 */
+ { 6, 0, printargs, "SYS_74" }, /* 74 */
+ { 6, 0, printargs, "SYS_75" }, /* 75 */
+ { 6, 0, printargs, "SYS_76" }, /* 76 */
+ { 6, 0, printargs, "SYS_77" }, /* 77 */
+ { 6, 0, printargs, "SYS_78" }, /* 78 */
+ { 6, TF, solaris_rmdir, "rmdir" }, /* 79 */
+ { 6, TF, solaris_mkdir, "mkdir" }, /* 80 */
+ { 6, 0, solaris_getdents, "getdents" }, /* 81 */
+ { 6, 0, solaris_sginap, "sginap" }, /* 82 */
+ { 6, 0, solaris_sgikopt, "sgikopt" }, /* 83 */
+ { 6, 0, solaris_sysfs, "sysfs" }, /* 84 */
+ { 6, TN, sys_getmsg, "getmsg" }, /* 85 */
+ { 6, TN, sys_putmsg, "putmsg" }, /* 86 */
+ { 6, TN, solaris_poll, "poll" }, /* 87 */
+ { 6, TF, solaris_lstat, "lstat" }, /* 88 */
+ { 6, TF, solaris_symlink, "symlink" }, /* 89 */
+ { 6, TF, solaris_readlink, "readlink" }, /* 90 */
+ { 6, 0, solaris_setgroups, "setgroups" }, /* 91 */
+ { 6, 0, solaris_getgroups, "getgroups" }, /* 92 */
+ { 6, 0, solaris_fchmod, "fchmod" }, /* 93 */
+ { 6, 0, solaris_fchown, "fchown" }, /* 94 */
+ { 6, TS, solaris_sigprocmask, "sigprocmask" }, /* 95 */
+ { 6, TS, solaris_sigsuspend, "sigsuspend" }, /* 96 */
+ { 6, TS, solaris_sigaltstack, "sigaltstack" }, /* 97 */
+ { 6, TS, solaris_sigaction, "sigaction" }, /* 98 */
+ { 6, 0, solaris_spcall, "spcall" }, /* 99 */
+ { 6, 0, solaris_context, "context" }, /* 100 */
+ { 6, 0, solaris_evsys, "evsys" }, /* 101 */
+ { 6, 0, solaris_evtrapret, "evtrapret" }, /* 102 */
+ { 6, TF, solaris_statvfs, "statvfs" }, /* 103 */
+ { 6, 0, solaris_fstatvfs, "fstatvfs" }, /* 104 */
+ { 6, 0, printargs, "SYS_105" }, /* 105 */
+ { 6, 0, solaris_nfssys, "nfssys" }, /* 106 */
+ { 6, TP, solaris_waitid, "waitid" }, /* 107 */
+ { 6, 0, solaris_sigsendsys, "sigsendsys" }, /* 108 */
+ { 6, 0, solaris_hrtsys, "hrtsys" }, /* 109 */
+ { 6, 0, solaris_acancel, "acancel" }, /* 110 */
+ { 6, 0, solaris_async, "async" }, /* 111 */
+ { 6, 0, solaris_priocntlsys, "priocntlsys" }, /* 112 */
+ { 6, TF, solaris_pathconf, "pathconf" }, /* 113 */
+ { 6, 0, solaris_mincore, "mincore" }, /* 114 */
+ { 6, 0, solaris_mmap, "mmap" }, /* 115 */
+ { 6, 0, solaris_mprotect, "mprotect" }, /* 116 */
+ { 6, 0, solaris_munmap, "munmap" }, /* 117 */
+ { 6, 0, solaris_fpathconf, "fpathconf" }, /* 118 */
+ { 6, TP, solaris_vfork, "vfork" }, /* 119 */
+ { 6, 0, solaris_fchdir, "fchdir" }, /* 120 */
+ { 6, 0, solaris_readv, "readv" }, /* 121 */
+ { 6, 0, solaris_writev, "writev" }, /* 122 */
+ { 6, TF, solaris_xstat, "xstat" }, /* 123 */
+ { 6, TF, solaris_lxstat, "lxstat" }, /* 124 */
+ { 6, 0, solaris_fxstat, "fxstat" }, /* 125 */
+ { 6, TF, solaris_xmknod, "xmknod" }, /* 126 */
+ { 6, 0, solaris_clocal, "clocal" }, /* 127 */
+ { 6, 0, solaris_setrlimit, "setrlimit" }, /* 128 */
+ { 6, 0, solaris_getrlimit, "getrlimit" }, /* 129 */
+ { 6, TF, solaris_lchown, "lchown" }, /* 130 */
+ { 6, 0, solaris_memcntl, "memcntl" }, /* 131 */
+ { 6, TN, solaris_getpmsg, "getpmsg" }, /* 132 */
+ { 6, TN, solaris_putpmsg, "putpmsg" }, /* 133 */
+ { 6, TF, solaris_rename, "rename" }, /* 134 */
+ { 6, 0, solaris_uname, "uname" }, /* 135 */
+ { 6, 0, solaris_setegid, "setegid" }, /* 136 */
+ { 6, 0, solaris_sysconfig, "sysconfig" }, /* 137 */
+ { 6, 0, solaris_adjtime, "adjtime" }, /* 138 */
+ { 6, 0, solaris_sysinfo, "sysinfo" }, /* 139 */
+ { 6, 0, printargs, "SYS_140" }, /* 140 */
+ { 6, 0, solaris_seteuid, "seteuid" }, /* 141 */
+ { 6, 0, solaris_vtrace, "vtrace" }, /* 142 */
+ { 6, TP, solaris_fork1, "fork1" }, /* 143 */
+ { 6, TS, solaris_sigtimedwait, "sigtimedwait" }, /* 144 */
+ { 6, 0, solaris_lwp_info, "lwp_info" }, /* 145 */
+ { 6, 0, solaris_yield, "yield" }, /* 146 */
+ { 6, 0, solaris_lwp_sema_wait, "lwp_sema_wait" }, /* 147 */
+ { 6, 0, solaris_lwp_sema_post, "lwp_sema_post" }, /* 148 */
+ { 6, 0, printargs, "SYS_149" }, /* 149 */
+ { 6, 0, printargs, "SYS_150" }, /* 150 */
+ { 6, 0, printargs, "SYS_151" }, /* 151 */
+ { 6, 0, solaris_modctl, "modctl" }, /* 152 */
+ { 6, 0, solaris_fchroot, "fchroot" }, /* 153 */
+ { 6, TF, solaris_utimes, "utimes" }, /* 154 */
+ { 6, 0, solaris_vhangup, "vhangup" }, /* 155 */
+ { 6, 0, solaris_gettimeofday, "gettimeofday" }, /* 156 */
+ { 6, 0, solaris_getitimer, "getitimer" }, /* 157 */
+ { 6, 0, solaris_setitimer, "setitimer" }, /* 158 */
+ { 6, 0, solaris_lwp_create, "lwp_create" }, /* 159 */
+ { 6, 0, solaris_lwp_exit, "lwp_exit" }, /* 160 */
+ { 6, 0, solaris_lwp_suspend, "lwp_suspend" }, /* 161 */
+ { 6, 0, solaris_lwp_continue, "lwp_continue" }, /* 162 */
+ { 6, 0, solaris_lwp_kill, "lwp_kill" }, /* 163 */
+ { 6, 0, solaris_lwp_self, "lwp_self" }, /* 164 */
+ { 6, 0, solaris_lwp_setprivate, "lwp_setprivate"}, /* 165 */
+ { 6, 0, solaris_lwp_getprivate, "lwp_getprivate"}, /* 166 */
+ { 6, 0, solaris_lwp_wait, "lwp_wait" }, /* 167 */
+ { 6, 0, solaris_lwp_mutex_unlock,"lwp_mutex_unlock"}, /* 168 */
+ { 6, 0, solaris_lwp_mutex_lock, "lwp_mutex_lock"}, /* 169 */
+ { 6, 0, solaris_lwp_cond_wait, "lwp_cond_wait"}, /* 170 */
+ { 6, 0, solaris_lwp_cond_signal,"lwp_cond_signal"}, /* 171 */
+ { 6, 0, solaris_lwp_cond_broadcast,"lwp_cond_broadcast"}, /* 172 */
+ { 6, 0, solaris_pread, "pread" }, /* 173 */
+ { 6, 0, solaris_pwrite, "pwrite" }, /* 174 */
+ { 6, 0, solaris_llseek, "llseek" }, /* 175 */
+ { 6, 0, solaris_inst_sync, "inst_sync" }, /* 176 */
+ { 6, 0, printargs, "SYS_177" }, /* 177 */
+ { 6, 0, printargs, "SYS_178" }, /* 178 */
+ { 6, 0, printargs, "SYS_179" }, /* 179 */
+ { 6, 0, printargs, "SYS_180" }, /* 180 */
+ { 6, 0, printargs, "SYS_181" }, /* 181 */
+ { 6, 0, printargs, "SYS_182" }, /* 182 */
+ { 6, 0, printargs, "SYS_183" }, /* 183 */
+ { 6, 0, printargs, "SYS_184" }, /* 184 */
+ { 6, 0, printargs, "SYS_185" }, /* 185 */
+ { 6, 0, solaris_auditsys, "auditsys" }, /* 186 */
+ { 6, 0, solaris_processor_bind, "processor_bind"}, /* 187 */
+ { 6, 0, solaris_processor_info, "processor_info"}, /* 188 */
+ { 6, 0, solaris_p_online, "p_online" }, /* 189 */
+ { 6, 0, solaris_sigqueue, "sigqueue" }, /* 190 */
+ { 6, 0, solaris_clock_gettime, "clock_gettime" }, /* 191 */
+ { 6, 0, solaris_clock_settime, "clock_settime" }, /* 192 */
+ { 6, 0, solaris_clock_getres, "clock_getres" }, /* 193 */
+ { 6, 0, solaris_timer_create, "timer_create" }, /* 194 */
+ { 6, 0, solaris_timer_delete, "timer_delete" }, /* 195 */
+ { 6, 0, solaris_timer_settime, "timer_settime" }, /* 196 */
+ { 6, 0, solaris_timer_gettime, "timer_gettime" }, /* 197 */
+ { 6, 0, solaris_timer_getoverrun,"timer_getoverrun"}, /* 198 */
+ { 6, 0, solaris_nanosleep, "nanosleep" }, /* 199 */
+ { 6, 0, printargs, "SYS_200" }, /* 200 */
+ { 6, 0, printargs, "SYS_201" }, /* 201 */
+ { 6, 0, printargs, "SYS_202" }, /* 202 */
+ { 6, 0, printargs, "SYS_203" }, /* 203 */
+ { 6, 0, printargs, "SYS_204" }, /* 204 */
+ { 6, 0, printargs, "SYS_205" }, /* 205 */
+ { 6, 0, printargs, "SYS_206" }, /* 206 */
+ { 6, 0, printargs, "SYS_207" }, /* 207 */
+ { 6, 0, printargs, "SYS_208" }, /* 208 */
+ { 6, 0, printargs, "SYS_209" }, /* 209 */
+ { 6, 0, printargs, "SYS_210" }, /* 210 */
+ { 6, 0, printargs, "SYS_211" }, /* 211 */
+ { 6, 0, printargs, "SYS_212" }, /* 212 */
+ { 6, 0, printargs, "SYS_213" }, /* 213 */
+ { 6, 0, printargs, "SYS_214" }, /* 214 */
+ { 6, 0, printargs, "SYS_215" }, /* 215 */
+ { 6, 0, printargs, "SYS_216" }, /* 216 */
+ { 6, 0, printargs, "SYS_217" }, /* 217 */
+ { 6, 0, printargs, "SYS_218" }, /* 218 */
+ { 6, 0, printargs, "SYS_219" }, /* 219 */
+ { 6, 0, printargs, "SYS_220" }, /* 220 */
+ { 6, 0, printargs, "SYS_221" }, /* 221 */
+ { 6, 0, printargs, "SYS_222" }, /* 222 */
+ { 6, 0, printargs, "SYS_223" }, /* 223 */
+ { 6, 0, printargs, "SYS_224" }, /* 224 */
+ { 6, 0, printargs, "SYS_225" }, /* 225 */
+ { 6, 0, printargs, "SYS_226" }, /* 226 */
+ { 6, 0, printargs, "SYS_227" }, /* 227 */
+ { 6, 0, printargs, "SYS_228" }, /* 228 */
+ { 6, 0, printargs, "SYS_229" }, /* 229 */
+ { 6, 0, printargs, "SYS_230" }, /* 230 */
+ { 6, 0, printargs, "SYS_231" }, /* 231 */
+ { 6, 0, printargs, "SYS_232" }, /* 232 */
+ { 6, 0, printargs, "SYS_233" }, /* 233 */
+ { 6, 0, printargs, "SYS_234" }, /* 234 */
+ { 6, 0, printargs, "SYS_235" }, /* 235 */
+ { 6, 0, printargs, "SYS_236" }, /* 236 */
+ { 6, 0, printargs, "SYS_237" }, /* 237 */
+ { 6, 0, printargs, "SYS_238" }, /* 238 */
+ { 6, 0, printargs, "SYS_239" }, /* 239 */
+ { 6, 0, printargs, "SYS_240" }, /* 240 */
+ { 6, 0, printargs, "SYS_241" }, /* 241 */
+ { 6, 0, printargs, "SYS_242" }, /* 242 */
+ { 6, 0, printargs, "SYS_243" }, /* 243 */
+ { 6, 0, printargs, "SYS_244" }, /* 244 */
+ { 6, 0, printargs, "SYS_245" }, /* 245 */
+ { 6, 0, printargs, "SYS_246" }, /* 246 */
+ { 6, 0, printargs, "SYS_247" }, /* 247 */
+ { 6, 0, printargs, "SYS_248" }, /* 248 */
+ { 6, 0, printargs, "SYS_249" }, /* 249 */
+ { 6, 0, printargs, "SYS_250" }, /* 250 */
+ { 6, 0, printargs, "SYS_251" }, /* 251 */
+ { 6, 0, printargs, "SYS_252" }, /* 252 */
+ { 6, 0, printargs, "SYS_253" }, /* 253 */
+ { 6, 0, printargs, "SYS_254" }, /* 254 */
+ { 6, 0, printargs, "SYS_255" }, /* 255 */
+ { 6, 0, printargs, "SYS_256" }, /* 256 */
+ { 6, 0, printargs, "SYS_257" }, /* 257 */
+ { 6, 0, printargs, "SYS_258" }, /* 258 */
+ { 6, 0, printargs, "SYS_259" }, /* 259 */
+ { 6, 0, printargs, "SYS_260" }, /* 260 */
+ { 6, 0, printargs, "SYS_261" }, /* 261 */
+ { 6, 0, printargs, "SYS_262" }, /* 262 */
+ { 6, 0, printargs, "SYS_263" }, /* 263 */
+ { 6, 0, printargs, "SYS_264" }, /* 264 */
+ { 6, 0, printargs, "SYS_265" }, /* 265 */
+ { 6, 0, printargs, "SYS_266" }, /* 266 */
+ { 6, 0, printargs, "SYS_267" }, /* 267 */
+ { 6, 0, printargs, "SYS_268" }, /* 268 */
+ { 6, 0, printargs, "SYS_269" }, /* 269 */
+ { 6, 0, printargs, "SYS_270" }, /* 270 */
+ { 6, 0, printargs, "SYS_271" }, /* 271 */
+ { 6, 0, printargs, "SYS_272" }, /* 272 */
+ { 6, 0, printargs, "SYS_273" }, /* 273 */
+ { 6, 0, printargs, "SYS_274" }, /* 274 */
+ { 6, 0, printargs, "SYS_275" }, /* 275 */
+ { 6, 0, printargs, "SYS_276" }, /* 276 */
+ { 6, 0, printargs, "SYS_277" }, /* 277 */
+ { 6, 0, printargs, "SYS_278" }, /* 278 */
+ { 6, 0, printargs, "SYS_279" }, /* 279 */
+ { 6, 0, printargs, "SYS_280" }, /* 280 */
+ { 6, 0, printargs, "SYS_281" }, /* 281 */
+ { 6, 0, printargs, "SYS_282" }, /* 282 */
+ { 6, 0, printargs, "SYS_283" }, /* 283 */
+ { 6, 0, printargs, "SYS_284" }, /* 284 */
+ { 6, 0, printargs, "SYS_285" }, /* 285 */
+ { 6, 0, printargs, "SYS_286" }, /* 286 */
+ { 6, 0, printargs, "SYS_287" }, /* 287 */
+ { 6, 0, printargs, "SYS_288" }, /* 288 */
+ { 6, 0, printargs, "SYS_289" }, /* 289 */
+ { 6, 0, printargs, "SYS_290" }, /* 290 */
+ { 6, 0, printargs, "SYS_291" }, /* 291 */
+ { 6, 0, printargs, "SYS_292" }, /* 292 */
+ { 6, 0, printargs, "SYS_293" }, /* 293 */
+ { 6, 0, printargs, "SYS_294" }, /* 294 */
+ { 6, 0, printargs, "SYS_295" }, /* 295 */
+ { 6, 0, printargs, "SYS_296" }, /* 296 */
+ { 6, 0, printargs, "SYS_297" }, /* 297 */
+ { 6, 0, printargs, "SYS_298" }, /* 298 */
+ { 6, 0, printargs, "SYS_299" }, /* 299 */
+
+ { 6, 0, solaris_getpgrp, "getpgrp" }, /* 300 */
+ { 6, 0, solaris_setpgrp, "setpgrp" }, /* 301 */
+ { 6, 0, solaris_getsid, "getsid" }, /* 302 */
+ { 6, 0, solaris_setsid, "setsid" }, /* 303 */
+ { 6, 0, solaris_getpgid, "getpgid" }, /* 304 */
+ { 6, 0, solaris_setpgid, "setpgid" }, /* 305 */
+ { 6, 0, printargs, "SYS_306" }, /* 306 */
+ { 6, 0, printargs, "SYS_307" }, /* 307 */
+ { 6, 0, printargs, "SYS_308" }, /* 308 */
+ { 6, 0, printargs, "SYS_309" }, /* 309 */
+
+ { 6, TS, solaris_signal, "signal" }, /* 310 */
+ { 6, TS, solaris_sigset, "sigset" }, /* 311 */
+ { 6, TS, solaris_sighold, "sighold" }, /* 312 */
+ { 6, TS, solaris_sigrelse, "sigrelse" }, /* 313 */
+ { 6, TS, solaris_sigignore, "sigignore" }, /* 314 */
+ { 6, TS, solaris_sigpause, "sigpause" }, /* 315 */
+ { 6, 0, printargs, "SYS_316" }, /* 316 */
+ { 6, 0, printargs, "SYS_317" }, /* 317 */
+ { 6, 0, printargs, "SYS_318" }, /* 318 */
+ { 6, 0, printargs, "SYS_319" }, /* 319 */
+
+ { 6, TI, solaris_msgget, "msgget" }, /* 320 */
+ { 6, TI, solaris_msgctl, "msgctl" }, /* 321 */
+ { 6, TI, solaris_msgrcv, "msgrcv" }, /* 322 */
+ { 6, TI, solaris_msgsnd, "msgsnd" }, /* 323 */
+ { 6, 0, printargs, "SYS_324" }, /* 324 */
+ { 6, 0, printargs, "SYS_325" }, /* 325 */
+ { 6, 0, printargs, "SYS_326" }, /* 326 */
+ { 6, 0, printargs, "SYS_327" }, /* 327 */
+ { 6, 0, printargs, "SYS_328" }, /* 328 */
+ { 6, 0, printargs, "SYS_329" }, /* 329 */
+
+ { 6, TI, solaris_shmat, "shmat" }, /* 330 */
+ { 6, TI, solaris_shmctl, "shmctl" }, /* 331 */
+ { 6, TI, solaris_shmdt, "shmdt" }, /* 332 */
+ { 6, TI, solaris_shmget, "shmget" }, /* 333 */
+ { 6, 0, printargs, "SYS_334" }, /* 334 */
+ { 6, 0, printargs, "SYS_335" }, /* 335 */
+ { 6, 0, printargs, "SYS_336" }, /* 336 */
+ { 6, 0, printargs, "SYS_337" }, /* 337 */
+ { 6, 0, printargs, "SYS_338" }, /* 338 */
+ { 6, 0, printargs, "SYS_339" }, /* 339 */
+
+ { 6, TI, solaris_semctl, "semctl" }, /* 340 */
+ { 6, TI, solaris_semget, "semget" }, /* 341 */
+ { 6, TI, solaris_semop, "semop" }, /* 342 */
+ { 6, 0, printargs, "SYS_343" }, /* 343 */
+ { 6, 0, printargs, "SYS_344" }, /* 344 */
+ { 6, 0, printargs, "SYS_345" }, /* 345 */
+ { 6, 0, printargs, "SYS_346" }, /* 346 */
+ { 6, 0, printargs, "SYS_347" }, /* 347 */
+ { 6, 0, printargs, "SYS_348" }, /* 348 */
+ { 6, 0, printargs, "SYS_349" }, /* 349 */
+
+ { 6, 0, solaris_olduname, "olduname" }, /* 350 */
+ { 6, 0, printargs, "utssys1" }, /* 351 */
+ { 6, 0, solaris_ustat, "ustat" }, /* 352 */
+ { 6, 0, solaris_fusers, "fusers" }, /* 353 */
+ { 6, 0, printargs, "SYS_354" }, /* 354 */
+ { 6, 0, printargs, "SYS_355" }, /* 355 */
+ { 6, 0, printargs, "SYS_356" }, /* 356 */
+ { 6, 0, printargs, "SYS_357" }, /* 357 */
+ { 6, 0, printargs, "SYS_358" }, /* 358 */
+ { 6, 0, printargs, "SYS_359" }, /* 359 */
+
+ { 6, 0, printargs, "sysfs0" }, /* 360 */
+ { 6, 0, solaris_sysfs1, "sysfs1" }, /* 361 */
+ { 6, 0, solaris_sysfs2, "sysfs2" }, /* 362 */
+ { 6, 0, solaris_sysfs3, "sysfs3" }, /* 363 */
+ { 6, 0, printargs, "SYS_364" }, /* 364 */
+ { 6, 0, printargs, "SYS_365" }, /* 365 */
+ { 6, 0, printargs, "SYS_366" }, /* 366 */
+ { 6, 0, printargs, "SYS_367" }, /* 367 */
+ { 6, 0, printargs, "SYS_368" }, /* 368 */
+ { 6, 0, printargs, "SYS_369" }, /* 369 */
+
+ { 6, 0, printargs, "spcall0" }, /* 370 */
+ { 6, TS, solaris_sigpending, "sigpending" }, /* 371 */
+ { 6, TS, solaris_sigfillset, "sigfillset" }, /* 372 */
+ { 6, 0, printargs, "SYS_373" }, /* 373 */
+ { 6, 0, printargs, "SYS_374" }, /* 374 */
+ { 6, 0, printargs, "SYS_375" }, /* 375 */
+ { 6, 0, printargs, "SYS_376" }, /* 376 */
+ { 6, 0, printargs, "SYS_377" }, /* 377 */
+ { 6, 0, printargs, "SYS_378" }, /* 378 */
+ { 6, 0, printargs, "SYS_379" }, /* 379 */
+
+ { 6, 0, solaris_getcontext, "getcontext" }, /* 380 */
+ { 6, 0, solaris_setcontext, "setcontext" }, /* 381 */
+ { 6, 0, printargs, "SYS_382" }, /* 382 */
+ { 6, 0, printargs, "SYS_383" }, /* 383 */
+ { 6, 0, printargs, "SYS_384" }, /* 384 */
+ { 6, 0, printargs, "SYS_385" }, /* 385 */
+ { 6, 0, printargs, "SYS_386" }, /* 386 */
+ { 6, 0, printargs, "SYS_387" }, /* 387 */
+ { 6, 0, printargs, "SYS_388" }, /* 388 */
+ { 6, 0, printargs, "SYS_389" }, /* 389 */
+
+ { 6, 0, printargs, "SYS_390" }, /* 390 */
+ { 6, 0, printargs, "SYS_391" }, /* 391 */
+ { 6, 0, printargs, "SYS_392" }, /* 392 */
+ { 6, 0, printargs, "SYS_393" }, /* 393 */
+ { 6, 0, printargs, "SYS_394" }, /* 394 */
+ { 6, 0, printargs, "SYS_395" }, /* 395 */
+ { 6, 0, printargs, "SYS_396" }, /* 396 */
+ { 6, 0, printargs, "SYS_397" }, /* 397 */
+ { 6, 0, printargs, "SYS_398" }, /* 398 */
+ { 6, 0, printargs, "SYS_399" }, /* 399 */
diff --git a/linux/syscall.h b/linux/syscall.h
new file mode 100644
index 000000000..ed4c620c3
--- /dev/null
+++ b/linux/syscall.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "dummy.h"
+
+/* primary syscalls */
+
+int sys_setup(), sys_exit(), sys_fork(), sys_read(), sys_write();
+int sys_open(), sys_close(), sys_waitpid(), sys_creat(), sys_link();
+int sys_unlink(), sys_execve(), sys_chdir(), sys_time(), sys_mknod();
+int sys_chmod(), sys_chown(), sys_break(), sys_oldstat();
+int sys_lseek(), sys_getpid(), sys_mount(), sys_umount();
+int sys_setuid(), sys_getuid(), sys_stime(), sys_ptrace();
+int sys_alarm(), sys_oldfstat(), sys_pause(), sys_utime();
+int sys_stty(), sys_gtty(), sys_access(), sys_nice(), sys_ftime();
+int sys_sync(), sys_kill(), sys_rename(), sys_mkdir(), sys_rmdir();
+int sys_dup(), sys_pipe(), sys_times(), sys_prof(), sys_brk();
+int sys_setgid(), sys_getgid(), sys_signal(), sys_geteuid();
+int sys_getegid(), sys_acct(), sys_phys(), sys_lock(), sys_ioctl();
+int sys_fcntl(), sys_mpx(), sys_setpgid(), sys_ulimit();
+int sys_olduname(), sys_umask(), sys_chroot(), sys_ustat();
+int sys_dup2(), sys_getppid(), sys_getpgrp(), sys_setsid();
+int sys_sigaction(), sys_siggetmask(), sys_sigsetmask();
+int sys_setreuid(), sys_setregid(), sys_sigsuspend();
+int sys_sigpending(), sys_sethostname(), sys_setrlimit();
+int sys_getrlimit(), sys_getrusage(), sys_gettimeofday();
+int sys_settimeofday(), sys_getgroups(), sys_setgroups();
+int sys_oldselect(), sys_symlink(), sys_oldlstat(), sys_readlink();
+int sys_uselib(), sys_swapon(), sys_reboot(), sys_readdir();
+int sys_mmap(), sys_munmap(), sys_truncate(), sys_ftruncate();
+int sys_fchmod(), sys_fchown(), sys_getpriority();
+int sys_setpriority(), sys_profil(), sys_statfs(), sys_fstatfs();
+int sys_ioperm(), sys_socketcall(), sys_syslog(), sys_setitimer();
+int sys_getitimer(), sys_stat(), sys_lstat(), sys_fstat();
+int sys_uname(), sys_iopl(), sys_vhangup(), sys_idle(), sys_vm86();
+int sys_wait4(), sys_swapoff(), sys_ipc(), sys_sigreturn();
+int sys_fsync(), sys_clone(), sys_setdomainname(), sys_sysinfo();
+int sys_modify_ldt(), sys_adjtimex(), sys_mprotect();
+int sys_sigprocmask(), sys_create_module(), sys_init_module();
+int sys_delete_module(), sys_get_kernel_syms(), sys_quotactl();
+int sys_getpgid(), sys_fchdir(), sys_bdflush();
+int sys_sysfs(), sys_personality(), sys_afs_syscall();
+int sys_setfsuid(), sys_setfsgid(), sys_llseek();
+int sys_getdents(), sys_flock(), sys_msync();
+int sys_readv(), sys_writev(), sys_select();
+int sys_getsid(), sys_fdatasync(), sys_sysctl();
+int sys_mlock(), sys_munlock(), sys_mlockall(), sys_munlockall();
+int sys_sched_setparam(), sys_sched_getparam();
+int sys_sched_setscheduler(), sys_sched_getscheduler(), sys_sched_yield();
+int sys_sched_get_priority_max(), sys_sched_get_priority_min();
+int sys_sched_rr_get_interval(), sys_nanosleep(), sys_mremap();
+int sys_sendmsg(), sys_recvmsg(), sys_setresuid(), sys_setresgid();
+int sys_getresuid(), sys_getresgid(), sys_pread(), sys_pwrite(), sys_getcwd();
+int sys_sigaltstack(), sys_rt_sigprocmask(), sys_rt_sigaction();
+int sys_rt_sigpending(), sys_rt_sigsuspend(), sys_rt_sigqueueinfo();
+int sys_rt_sigtimedwait(), sys_prctl(), sys_poll(), sys_vfork();
+
+
+/* sys_socketcall subcalls */
+
+int sys_socket(), sys_bind(), sys_connect(), sys_listen();
+int sys_accept(), sys_getsockname(), sys_getpeername(), sys_socketpair();
+int sys_send(), sys_recv(), sys_sendto(), sys_recvfrom();
+int sys_shutdown(), sys_setsockopt(), sys_getsockopt();
+
+/* new ones */
+int sys_query_module();
+int sys_poll();
+
+#ifndef ALPHA
+#ifdef POWERPC
+# define SYS_socket_subcall 256
+#else
+# define SYS_socket_subcall 230
+#endif
+#define SYS_socket (SYS_socket_subcall + 1)
+#define SYS_bind (SYS_socket_subcall + 2)
+#define SYS_connect (SYS_socket_subcall + 3)
+#define SYS_listen (SYS_socket_subcall + 4)
+#define SYS_accept (SYS_socket_subcall + 5)
+#define SYS_getsockname (SYS_socket_subcall + 6)
+#define SYS_getpeername (SYS_socket_subcall + 7)
+#define SYS_socketpair (SYS_socket_subcall + 8)
+#define SYS_send (SYS_socket_subcall + 9)
+#define SYS_recv (SYS_socket_subcall + 10)
+#define SYS_sendto (SYS_socket_subcall + 11)
+#define SYS_recvfrom (SYS_socket_subcall + 12)
+#define SYS_shutdown (SYS_socket_subcall + 13)
+#define SYS_setsockopt (SYS_socket_subcall + 14)
+#define SYS_getsockopt (SYS_socket_subcall + 15)
+
+#define SYS_socket_nsubcalls 16
+#endif /* !ALPHA */
+
+/* sys_ipc subcalls */
+
+int sys_semget(), sys_semctl();
+int sys_msgsnd(), sys_msgrcv(), sys_msgget(), sys_msgctl();
+int sys_shmat(), sys_shmdt(), sys_shmget(), sys_shmctl();
+
+#ifndef ALPHA
+#ifdef POWERPC
+# define SYS_ipc_subcall ((SYS_socket_subcall)+(SYS_socket_nsubcalls))
+#else
+# define SYS_ipc_subcall 200
+#endif
+#define SYS_semop (SYS_ipc_subcall + 1)
+#define SYS_semget (SYS_ipc_subcall + 2)
+#define SYS_semctl (SYS_ipc_subcall + 3)
+#define SYS_msgsnd (SYS_ipc_subcall + 11)
+#define SYS_msgrcv (SYS_ipc_subcall + 12)
+#define SYS_msgget (SYS_ipc_subcall + 13)
+#define SYS_msgctl (SYS_ipc_subcall + 14)
+#define SYS_shmat (SYS_ipc_subcall + 21)
+#define SYS_shmdt (SYS_ipc_subcall + 22)
+#define SYS_shmget (SYS_ipc_subcall + 23)
+#define SYS_shmctl (SYS_ipc_subcall + 24)
+
+#define SYS_ipc_nsubcalls 25
+#endif /* ALPHA */
+
+#ifdef ALPHA
+int osf_statfs(), osf_fstatfs(), sys_getpagesize(), sys_madvise();
+#endif
+
+int sys_setpgrp(), sys_gethostname(), sys_getdtablesize(), sys_utimes();
+int sys_capget(), sys_capset();
+
diff --git a/linux/syscallent.h b/linux/syscallent.h
new file mode 100644
index 000000000..da783026a
--- /dev/null
+++ b/linux/syscallent.h
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+ { 0, 0, sys_setup, "setup" }, /* 0 */
+ { 1, TP, sys_exit, "_exit" }, /* 1 */
+ { 0, TP, sys_fork, "fork" }, /* 2 */
+ { 3, 0, sys_read, "read" }, /* 3 */
+ { 3, 0, sys_write, "write" }, /* 4 */
+ { 3, TF, sys_open, "open" }, /* 5 */
+ { 1, 0, sys_close, "close" }, /* 6 */
+ { 3, TP, sys_waitpid, "waitpid" }, /* 7 */
+ { 2, TF, sys_creat, "creat" }, /* 8 */
+ { 2, TF, sys_link, "link" }, /* 9 */
+ { 1, TF, sys_unlink, "unlink" }, /* 10 */
+ { 3, TF|TP, sys_execve, "execve" }, /* 11 */
+ { 1, TF, sys_chdir, "chdir" }, /* 12 */
+ { 1, 0, sys_time, "time" }, /* 13 */
+ { 3, TF, sys_mknod, "mknod" }, /* 14 */
+ { 2, TF, sys_chmod, "chmod" }, /* 15 */
+ { 3, TF, sys_chown, "lchown" }, /* 16 */
+ { 0, 0, sys_break, "break" }, /* 17 */
+ { 2, TF, sys_oldstat, "oldstat" }, /* 18 */
+ { 3, 0, sys_lseek, "lseek" }, /* 19 */
+ { 0, 0, sys_getpid, "getpid" }, /* 20 */
+ { 5, TF, sys_mount, "mount" }, /* 21 */
+ { 1, TF, sys_umount, "umount" }, /* 22 */
+ { 1, 0, sys_setuid, "setuid" }, /* 23 */
+ { 0, 0, sys_getuid, "getuid" }, /* 24 */
+ { 1, 0, sys_stime, "stime" }, /* 25 */
+ { 4, 0, sys_ptrace, "ptrace" }, /* 26 */
+ { 1, 0, sys_alarm, "alarm" }, /* 27 */
+ { 2, 0, sys_oldfstat, "oldfstat" }, /* 28 */
+ { 0, TS, sys_pause, "pause" }, /* 29 */
+ { 2, TF, sys_utime, "utime" }, /* 30 */
+ { 2, 0, sys_stty, "stty" }, /* 31 */
+ { 2, 0, sys_gtty, "gtty" }, /* 32 */
+ { 2, TF, sys_access, "access" }, /* 33 */
+ { 1, 0, sys_nice, "nice" }, /* 34 */
+ { 0, 0, sys_ftime, "ftime" }, /* 35 */
+ { 0, 0, sys_sync, "sync" }, /* 36 */
+ { 2, TS, sys_kill, "kill" }, /* 37 */
+ { 2, TF, sys_rename, "rename" }, /* 38 */
+ { 2, TF, sys_mkdir, "mkdir" }, /* 39 */
+ { 1, TF, sys_rmdir, "rmdir" }, /* 40 */
+ { 1, 0, sys_dup, "dup" }, /* 41 */
+ { 1, 0, sys_pipe, "pipe" }, /* 42 */
+ { 1, 0, sys_times, "times" }, /* 43 */
+ { 0, 0, sys_prof, "prof" }, /* 44 */
+ { 1, 0, sys_brk, "brk" }, /* 45 */
+ { 1, 0, sys_setgid, "setgid" }, /* 46 */
+ { 0, 0, sys_getgid, "getgid" }, /* 47 */
+ { 3, TS, sys_signal, "signal" }, /* 48 */
+ { 0, 0, sys_geteuid, "geteuid" }, /* 49 */
+ { 0, 0, sys_getegid, "getegid" }, /* 50 */
+ { 1, TF, sys_acct, "acct" }, /* 51 */
+ { 0, 0, sys_phys, "phys" }, /* 52 */
+ { 0, 0, sys_lock, "lock" }, /* 53 */
+ { 3, 0, sys_ioctl, "ioctl" }, /* 54 */
+ { 3, 0, sys_fcntl, "fcntl" }, /* 55 */
+ { 0, 0, sys_mpx, "mpx" }, /* 56 */
+ { 2, 0, sys_setpgid, "setpgid" }, /* 57 */
+ { 2, 0, sys_ulimit, "ulimit" }, /* 58 */
+ { 1, 0, sys_oldolduname, "oldolduname" }, /* 59 */
+ { 1, 0, sys_umask, "umask" }, /* 60 */
+ { 1, TF, sys_chroot, "chroot" }, /* 61 */
+ { 2, 0, sys_ustat, "ustat" }, /* 62 */
+ { 2, 0, sys_dup2, "dup2" }, /* 63 */
+ { 0, 0, sys_getppid, "getppid" }, /* 64 */
+ { 0, 0, sys_getpgrp, "getpgrp" }, /* 65 */
+ { 0, 0, sys_setsid, "setsid" }, /* 66 */
+ { 3, TS, sys_sigaction, "sigaction" }, /* 67 */
+ { 0, TS, sys_siggetmask, "siggetmask" }, /* 68 */
+ { 1, TS, sys_sigsetmask, "sigsetmask" }, /* 69 */
+ { 2, 0, sys_setreuid, "setreuid" }, /* 70 */
+ { 2, 0, sys_setregid, "setregid" }, /* 71 */
+ { 3, TS, sys_sigsuspend, "sigsuspend" }, /* 72 */
+ { 1, TS, sys_sigpending, "sigpending" }, /* 73 */
+ { 2, 0, sys_sethostname, "sethostname" }, /* 74 */
+ { 2, 0, sys_setrlimit, "setrlimit" }, /* 75 */
+ { 2, 0, sys_getrlimit, "getrlimit" }, /* 76 */
+ { 2, 0, sys_getrusage, "getrusage" }, /* 77 */
+ { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 78 */
+ { 2, 0, sys_settimeofday, "settimeofday" }, /* 79 */
+ { 2, 0, sys_getgroups, "getgroups" }, /* 80 */
+ { 2, 0, sys_setgroups, "setgroups" }, /* 81 */
+ { 1, 0, sys_oldselect, "oldselect" }, /* 82 */
+ { 2, TF, sys_symlink, "symlink" }, /* 83 */
+ { 2, TF, sys_oldlstat, "oldlstat" }, /* 84 */
+ { 3, TF, sys_readlink, "readlink" }, /* 85 */
+ { 1, TF, sys_uselib, "uselib" }, /* 86 */
+ { 1, TF, sys_swapon, "swapon" }, /* 87 */
+ { 3, 0, sys_reboot, "reboot" }, /* 88 */
+ { 3, 0, sys_readdir, "readdir" }, /* 89 */
+ { 6, 0, sys_mmap, "mmap" }, /* 90 */
+ { 2, 0, sys_munmap, "munmap" }, /* 91 */
+ { 2, TF, sys_truncate, "truncate" }, /* 92 */
+ { 2, 0, sys_ftruncate, "ftruncate" }, /* 93 */
+ { 2, 0, sys_fchmod, "fchmod" }, /* 94 */
+ { 3, 0, sys_fchown, "fchown" }, /* 95 */
+ { 2, 0, sys_getpriority, "getpriority" }, /* 96 */
+ { 3, 0, sys_setpriority, "setpriority" }, /* 97 */
+ { 4, 0, sys_profil, "profil" }, /* 98 */
+ { 2, TF, sys_statfs, "statfs" }, /* 99 */
+ { 2, 0, sys_fstatfs, "fstatfs" }, /* 100 */
+ { 3, 0, sys_ioperm, "ioperm" }, /* 101 */
+ { 2, 0, sys_socketcall, "socketcall" }, /* 102 */
+ { 3, 0, sys_syslog, "syslog" }, /* 103 */
+ { 3, 0, sys_setitimer, "setitimer" }, /* 104 */
+ { 2, 0, sys_getitimer, "getitimer" }, /* 105 */
+ { 2, TF, sys_stat, "stat" }, /* 106 */
+ { 2, TF, sys_lstat, "lstat" }, /* 107 */
+ { 2, 0, sys_fstat, "fstat" }, /* 108 */
+ { 1, 0, sys_olduname, "olduname" }, /* 109 */
+ { 1, 0, sys_iopl, "iopl" }, /* 110 */
+ { 0, 0, sys_vhangup, "vhangup" }, /* 111 */
+ { 0, 0, sys_idle, "idle" }, /* 112 */
+ { 1, 0, sys_vm86old, "vm86old" }, /* 113 */
+ { 4, TP, sys_wait4, "wait4" }, /* 114 */
+ { 1, 0, sys_swapoff, "swapoff" }, /* 115 */
+ { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */
+ { 5, 0, sys_ipc, "ipc" }, /* 117 */
+ { 1, 0, sys_fsync, "fsync" }, /* 118 */
+ { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */
+ { 2, TP, sys_clone, "clone" }, /* 120 */
+ { 2, 0, sys_setdomainname, "setdomainname" }, /* 121 */
+ { 1, 0, sys_uname, "uname" }, /* 122 */
+ { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 123 */
+ { 1, 0, sys_adjtimex, "adjtimex" }, /* 124 */
+ { 3, 0, sys_mprotect, "mprotect" }, /* 125 */
+ { 3, TS, sys_sigprocmask, "sigprocmask" }, /* 126 */
+ { 2, 0, sys_create_module, "create_module" }, /* 127 */
+ { 4, 0, sys_init_module, "init_module" }, /* 128 */
+ { 1, 0, sys_delete_module, "delete_module" }, /* 129 */
+ { 1, 0, sys_get_kernel_syms, "get_kernel_syms"}, /* 130 */
+ { 4, 0, sys_quotactl, "quotactl" }, /* 131 */
+ { 1, 0, sys_getpgid, "getpgid" }, /* 132 */
+ { 1, 0, sys_fchdir, "fchdir" }, /* 133 */
+ { 0, 0, sys_bdflush, "bdflush" }, /* 134 */
+ { 3, 0, sys_sysfs, "sysfs" }, /* 135 */
+ { 1, 0, sys_personality, "personality" }, /* 136 */
+ { 5, 0, sys_afs_syscall, "afs_syscall" }, /* 137 */
+ { 1, 0, sys_setfsuid, "setfsuid" }, /* 138 */
+ { 1, 0, sys_setfsgid, "setfsgid" }, /* 139 */
+ { 5, 0, sys_llseek, "_llseek" }, /* 140 */
+ { 3, 0, sys_getdents, "getdents" }, /* 141 */
+ { 5, 0, sys_select, "select" }, /* 142 */
+ { 2, 0, sys_flock, "flock" }, /* 143 */
+ { 3, 0, sys_msync, "msync" }, /* 144 */
+ { 5, 0, sys_readv, "readv" }, /* 145 */
+ { 5, 0, sys_writev, "writev" }, /* 146 */
+ { 5, 0, sys_getsid, "getsid" }, /* 147 */
+ { 5, 0, sys_fdatasync, "fdatasync" }, /* 148 */
+ { 5, 0, sys_sysctl, "_sysctl" }, /* 149 */
+ { 5, 0, sys_mlock, "mlock" }, /* 150 */
+ { 5, 0, sys_munlock, "munlock" }, /* 151 */
+ { 5, 0, sys_mlockall, "mlockall" }, /* 152 */
+ { 5, 0, sys_munlockall, "munlockall" }, /* 153 */
+ { 5, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */
+ { 5, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */
+ { 5, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */
+ { 5, 0, sys_sched_getscheduler, "sched_getscheduler"}, /* 157 */
+ { 5, 0, sys_sched_yield, "sched_yield"}, /* 158 */
+ { 5, 0, sys_sched_get_priority_max,"sched_get_priority_max"}, /* 159 */
+ { 5, 0, sys_sched_get_priority_min,"sched_get_priority_min"}, /* 160 */
+ { 5, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 161 */
+ { 5, 0, sys_nanosleep, "nanosleep" }, /* 162 */
+ { 5, 0, sys_mremap, "mremap" }, /* 163 */
+ { 3, 0, sys_setresuid, "setresuid" }, /* 164 */
+ { 3, 0, sys_getresuid, "getresuid" }, /* 165 */
+ { 5, 0, printargs, "vm86" }, /* 166 */
+ { 5, 0, sys_query_module, "query_module" }, /* 167 */
+ { 3, 0, sys_poll, "poll" }, /* 168 */
+ { 5, 0, printargs, "nfsservctl" }, /* 169 */
+ { 3, 0, sys_setresgid, "setresgid" }, /* 170 */
+ { 3, 0, sys_getresgid, "getresgid" }, /* 171 */
+ { 5, 0, printargs, "prctl" }, /* 172 */
+ { 1, TS, printargs, "rt_sigreturn" }, /* 173 */
+ { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
+ { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
+ { 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 176 */
+ { 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 177 */
+ { 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 178 */
+ { 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 179 */
+
+ { 5, TF, sys_pread, "pread" }, /* 180 */
+ { 5, TF, sys_pwrite, "pwrite" }, /* 181 */
+ { 3, TF, sys_chown, "chown" }, /* 182 */
+ { 2, 0, sys_getcwd, "getcwd" }, /* 183 */
+ { 5, 0, printargs, "capget" }, /* 184 */
+ { 5, 0, printargs, "capset" }, /* 185 */
+ { 5, TS, sys_sigaltstack, "sigaltstack" }, /* 186 */
+ { 5, TF, printargs, "sendfile" }, /* 187 */
+ { 5, 0, printargs, "SYS_188" }, /* 188 */
+ { 5, 0, printargs, "SYS_189" }, /* 189 */
+ { 0, TP, sys_vfork, "vfork" }, /* 190 */
+ { 5, 0, printargs, "SYS_191" }, /* 191 */
+ { 5, 0, printargs, "SYS_192" }, /* 192 */
+ { 5, 0, printargs, "SYS_193" }, /* 193 */
+ { 5, 0, printargs, "SYS_194" }, /* 194 */
+ { 5, 0, printargs, "SYS_195" }, /* 195 */
+ { 5, 0, printargs, "SYS_196" }, /* 196 */
+ { 5, 0, printargs, "SYS_197" }, /* 197 */
+ { 5, 0, printargs, "SYS_198" }, /* 198 */
+ { 5, 0, printargs, "SYS_199" }, /* 199 */
+
+ { 4, 0, printargs, "ipc_subcall" }, /* 200 */
+ { 4, TI, printargs, "semop" }, /* 201 */
+ { 4, TI, sys_semget, "semget" }, /* 202 */
+ { 4, TI, sys_semctl, "semctl" }, /* 203 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 204 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 205 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 206 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 207 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 208 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 209 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 210 */
+ { 4, TI, sys_msgsnd, "msgsnd" }, /* 211 */
+ { 4, TI, sys_msgrcv, "msgrcv" }, /* 212 */
+ { 4, TI, sys_msgget, "msgget" }, /* 213 */
+ { 4, TI, sys_msgctl, "msgctl" }, /* 214 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 215 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 216 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 217 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 218 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 219 */
+ { 4, 0, printargs, "ipc_subcall" }, /* 220 */
+ { 4, TI, sys_shmat, "shmat" }, /* 221 */
+ { 4, TI, sys_shmdt, "shmdt" }, /* 222 */
+ { 4, TI, sys_shmget, "shmget" }, /* 223 */
+ { 4, TI, sys_shmctl, "shmctl" }, /* 224 */
+ { 5, 0, printargs, "SYS_225" }, /* 225 */
+ { 5, 0, printargs, "SYS_226" }, /* 226 */
+ { 5, 0, printargs, "SYS_227" }, /* 227 */
+ { 5, 0, printargs, "SYS_228" }, /* 228 */
+ { 5, 0, printargs, "SYS_229" }, /* 229 */
+
+ { 8, 0, printargs, "socket_subcall"}, /* 230 */
+ { 3, TN, sys_socket, "socket" }, /* 231 */
+ { 3, TN, sys_bind, "bind" }, /* 232 */
+ { 3, TN, sys_connect, "connect" }, /* 233 */
+ { 2, TN, sys_listen, "listen" }, /* 234 */
+ { 3, TN, sys_accept, "accept" }, /* 235 */
+ { 3, TN, sys_getsockname, "getsockname" }, /* 236 */
+ { 3, TN, sys_getpeername, "getpeername" }, /* 237 */
+ { 4, TN, sys_socketpair, "socketpair" }, /* 238 */
+ { 4, TN, sys_send, "send" }, /* 239 */
+ { 4, TN, sys_recv, "recv" }, /* 240 */
+ { 6, TN, sys_sendto, "sendto" }, /* 241 */
+ { 6, TN, sys_recvfrom, "recvfrom" }, /* 242 */
+ { 2, TN, sys_shutdown, "shutdown" }, /* 243 */
+ { 5, TN, sys_setsockopt, "setsockopt" }, /* 244 */
+ { 5, TN, sys_getsockopt, "getsockopt" }, /* 245 */
+ { 5, TN, sys_sendmsg, "sendmsg" }, /* 246 */
+ { 5, TN, sys_recvmsg, "recvmsg" }, /* 247 */
+ { 5, 0, printargs, "SYS_248" }, /* 248 */
+ { 5, 0, printargs, "SYS_249" }, /* 249 */
+
diff --git a/mem.c b/mem.c
new file mode 100644
index 000000000..7ba410921
--- /dev/null
+++ b/mem.c
@@ -0,0 +1,338 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#ifdef LINUXSPARC
+#include <linux/mman.h>
+#else
+#include <sys/mman.h>
+#endif
+#if defined(LINUX) && defined(__i386__)
+#include <asm/ldt.h>
+#endif
+
+int
+sys_brk(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%#lx", tcp->u_arg[0]);
+ }
+#ifdef linux
+ return RVAL_HEX;
+#else
+ return 0;
+#endif
+}
+
+int
+sys_sbrk(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+ }
+ return RVAL_HEX;
+}
+
+static struct xlat mmap_prot[] = {
+ { PROT_NONE, "PROT_NONE", },
+ { PROT_READ, "PROT_READ" },
+ { PROT_WRITE, "PROT_WRITE" },
+ { PROT_EXEC, "PROT_EXEC" },
+ { 0, NULL },
+};
+
+static struct xlat mmap_flags[] = {
+ { MAP_SHARED, "MAP_SHARED" },
+ { MAP_PRIVATE, "MAP_PRIVATE" },
+ { MAP_FIXED, "MAP_FIXED" },
+#ifdef MAP_ANONYMOUS
+ { MAP_ANONYMOUS,"MAP_ANONYMOUS" },
+#endif
+#ifdef MAP_RENAME
+ { MAP_RENAME, "MAP_RENAME" },
+#endif
+#ifdef MAP_NORESERVE
+ { MAP_NORESERVE,"MAP_NORESERVE" },
+#endif
+#ifdef _MAP_NEW
+ { _MAP_NEW, "_MAP_NEW" },
+#endif
+#ifdef MAP_GROWSDOWN
+ { MAP_GROWSDOWN,"MAP_GROWSDOWN" },
+#endif
+#ifdef MAP_DENYWRITE
+ { MAP_DENYWRITE,"MAP_DENYWRITE" },
+#endif
+#ifdef MAP_EXECUTABLE
+ { MAP_EXECUTABLE,"MAP_EXECUTABLE"},
+#endif
+#ifdef MAP_FILE
+ { MAP_FILE,"MAP_FILE"},
+#endif
+#ifdef MAP_LOCKED
+ { MAP_LOCKED,"MAP_LOCKED"},
+#endif
+ { 0, NULL },
+};
+
+int
+sys_mmap(tcp)
+struct tcb *tcp;
+{
+#ifdef LINUX
+#if defined(ALPHA) || defined(sparc)
+ long *u_arg = tcp->u_arg;
+#else /* !ALPHA */
+ long u_arg[6];
+#endif /* !ALPHA */
+#else /* !LINUX */
+ long *u_arg = tcp->u_arg;
+#endif /* !LINUX */
+
+ if (entering(tcp)) {
+#ifdef LINUX
+#if !defined(ALPHA) && !defined(__sparc__)
+ if (umoven(tcp, tcp->u_arg[0], sizeof u_arg,
+ (char *) u_arg) == -1)
+ return 0;
+#endif /* ALPHA/sparc */
+#endif /* LINUX */
+
+ /* addr */
+ tprintf("%#lx, ", u_arg[0]);
+ /* len */
+ tprintf("%lu, ", u_arg[1]);
+ /* prot */
+ printflags(mmap_prot, u_arg[2]);
+ tprintf(", ");
+ /* flags */
+ printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???");
+ addflags(mmap_flags, u_arg[3] & ~MAP_TYPE);
+ /* fd */
+ tprintf(", %ld, ", u_arg[4]);
+ /* offset */
+ tprintf("%#lx", u_arg[5]);
+ }
+ return RVAL_HEX;
+}
+
+int
+sys_munmap(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%#lx, %lu",
+ tcp->u_arg[0], tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_mprotect(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%#lx, %lu, ",
+ tcp->u_arg[0], tcp->u_arg[1]);
+ if (!printflags(mmap_prot, tcp->u_arg[2]))
+ tprintf("PROT_???");
+ }
+ return 0;
+}
+
+#ifdef MS_ASYNC
+
+static struct xlat mctl_sync[] = {
+ { MS_ASYNC, "MS_ASYNC" },
+ { MS_INVALIDATE,"MS_INVALIDATE" },
+#ifdef MS_SYNC
+ { MS_SYNC, "MS_SYNC" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_msync(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ /* addr */
+ tprintf("%#lx", tcp->u_arg[0]);
+ /* len */
+ tprintf(", %lu, ", tcp->u_arg[1]);
+ /* flags */
+ if (!printflags(mctl_sync, tcp->u_arg[2]))
+ tprintf("MS_???");
+ }
+ return 0;
+}
+
+#endif /* MS_ASYNC */
+
+#ifdef MC_SYNC
+
+static struct xlat mctl_funcs[] = {
+ { MC_LOCK, "MC_LOCK" },
+ { MC_LOCKAS, "MC_LOCKAS" },
+ { MC_SYNC, "MC_SYNC" },
+ { MC_UNLOCK, "MC_UNLOCK" },
+ { MC_UNLOCKAS, "MC_UNLOCKAS" },
+ { 0, NULL },
+};
+
+static struct xlat mctl_lockas[] = {
+ { MCL_CURRENT, "MCL_CURRENT" },
+ { MCL_FUTURE, "MCL_FUTURE" },
+ { 0, NULL },
+};
+
+int
+sys_mctl(tcp)
+struct tcb *tcp;
+{
+ int arg, function;
+
+ if (entering(tcp)) {
+ /* addr */
+ tprintf("%#lx", tcp->u_arg[0]);
+ /* len */
+ tprintf(", %lu, ", tcp->u_arg[1]);
+ /* function */
+ function = tcp->u_arg[2];
+ if (!printflags(mctl_funcs, function))
+ tprintf("MC_???");
+ /* arg */
+ arg = tcp->u_arg[3];
+ tprintf(", ");
+ switch (function) {
+ case MC_SYNC:
+ if (!printflags(mctl_sync, arg))
+ tprintf("MS_???");
+ break;
+ case MC_LOCKAS:
+ if (!printflags(mctl_lockas, arg))
+ tprintf("MCL_???");
+ break;
+ default:
+ tprintf("%#x", arg);
+ break;
+ }
+ }
+ return 0;
+}
+
+#endif /* MC_SYNC */
+
+int
+sys_mincore(tcp)
+struct tcb *tcp;
+{
+ int i, len;
+ char *vec = NULL;
+
+ if (entering(tcp)) {
+ tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
+ } else {
+ len = tcp->u_arg[1];
+ if (syserror(tcp) || tcp->u_arg[2] == 0 ||
+ (vec = malloc((u_int)len)) == NULL ||
+ umoven(tcp, tcp->u_arg[2], len, vec) < 0)
+ tprintf("%#lx", tcp->u_arg[2]);
+ else {
+ tprintf("[");
+ for (i = 0; i < len; i++) {
+ if (abbrev(tcp) && i >= max_strlen) {
+ tprintf("...");
+ break;
+ }
+ tprintf((vec[i] & 1) ? "1" : "0");
+ }
+ tprintf("]");
+ }
+ if (vec)
+ free(vec);
+ }
+ return 0;
+}
+
+int
+sys_getpagesize(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp))
+ return RVAL_HEX;
+ return 0;
+}
+
+#if defined(LINUX) && defined(__i386__)
+int
+sys_modify_ldt(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ struct modify_ldt_ldt_s copy;
+ tprintf("%ld", tcp->u_arg[0]);
+ if (tcp->u_arg[1] == 0
+ || tcp->u_arg[2] != sizeof (struct modify_ldt_ldt_s)
+ || umove(tcp, tcp->u_arg[1], &copy) == -1)
+ tprintf(", %lx", tcp->u_arg[1]);
+ else {
+ tprintf(", {entry_number:%d, ", copy.entry_number);
+ if (!verbose(tcp))
+ tprintf("...}");
+ else {
+ tprintf("base_addr:%#08lx, "
+ "limit:%d, "
+ "seg_32bit:%d, "
+ "contents:%d, "
+ "read_exec_only:%d, "
+ "limit_in_pages:%d, "
+ "seg_not_present:%d, "
+ "useable:%d}",
+ copy.base_addr,
+ copy.limit,
+ copy.seg_32bit,
+ copy.contents,
+ copy.read_exec_only,
+ copy.limit_in_pages,
+ copy.seg_not_present,
+ copy.useable);
+ }
+ }
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+#endif /* LINUX && __i386__ */
+
diff --git a/net.c b/net.c
new file mode 100644
index 000000000..ab8a36782
--- /dev/null
+++ b/net.c
@@ -0,0 +1,836 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#if defined(LINUX)
+#include <asm/types.h>
+#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC__ + __GLIBC_MINOR__ >= 3)
+# include <netipx/ipx.h>
+#else
+# include <linux/ipx.h>
+#endif
+#endif /* LINUX */
+
+#ifndef PF_UNSPEC
+#define PF_UNSPEC AF_UNSPEC
+#endif
+
+#ifdef LINUX
+/* Under Linux these are enums so we can't test for them with ifdef. */
+#define IPPROTO_EGP IPPROTO_EGP
+#define IPPROTO_PUP IPPROTO_PUP
+#define IPPROTO_IDP IPPROTO_IDP
+#define IPPROTO_IGMP IPPROTO_IGMP
+#define IPPROTO_RAW IPPROTO_RAW
+#define IPPROTO_MAX IPPROTO_MAX
+#endif
+
+static struct xlat domains[] = {
+ { PF_UNSPEC, "PF_UNSPEC" },
+ { PF_UNIX, "PF_UNIX" },
+ { PF_INET, "PF_INET" },
+#ifdef PF_LOCAL
+ { PF_LOCAL, "PS_LOCAL" },
+#endif
+#ifdef PF_ISO
+ { PF_ISO, "PF_ISO" },
+#endif
+#ifdef PF_AX25
+ { PF_AX25, "PF_AX25" },
+#endif
+#ifdef PF_IPX
+ { PF_IPX, "PF_IPX" },
+#endif
+#ifdef PF_APPLETALK
+ { PF_APPLETALK, "PF_APPLETALK" },
+#endif
+#ifdef PF_NETROM
+ { PF_NETROM, "PF_NETROM" },
+#endif
+#ifdef PF_BRIDGE
+ { PF_BRIDGE, "PF_BRIDGE" },
+#endif
+#ifdef PF_AAL5
+ { PF_AAL5, "PF_AAL5" },
+#endif
+#ifdef PF_X25
+ { PF_X25, "PF_X25" },
+#endif
+#ifdef PF_INET6
+ { PF_INET6, "PF_INET6" },
+#endif
+#ifdef PF_ROSE
+ { PF_ROSE, "PF_ROSE" },
+#endif
+#ifdef PF_DECNET
+ { PF_DECNET, "PF_DECNET" },
+#endif
+#ifdef PF_NETBEUI
+ { PF_NETBEUI, "PF_NETBEUI" },
+#endif
+#ifdef PF_IMPLINK
+ { PF_IMPLINK, "PF_IMPLINK" },
+#endif
+ { 0, NULL },
+};
+static struct xlat socktypes[] = {
+ { SOCK_STREAM, "SOCK_STREAM" },
+ { SOCK_DGRAM, "SOCK_DGRAM" },
+#ifdef SOCK_RAW
+ { SOCK_RAW, "SOCK_RAW" },
+#endif
+#ifdef SOCK_SEQPACKET
+ { SOCK_SEQPACKET,"SOCK_SEQPACKET"},
+#endif
+#ifdef SOCK_RDM
+ { SOCK_RDM, "SOCK_RDM" },
+#endif
+#ifdef SOCK_PACKET
+ { SOCK_PACKET, "SOCK_PACKET" },
+#endif
+ { 0, NULL },
+};
+static struct xlat protocols[] = {
+ { IPPROTO_IP, "IPPROTO_IP" },
+ { IPPROTO_ICMP, "IPPROTO_ICMP" },
+ { IPPROTO_TCP, "IPPROTO_TCP" },
+ { IPPROTO_UDP, "IPPROTO_UDP" },
+#ifdef IPPROTO_GGP
+ { IPPROTO_GGP, "IPPROTO_GGP" },
+#endif
+#ifdef IPPROTO_EGP
+ { IPPROTO_EGP, "IPPROTO_EGP" },
+#endif
+#ifdef IPPROTO_PUP
+ { IPPROTO_PUP, "IPPROTO_PUP" },
+#endif
+#ifdef IPPROTO_IDP
+ { IPPROTO_IDP, "IPPROTO_IDP" },
+#endif
+#ifdef IPPROTO_IPV6
+ { IPPROTO_IPV6, "IPPROTO_IPV6" },
+#endif
+#ifdef IPPROTO_ICMPV6
+ { IPPROTO_ICMPV6,"IPPROTO_ICMPV6"},
+#endif
+#ifdef IPPROTO_IGMP
+ { IPPROTO_IGMP, "IPPROTO_IGMP" },
+#endif
+#ifdef IPPROTO_HELLO
+ { IPPROTO_HELLO,"IPPROTO_HELLO" },
+#endif
+#ifdef IPPROTO_ND
+ { IPPROTO_ND, "IPPROTO_ND" },
+#endif
+#ifdef IPPROTO_RAW
+ { IPPROTO_RAW, "IPPROTO_RAW" },
+#endif
+#ifdef IPPROTO_MAX
+ { IPPROTO_MAX, "IPPROTO_MAX" },
+#endif
+#ifdef IPPROTO_IPIP
+ { IPPROTO_IPIP, "IPPROTO_IPIP" },
+#endif
+ { 0, NULL },
+};
+static struct xlat msg_flags[] = {
+ { MSG_OOB, "MSG_OOB" },
+#ifdef MSG_DONTROUTE
+ { MSG_DONTROUTE,"MSG_DONTROUTE" },
+#endif
+#ifdef MSG_PEEK
+ { MSG_PEEK, "MSG_PEEK" },
+#endif
+#ifdef MSG_CTRUNC
+ { MSG_CTRUNC, "MSG_CTRUNC" },
+#endif
+#ifdef MSG_PROXY
+ { MSG_PROXY, "MSG_PROXY" },
+#endif
+#ifdef MSG_EOR
+ { MSG_EOR, "MSG_EOR" },
+#endif
+#ifdef MSG_WAITALL
+ { MSG_WAITALL, "MSG_WAITALL" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat sockoptions[] = {
+#ifdef SO_DEBUG
+ { SO_DEBUG, "SO_DEBUG" },
+#endif
+#ifdef SO_REUSEADDR
+ { SO_REUSEADDR, "SO_REUSEADDR" },
+#endif
+#ifdef SO_KEEPALIVE
+ { SO_KEEPALIVE, "SO_KEEPALIVE" },
+#endif
+#ifdef SO_DONTROUTE
+ { SO_DONTROUTE, "SO_DONTROUTE" },
+#endif
+#ifdef SO_BROADCAST
+ { SO_BROADCAST, "SO_BROADCAST" },
+#endif
+#ifdef SO_LINGER
+ { SO_LINGER, "SO_LINGER" },
+#endif
+#ifdef SO_OOBINLINE
+ { SO_OOBINLINE, "SO_OOBINLINE" },
+#endif
+#ifdef SO_TYPE
+ { SO_TYPE, "SO_TYPE" },
+#endif
+#ifdef SO_ERROR
+ { SO_ERROR, "SO_ERROR" },
+#endif
+#ifdef SO_SNDBUF
+ { SO_SNDBUF, "SO_SNDBUF" },
+#endif
+#ifdef SO_RCVBUF
+ { SO_RCVBUF, "SO_RCVBUF" },
+#endif
+#ifdef SO_NO_CHECK
+ { SO_NO_CHECK, "SO_NO_CHECK" },
+#endif
+#ifdef SO_PRIORITY
+ { SO_PRIORITY, "SO_PRIORITY" },
+#endif
+#ifdef SO_ACCEPTCONN
+ { SO_ACCEPTCONN,"SO_ACCEPTCONN" },
+#endif
+#ifdef SO_USELOOPBACK
+ { SO_USELOOPBACK,"SO_USELOOPBACK"},
+#endif
+#ifdef SO_SNDLOWAT
+ { SO_SNDLOWAT, "SO_SNDLOWAT" },
+#endif
+#ifdef SO_RCVLOWAT
+ { SO_RCVLOWAT, "SO_RCVLOWAT" },
+#endif
+#ifdef SO_SNDTIMEO
+ { SO_SNDTIMEO, "SO_SNDTIMEO" },
+#endif
+#ifdef SO_RCVTIMEO
+ { SO_RCVTIMEO, "SO_RCVTIMEO" },
+#endif
+#ifdef SO_BSDCOMPAT
+ { SO_BSDCOMPAT, "SO_BSDCOMPAT" },
+#endif
+#ifdef SO_REUSEPORT
+ { SO_REUSEPORT, "SO_REUSEPORT" },
+#endif
+#ifdef SO_RCVLOWAT
+ { SO_RCVLOWAT, "SO_RCVLOWAT" },
+#endif
+#ifdef SO_SNDLOWAT
+ { SO_SNDLOWAT, "SO_SNDLOWAT" },
+#endif
+#ifdef SO_RCVTIMEO
+ { SO_RCVTIMEO, "SO_RCVTIMEO" },
+#endif
+#ifdef SO_SNDTIMEO
+ { SO_SNDTIMEO, "SO_SNDTIMEO" },
+#endif
+ { 0, NULL },
+};
+
+#ifdef SOL_IP
+static struct xlat sockipoptions[] = {
+ { IP_TOS, "IP_TOS" },
+ { IP_TTL, "IP_TTL" },
+#if defined(IP_HDRINCL)
+ { IP_HDRINCL, "IP_HDRINCL" },
+#endif
+#if defined(IP_OPTIONS)
+ { IP_OPTIONS, "IP_OPTIONS" },
+#endif
+ { IP_MULTICAST_IF, "IP_MULTICAST_IF" },
+ { IP_MULTICAST_TTL, "IP_MULTICAST_TTL" },
+ { IP_MULTICAST_LOOP, "IP_MULTICAST_LOOP" },
+ { IP_ADD_MEMBERSHIP, "IP_ADD_MEMBERSHIP" },
+ { IP_DROP_MEMBERSHIP, "IP_DROP_MEMBERSHIP" },
+ { 0, NULL },
+};
+#endif /* SOL_IP */
+
+#ifdef SOL_IPX
+static struct xlat sockipxoptions[] = {
+ { IPX_TYPE, "IPX_TYPE" },
+ { 0, NULL },
+};
+#endif /* SOL_IPX */
+
+#ifdef SOL_TCP
+static struct xlat socktcpoptions[] = {
+ { TCP_NODELAY, "TCP_NODELAY" },
+ { TCP_MAXSEG, "TCP_MAXSEG" },
+ { 0, NULL },
+};
+#endif /* SOL_TCP */
+
+void
+printsock(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ struct sockaddr sa;
+ struct sockaddr_in *sin = (struct sockaddr_in *) &sa;
+ struct sockaddr_un sau;
+#ifdef LINUX
+ struct sockaddr_ipx sipx;
+#endif
+
+ if (addr == 0) {
+ tprintf("NULL");
+ return;
+ }
+ if (!verbose(tcp)) {
+ tprintf("%#lx", addr);
+ return;
+ }
+ if (umove(tcp, addr, &sa) < 0) {
+ tprintf("{...}");
+ return;
+ }
+ switch (sa.sa_family) {
+ case AF_UNIX:
+ if (umove(tcp, addr, &sau) < 0)
+ tprintf("{sun_family=AF_UNIX, ...}");
+ else
+ tprintf("{sun_family=AF_UNIX, sun_path=\"%s\"}",
+ sau.sun_path);
+ break;
+ case AF_INET:
+ tprintf("{sin_family=AF_INET, ");
+ tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")}",
+ ntohs(sin->sin_port), inet_ntoa(sin->sin_addr));
+ break;
+#ifdef AF_IPX
+ case AF_IPX:
+ if (umove(tcp, addr, &sipx)<0)
+ tprintf("{sipx_family=AF_IPX, ...}");
+ else {
+ int i;
+ tprintf("{sipx_family=AF_IPX, ");
+ tprintf("{sipx_port=htons(%u), ",
+ ntohs(sipx.sipx_port));
+ /* Yes, I know, this does not look too
+ * strace-ish, but otherwise the IPX
+ * addresses just look monstrous...
+ * Anyways, feel free if you don't like
+ * this way.. :)
+ */
+ tprintf("%08lx:", ntohl(sipx.sipx_network));
+ for (i = 0; i<IPX_NODE_LEN; i++)
+ tprintf("%02x", sipx.sipx_node[i]);
+ tprintf("/[%02x]", sipx.sipx_type);
+ tprintf("}");
+ }
+ break;
+#endif /* AF_IPX */
+ /* AF_AX25 AF_APPLETALK AF_NETROM AF_BRIDGE AF_AAL5
+ AF_X25 AF_INET6 AF_ROSE still need to be done */
+
+ default:
+ tprintf("{sa_family=%u, sa_data=", sa.sa_family);
+ printstr(tcp, (long) &((struct sockaddr *) addr)->sa_data,
+ sizeof sa.sa_data);
+ tprintf("}");
+ break;
+ }
+}
+
+#if HAVE_SENDMSG
+
+static void
+printmsghdr(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ struct msghdr msg;
+
+ umove(tcp, addr, &msg);
+ tprintf("{msg_name=%s, msg_namelen=%u, msg_iov=%#lx, msg_iovlen=%u, ",
+ (char *) msg.msg_name, msg.msg_namelen,
+ (unsigned long) msg.msg_iov, msg.msg_iovlen);
+#ifdef HAVE_MSG_CONTROL
+ tprintf("msg_control=%#lx, msg_controllen=%u, msg_flags=%#x}",
+ (unsigned long) msg.msg_control, msg.msg_controllen,
+ msg.msg_flags);
+#else /* !HAVE_MSG_CONTROL */
+ tprintf("msg_accrights=%#lx, msg_accrightslen=%u}",
+ (unsigned long) msg.msg_accrights, msg.msg_accrightslen);
+#endif /* !HAVE_MSG_CONTROL */
+}
+
+#endif /* HAVE_SENDMSG */
+
+int
+sys_socket(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(domains, tcp->u_arg[0], "PF_???");
+ tprintf(", ");
+ printxval(socktypes, tcp->u_arg[1], "SOCK_???");
+ tprintf(", ");
+ switch (tcp->u_arg[0]) {
+ case PF_INET:
+ printxval(protocols, tcp->u_arg[2], "IPPROTO_???");
+ break;
+#ifdef PF_IPX
+ case PF_IPX:
+ /* BTW: I don't believe this.. */
+ tprintf("[");
+ printxval(domains, tcp->u_arg[2], "PF_???");
+ tprintf("]");
+ break;
+#endif /* PF_IPX */
+ default:
+ tprintf("%lu", tcp->u_arg[2]);
+ break;
+ }
+ }
+ return 0;
+}
+
+int
+sys_bind(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printsock(tcp, tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_connect(tcp)
+struct tcb *tcp;
+{
+ return sys_bind(tcp);
+}
+
+int
+sys_listen(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_accept(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else if (!tcp->u_arg[2])
+ tprintf("%#lx, NULL", tcp->u_arg[1]);
+ else {
+ if (tcp->u_arg[1] == 0 || syserror(tcp)) {
+ tprintf("%#lx", tcp->u_arg[1]);
+ } else {
+ printsock(tcp, tcp->u_arg[1]);
+ }
+ tprintf(", ");
+ printnum(tcp, tcp->u_arg[2], "%lu");
+ }
+ return 0;
+}
+
+int
+sys_send(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu, ", tcp->u_arg[2]);
+ /* flags */
+ if (printflags(msg_flags, tcp->u_arg[3]) == 0)
+ tprintf("0");
+ }
+ return 0;
+}
+
+int
+sys_sendto(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %lu, ", tcp->u_arg[2]);
+ /* flags */
+ if (printflags(msg_flags, tcp->u_arg[3]) == 0)
+ tprintf("0");
+ /* to address */
+ tprintf(", ");
+ printsock(tcp, tcp->u_arg[4]);
+ /* to length */
+ tprintf(", %lu", tcp->u_arg[5]);
+ }
+ return 0;
+}
+
+#ifdef HAVE_SENDMSG
+
+int
+sys_sendmsg(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ printmsghdr(tcp, tcp->u_arg[1]);
+ /* flags */
+ tprintf(", ");
+ if (printflags(msg_flags, tcp->u_arg[2]) == 0)
+ tprintf("0");
+ }
+ return 0;
+}
+
+#endif /* HAVE_SENDMSG */
+
+int
+sys_recv(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+
+ tprintf(", %lu, ", tcp->u_arg[2]);
+ if (printflags(msg_flags, tcp->u_arg[3]) == 0)
+ tprintf("0");
+ }
+ return 0;
+}
+
+int
+sys_recvfrom(tcp)
+struct tcb *tcp;
+{
+ int fromlen;
+
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %lu, %lu, %#lx, %#lx",
+ tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3],
+ tcp->u_arg[4], tcp->u_arg[5]);
+ return 0;
+ }
+ /* buf */
+ printstr(tcp, tcp->u_arg[1], tcp->u_rval);
+ /* len */
+ tprintf(", %lu, ", tcp->u_arg[2]);
+ /* flags */
+ if (printflags(msg_flags, tcp->u_arg[3]) == 0)
+ tprintf("0");
+ /* from address, len */
+ if (!tcp->u_arg[4] || !tcp->u_arg[5]) {
+ if (tcp->u_arg[4] == 0)
+ tprintf(", NULL");
+ else
+ tprintf(", %#lx", tcp->u_arg[4]);
+ if (tcp->u_arg[5] == 0)
+ tprintf(", NULL");
+ else
+ tprintf(", %#lx", tcp->u_arg[5]);
+ return 0;
+ }
+ if (umove(tcp, tcp->u_arg[5], &fromlen) < 0) {
+ tprintf(", {...}, [?]");
+ return 0;
+ }
+ tprintf(", ");
+ printsock(tcp, tcp->u_arg[4]);
+ /* from length */
+ tprintf(", [%u]", fromlen);
+ }
+ return 0;
+}
+
+#ifdef HAVE_SENDMSG
+
+int
+sys_recvmsg(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp) || !verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printmsghdr(tcp, tcp->u_arg[1]);
+ /* flags */
+ tprintf(", ");
+ if (printflags(msg_flags, tcp->u_arg[2]) == 0)
+ tprintf("0");
+ }
+ return 0;
+}
+
+#endif /* HAVE_SENDMSG */
+
+int
+sys_shutdown(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, %ld", tcp->u_arg[0], tcp->u_arg[1]);
+ switch (tcp->u_arg[1]) {
+ case 0:
+ tprintf("%s", " /* receive */");
+ break;
+ case 1:
+ tprintf("%s", " /* send */");
+ break;
+ case 2:
+ tprintf("%s", " /* send and receive */");
+ break;
+ }
+ }
+ return 0;
+}
+
+int
+sys_getsockname(tcp)
+struct tcb *tcp;
+{
+ return sys_accept(tcp);
+}
+
+int
+sys_getpeername(tcp)
+struct tcb *tcp;
+{
+ return sys_accept(tcp);
+}
+
+int
+sys_pipe(tcp)
+struct tcb *tcp;
+{
+
+#if defined(LINUX) && !defined(SPARC)
+ int fds[2];
+
+ if (exiting(tcp)) {
+ if (syserror(tcp)) {
+ tprintf("%#lx", tcp->u_arg[0]);
+ return 0;
+ }
+ if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
+ tprintf("[...]");
+ else
+ tprintf("[%u, %u]", fds[0], fds[1]);
+ }
+#else
+#if defined(SPARC) || defined(SVR4)
+ if (exiting(tcp))
+ tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
+#endif
+#endif
+ return 0;
+}
+
+int
+sys_socketpair(tcp)
+struct tcb *tcp;
+{
+#ifdef LINUX
+ int fds[2];
+#endif
+
+ if (entering(tcp)) {
+ printxval(domains, tcp->u_arg[0], "PF_???");
+ tprintf(", ");
+ printxval(socktypes, tcp->u_arg[1], "SOCK_???");
+ tprintf(", ");
+ switch (tcp->u_arg[0]) {
+ case PF_INET:
+ printxval(protocols, tcp->u_arg[2], "IPPROTO_???");
+ break;
+#ifdef PF_IPX
+ case PF_IPX:
+ /* BTW: I don't believe this.. */
+ tprintf("[");
+ printxval(domains, tcp->u_arg[2], "PF_???");
+ tprintf("]");
+ break;
+#endif /* PF_IPX */
+ default:
+ tprintf(", %lu", tcp->u_arg[2]);
+ break;
+ }
+ } else {
+ if (syserror(tcp)) {
+ tprintf("%#lx", tcp->u_arg[3]);
+ return 0;
+ }
+#ifdef LINUX
+ if (umoven(tcp, tcp->u_arg[3], sizeof fds, (char *) fds) < 0)
+ tprintf("[...]");
+ else
+ tprintf(", [%u, %u]", fds[0], fds[1]);
+#endif /* LINUX */
+#ifdef SUNOS4
+ tprintf(", [%lu, %lu]", tcp->u_rval, getrval2(tcp));
+#endif /* SUNOS4 */
+#ifdef SVR4
+ tprintf(", [%lu, %lu]", tcp->u_rval, getrval2(tcp));
+#endif /* SVR4 */
+ }
+ return 0;
+}
+
+int
+sys_getsockopt(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ switch (tcp->u_arg[1]) {
+ case SOL_SOCKET:
+ tprintf("SOL_SOCKET, ");
+ printxval(sockoptions, tcp->u_arg[2], "SO_???");
+ tprintf(", ");
+ break;
+#ifdef SOL_IP
+ case SOL_IP:
+ tprintf("SOL_IP, ");
+ printxval(sockipoptions, tcp->u_arg[2], "IP_???");
+ tprintf(", ");
+ break;
+#endif
+#ifdef SOL_IPX
+ case SOL_IPX:
+ tprintf("SOL_IPX, ");
+ printxval(sockipxoptions, tcp->u_arg[2], "IPX_???");
+ tprintf(", ");
+ break;
+#endif
+#ifdef SOL_TCP
+ case SOL_TCP:
+ tprintf("SOL_TCP, ");
+ printxval(socktcpoptions, tcp->u_arg[2], "TCP_???");
+ tprintf(", ");
+ break;
+#endif
+
+ /* SOL_AX25 SOL_ROSE SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25
+ * etc. still need work */
+ default:
+ /* XXX - should know socket family here */
+ printxval(protocols, tcp->u_arg[1], "IPPROTO_???");
+ tprintf("%lu, ", tcp->u_arg[2]);
+ break;
+ }
+ } else {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %#lx",
+ tcp->u_arg[3], tcp->u_arg[4]);
+ return 0;
+ }
+ printnum(tcp, tcp->u_arg[3], "%ld");
+ tprintf(", ");
+ printnum(tcp, tcp->u_arg[4], "%ld");
+ }
+ return 0;
+}
+
+int
+sys_setsockopt(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ switch (tcp->u_arg[1]) {
+ case SOL_SOCKET:
+ tprintf("SOL_SOCKET, ");
+ printxval(sockoptions, tcp->u_arg[2], "SO_???");
+ tprintf(", ");
+ break;
+#ifdef SOL_IP
+ case SOL_IP:
+ tprintf("SOL_IP, ");
+ printxval(sockipoptions, tcp->u_arg[2], "IP_???");
+ tprintf(", ");
+ break;
+#endif
+#ifdef SOL_IPX
+ case SOL_IPX:
+ tprintf("SOL_IPX, ");
+ printxval(sockipxoptions, tcp->u_arg[2], "IPX_???");
+ tprintf(", ");
+ break;
+#endif
+#ifdef SOL_TCP
+ case SOL_TCP:
+ tprintf("SOL_TCP, ");
+ printxval(socktcpoptions, tcp->u_arg[2], "TCP_???");
+ tprintf(", ");
+ break;
+#endif
+
+ /* SOL_AX25 SOL_ATALK SOL_NETROM SOL_UDP SOL_DECNET SOL_X25
+ * etc. still need work */
+ default:
+ /* XXX - should know socket family here */
+ printxval(protocols, tcp->u_arg[1], "IPPROTO_???");
+ tprintf("%lu, ", tcp->u_arg[2]);
+ break;
+ }
+ printnum(tcp, tcp->u_arg[3], "%ld");
+ tprintf(", %lu", tcp->u_arg[4]);
+ }
+ return 0;
+}
diff --git a/proc.c b/proc.c
new file mode 100644
index 000000000..6e110fd48
--- /dev/null
+++ b/proc.c
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#ifdef SVR4
+
+static struct xlat proc_status_flags[] = {
+ { PR_STOPPED, "PR_STOPPED" },
+ { PR_ISTOP, "PR_ISTOP" },
+ { PR_DSTOP, "PR_DSTOP" },
+ { PR_ASLEEP, "PR_ASLEEP" },
+ { PR_FORK, "PR_FORK" },
+ { PR_RLC, "PR_RLC" },
+ { PR_PTRACE, "PR_PTRACE" },
+ { PR_PCINVAL, "PR_PCINVAL" },
+ { PR_ISSYS, "PR_ISSYS" },
+#ifdef PR_STEP
+ { PR_STEP, "PR_STEP" },
+#endif
+#ifdef PR_KLC
+ { PR_KLC, "PR_KLC" },
+#endif
+#ifdef PR_ASYNC
+ { PR_ASYNC, "PR_ASYNC" },
+#endif
+#ifdef PR_PCOMPAT
+ { PR_PCOMPAT, "PR_PCOMPAT" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat proc_status_why[] = {
+ { PR_REQUESTED, "PR_REQUESTED" },
+ { PR_SIGNALLED, "PR_SIGNALLED" },
+ { PR_SYSENTRY, "PR_SYSENTRY" },
+ { PR_SYSEXIT, "PR_SYSEXIT" },
+ { PR_JOBCONTROL,"PR_JOBCONTROL" },
+ { PR_FAULTED, "PR_FAULTED" },
+#ifdef PR_SUSPENDED
+ { PR_SUSPENDED, "PR_SUSPENDED" },
+#endif
+#ifdef PR_CHECKPOINT
+ { PR_CHECKPOINT,"PR_CHECKPOINT" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat proc_run_flags[] = {
+ { PRCSIG, "PRCSIG" },
+ { PRCFAULT, "PRCFAULT" },
+ { PRSTRACE, "PRSTRACE" },
+ { PRSHOLD, "PRSHOLD" },
+ { PRSFAULT, "PRSFAULT" },
+ { PRSVADDR, "PRSVADDR" },
+ { PRSTEP, "PRSTEP" },
+ { PRSABORT, "PRSABORT" },
+ { PRSTOP, "PRSTOP" },
+ { 0, NULL },
+};
+
+#if 0
+
+static struct xlat proc_map_flags[] = {
+ { MA_READ, "MA_READ" },
+ { MA_WRITE, "MA_WRITE" },
+ { MA_EXEC, "MA_EXEC" },
+ { MA_SHARED, "MA_SHARED" },
+ { MA_BREAK, "MA_BREAK" },
+ { MA_STACK, "MA_STACK" },
+ { 0, NULL },
+};
+
+static struct xlat proc_page_flags[] = {
+ { PG_REFERENCED,"PG_REFERENCED" },
+ { PG_MODIFIED, "PG_MODIFIED" },
+ { PG_HWMAPPED, "PG_HWMAPPED" },
+ { 0, NULL },
+};
+
+#ifdef SPARC
+
+static struct xlat proc_regs[] = {
+ { R_G0, "R_G0" },
+ { R_G1, "R_G1" },
+ { R_G2, "R_G2" },
+ { R_G3, "R_G3" },
+ { R_G4, "R_G4" },
+ { R_G5, "R_G5" },
+ { R_G6, "R_G6" },
+ { R_G7, "R_G7" },
+ { R_O0, "R_O0" },
+ { R_O1, "R_O1" },
+ { R_O2, "R_O2" },
+ { R_O3, "R_O3" },
+ { R_O4, "R_O4" },
+ { R_O5, "R_O5" },
+ { R_O6, "R_O6" },
+ { R_O7, "R_O7" },
+ { R_L0, "R_L0" },
+ { R_L1, "R_L1" },
+ { R_L2, "R_L2" },
+ { R_L3, "R_L3" },
+ { R_L4, "R_L4" },
+ { R_L5, "R_L5" },
+ { R_L6, "R_L6" },
+ { R_L7, "R_L7" },
+ { R_I0, "R_I0" },
+ { R_I1, "R_I1" },
+ { R_I2, "R_I2" },
+ { R_I3, "R_I3" },
+ { R_I4, "R_I4" },
+ { R_I5, "R_I5" },
+ { R_I6, "R_I6" },
+ { R_I7, "R_I7" },
+ { R_PSR, "R_PSR" },
+ { R_PC, "R_PC" },
+ { R_nPC, "R_nPC" },
+ { R_Y, "R_Y" },
+ { R_WIM, "R_WIM" },
+ { R_TBR, "R_TBR" },
+ { 0, NULL },
+};
+
+#endif /* SPARC */
+
+#endif /* 0 */
+
+int
+proc_ioctl(tcp, code, arg)
+struct tcb *tcp;
+int code, arg;
+{
+ int val;
+ prstatus_t status;
+ prrun_t run;
+
+ if (entering(tcp))
+ return 0;
+
+ switch (code) {
+ case PIOCSTATUS:
+ case PIOCSTOP:
+ case PIOCWSTOP:
+ if (arg == 0)
+ tprintf(", NULL");
+ else if (syserror(tcp))
+ tprintf(", %#x", arg);
+ else if (umove(tcp, arg, &status) < 0)
+ tprintf(", {...}");
+ else {
+ tprintf(", {pr_flags=");
+ if (!printflags(proc_status_flags, status.pr_flags))
+ tprintf("0");
+ if (status.pr_why) {
+ tprintf(", pr_why=");
+ printxval(proc_status_why, status.pr_why,
+ "PR_???");
+ }
+ switch (status.pr_why) {
+ case PR_SIGNALLED:
+ case PR_JOBCONTROL:
+ tprintf(", pr_what=");
+ printsignal(status.pr_what);
+ break;
+ case PR_FAULTED:
+ tprintf(", pr_what=%d", status.pr_what);
+ break;
+ case PR_SYSENTRY:
+ case PR_SYSEXIT:
+ tprintf(", pr_what=SYS_%s",
+ sysent[status.pr_what].sys_name);
+ break;
+ }
+ tprintf(", ...}");
+ }
+ return 1;
+ case PIOCRUN:
+ if (arg == 0)
+ tprintf(", NULL");
+ else if (umove(tcp, arg, &run) < 0)
+ tprintf(", {...}");
+ else {
+ tprintf(", {pr_flags=");
+ if (!printflags(proc_run_flags, run.pr_flags))
+ tprintf("0");
+ tprintf(", ...}");
+ }
+ return 1;
+#ifdef PIOCSET
+ case PIOCSET:
+ case PIOCRESET:
+ if (umove(tcp, arg, &val) < 0)
+ tprintf(", [?]");
+ else {
+ tprintf(", [");
+ if (!printflags(proc_status_flags, val))
+ tprintf("0");
+ tprintf("]");
+ }
+ return 1;
+#endif /* PIOCSET */
+ case PIOCKILL:
+ case PIOCUNKILL:
+ /* takes a pointer to a signal */
+ if (umove(tcp, arg, &val) < 0)
+ tprintf(", [?]");
+ else {
+ tprintf(", [");
+ printsignal(val);
+ tprintf("]");
+ }
+ return 1;
+ case PIOCSFORK:
+ case PIOCRFORK:
+ case PIOCSRLC:
+ case PIOCRRLC:
+ /* doesn't take an arg */
+ return 1;
+ default:
+ /* ad naseum */
+ return 0;
+ }
+}
+
+#endif /* SVR4 */
diff --git a/process.c b/process.c
new file mode 100644
index 000000000..f9f9993cf
--- /dev/null
+++ b/process.c
@@ -0,0 +1,1645 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include <sys/utsname.h>
+#include <sys/user.h>
+#include <sys/syscall.h>
+#include <signal.h>
+#ifdef SUNOS4
+#include <machine/reg.h>
+#endif /* SUNOS4 */
+
+#if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1
+# include <sys/reg.h>
+# define PTRACE_PEEKUSR PTRACE_PEEKUSER
+# define PTRACE_POKEUSR PTRACE_POKEUSER
+#endif
+
+#ifdef LINUX
+#include <linux/ptrace.h>
+#endif /* LINUX */
+
+#ifdef HAVE_PRCTL
+#include <sys/prctl.h>
+#endif
+
+#ifndef WCOREDUMP
+#define WCOREDUMP(status) ((status) & 0200)
+#endif
+
+/* WTA: this has `&& !defined(LINUXSPARC', this seems unneeded though? */
+#if defined(HAVE_PRCTL)
+static struct xlat prctl_options[] = {
+#ifdef PR_MAXPROCS
+ { PR_MAXPROCS, "PR_MAXPROCS" },
+#endif
+#ifdef PR_ISBLOCKED
+ { PR_ISBLOCKED, "PR_ISBLOCKED" },
+#endif
+#ifdef PR_SETSTACKSIZE
+ { PR_SETSTACKSIZE, "PR_SETSTACKSIZE" },
+#endif
+#ifdef PR_GETSTACKSIZE
+ { PR_GETSTACKSIZE, "PR_GETSTACKSIZE" },
+#endif
+#ifdef PR_MAXPPROCS
+ { PR_MAXPPROCS, "PR_MAXPPROCS" },
+#endif
+#ifdef PR_UNBLKONEXEC
+ { PR_UNBLKONEXEC, "PR_UNBLKONEXEC" },
+#endif
+#ifdef PR_ATOMICSIM
+ { PR_ATOMICSIM, "PR_ATOMICSIM" },
+#endif
+#ifdef PR_SETEXITSIG
+ { PR_SETEXITSIG, "PR_SETEXITSIG" },
+#endif
+#ifdef PR_RESIDENT
+ { PR_RESIDENT, "PR_RESIDENT" },
+#endif
+#ifdef PR_ATTACHADDR
+ { PR_ATTACHADDR, "PR_ATTACHADDR" },
+#endif
+#ifdef PR_DETACHADDR
+ { PR_DETACHADDR, "PR_DETACHADDR" },
+#endif
+#ifdef PR_TERMCHILD
+ { PR_TERMCHILD, "PR_TERMCHILD" },
+#endif
+#ifdef PR_GETSHMASK
+ { PR_GETSHMASK, "PR_GETSHMASK" },
+#endif
+#ifdef PR_GETNSHARE
+ { PR_GETNSHARE, "PR_GETNSHARE" },
+#endif
+#if defined(PR_SET_PDEATHSIG)
+ { PR_SET_PDEATHSIG, "PR_SET_PDEATHSIG" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_prctl(tcp)
+struct tcb *tcp;
+{
+ int i;
+
+ if (entering(tcp)) {
+ printxval(prctl_options, tcp->u_arg[0], "PR_???");
+ switch (tcp->u_arg[0]) {
+#ifdef PR_GETNSHARE
+ case PR_GETNSHARE:
+ break;
+#endif
+ default:
+ for (i = 1; i < tcp->u_nargs; i++)
+ tprintf(", %#lx", tcp->u_arg[i]);
+ break;
+ }
+ }
+ return 0;
+}
+
+#endif /* HAVE_PRCTL */
+
+int
+sys_gethostid(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp))
+ return RVAL_HEX;
+ return 0;
+}
+
+int
+sys_sethostname(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_gethostname(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %lu", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_setdomainname(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#ifndef LINUX
+
+int
+sys_getdomainname(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %lu", tcp->u_arg[1]);
+ }
+ return 0;
+}
+#endif /* !LINUX */
+
+int
+sys_exit(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ fprintf(stderr, "_exit returned!\n");
+ return -1;
+ }
+ /* special case: we stop tracing this process, finish line now */
+ tprintf("%ld) ", tcp->u_arg[0]);
+ tabto(acolumn);
+ tprintf("= ?");
+ printtrailer(tcp);
+ return 0;
+}
+
+int
+internal_exit(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ tcp->flags |= TCB_EXITING;
+ return 0;
+}
+
+#ifdef SVR4
+
+int
+sys_fork(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ if (getrval2(tcp)) {
+ tcp->auxstr = "child process";
+ return RVAL_UDECIMAL | RVAL_STR;
+ }
+ }
+ return 0;
+}
+
+int
+internal_fork(tcp)
+struct tcb *tcp;
+{
+ struct tcb *tcpchild;
+
+ if (exiting(tcp)) {
+ if (getrval2(tcp))
+ return 0;
+ if (!followfork)
+ return 0;
+ if (nprocs == MAX_PROCS) {
+ tcp->flags &= ~TCB_FOLLOWFORK;
+ fprintf(stderr, "sys_fork: tcb table full\n");
+ return 0;
+ }
+ else
+ tcp->flags |= TCB_FOLLOWFORK;
+ if (syserror(tcp))
+ return 0;
+ if ((tcpchild = alloctcb(tcp->u_rval)) == NULL) {
+ fprintf(stderr, "sys_fork: tcb table full\n");
+ return 0;
+ }
+ proc_open(tcpchild, 1);
+ }
+ return 0;
+}
+
+#else /* !SVR4 */
+
+int
+sys_fork(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp))
+ return RVAL_UDECIMAL;
+ return 0;
+}
+
+int
+internal_fork(tcp)
+struct tcb *tcp;
+{
+ struct tcb *tcpchild;
+ int pid;
+ int vforking = 0;
+
+#ifdef SYS_vfork
+ vforking = (tcp->scno == EXEC_vfork);
+#endif
+ if (entering(tcp)) {
+ if (!followfork || vforking)
+ return 0;
+ if (nprocs == MAX_PROCS) {
+ tcp->flags &= ~TCB_FOLLOWFORK;
+ fprintf(stderr, "sys_fork: tcb table full\n");
+ return 0;
+ }
+ tcp->flags |= TCB_FOLLOWFORK;
+ if (setbpt(tcp) < 0)
+ return 0;
+ }
+ else {
+ int bpt = tcp->flags & TCB_BPTSET;
+
+ if (!(tcp->flags & TCB_FOLLOWFORK))
+ return 0;
+ if (bpt)
+ clearbpt(tcp);
+
+ if (syserror(tcp))
+ return 0;
+
+ pid = tcp->u_rval;
+ if ((tcpchild = alloctcb(pid)) == NULL) {
+ fprintf(stderr, " [tcb table full]\n");
+ kill(pid, SIGKILL); /* XXX */
+ return 0;
+ }
+#ifdef LINUX
+ if (ptrace(PTRACE_ATTACH, pid, (char *) 1, 0) < 0) {
+ perror("PTRACE_ATTACH");
+ fprintf(stderr, "Too late?\n");
+ droptcb(tcpchild);
+ return 0;
+ }
+#endif /* LINUX */
+#ifdef SUNOS4
+#ifdef oldway
+ /* The child must have run before it can be attached. */
+ {
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 10000;
+ select(0, NULL, NULL, NULL, &tv);
+ }
+ if (ptrace(PTRACE_ATTACH, pid, (char *)1, 0) < 0) {
+ perror("PTRACE_ATTACH");
+ fprintf(stderr, "Too late?\n");
+ droptcb(tcpchild);
+ return 0;
+ }
+#else /* !oldway */
+ /* Try to catch the new process as soon as possible. */
+ {
+ int i;
+ for (i = 0; i < 1024; i++)
+ if (ptrace(PTRACE_ATTACH, pid, (char *) 1, 0) >= 0)
+ break;
+ if (i == 1024) {
+ perror("PTRACE_ATTACH");
+ fprintf(stderr, "Too late?\n");
+ droptcb(tcpchild);
+ return 0;
+ }
+ }
+#endif /* !oldway */
+#endif /* SUNOS4 */
+ tcpchild->flags |= TCB_ATTACHED;
+ /* Child has BPT too, must be removed on first occasion */
+ if (bpt) {
+ tcpchild->flags |= TCB_BPTSET;
+ tcpchild->baddr = tcp->baddr;
+ memcpy(tcpchild->inst, tcp->inst,
+ sizeof tcpchild->inst);
+ }
+ newoutf(tcpchild);
+ tcpchild->parent = tcp;
+ tcp->nchildren++;
+ if (!qflag)
+ fprintf(stderr, "Process %d attached\n", pid);
+ }
+ return 0;
+}
+
+#endif /* !SVR4 */
+
+#if defined(SUNOS4) || defined(LINUX)
+
+int
+sys_vfork(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp))
+ return RVAL_UDECIMAL;
+ return 0;
+}
+
+#endif /* SUNOS4 || LINUX */
+
+#ifndef LINUX
+
+static char idstr[16];
+
+int
+sys_getpid(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ sprintf(idstr, "ppid %lu", getrval2(tcp));
+ tcp->auxstr = idstr;
+ return RVAL_STR;
+ }
+ return 0;
+}
+
+int
+sys_getuid(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ sprintf(idstr, "euid %lu", getrval2(tcp));
+ tcp->auxstr = idstr;
+ return RVAL_STR;
+ }
+ return 0;
+}
+
+int
+sys_getgid(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ sprintf(idstr, "egid %lu", getrval2(tcp));
+ tcp->auxstr = idstr;
+ return RVAL_STR;
+ }
+ return 0;
+}
+
+#endif /* !LINUX */
+
+#ifdef LINUX
+
+int
+sys_setuid(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%u", (uid_t) tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_setgid(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%u", (gid_t) tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_getresuid(tcp)
+ struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ uid_t res[3];
+ if (umoven(tcp, tcp->u_arg[0], sizeof(pid_t),
+ (char *) &res[0]) < 0
+ || umoven(tcp, tcp->u_arg[2], sizeof(pid_t),
+ (char *) &res[1]) < 0
+ || umoven(tcp, tcp->u_arg[2], sizeof(pid_t),
+ (char *) &res[2]) < 0)
+ return -1;
+ tprintf("ruid %lu, euid %lu, suid %lu",
+ (unsigned long) res[0],
+ (unsigned long) res[1],
+ (unsigned long) res[2]);
+ }
+ return 0;
+}
+
+int
+sys_getresgid(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ uid_t res[3];
+ if (umoven(tcp, tcp->u_arg[0], sizeof(pid_t),
+ (char *) &res[0]) < 0
+ || umoven(tcp, tcp->u_arg[2], sizeof(pid_t),
+ (char *) &res[1]) < 0
+ || umoven(tcp, tcp->u_arg[2], sizeof(pid_t),
+ (char *) &res[2]) < 0)
+ return -1;
+ tprintf("rgid %lu, egid %lu, sgid %lu",
+ (unsigned long) res[0],
+ (unsigned long) res[1],
+ (unsigned long) res[2]);
+ }
+ return 0;
+}
+
+#endif /* LINUX */
+
+int
+sys_setreuid(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, %lu",
+ (unsigned long) (uid_t) tcp->u_arg[0],
+ (unsigned long) (uid_t) tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_setregid(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, %lu",
+ (unsigned long) (gid_t) tcp->u_arg[0],
+ (unsigned long) (gid_t) tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#ifdef LINUX
+int
+sys_setresuid(tcp)
+ struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("ruid %u, euid %u, suid %u",
+ (uid_t) tcp->u_arg[0],
+ (uid_t) tcp->u_arg[1],
+ (uid_t) tcp->u_arg[2]);
+ }
+ return 0;
+}
+int
+sys_setresgid(tcp)
+ struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("rgid %u, egid %u, sgid %u",
+ (uid_t) tcp->u_arg[0],
+ (uid_t) tcp->u_arg[1],
+ (uid_t) tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+#endif /* LINUX */
+
+int
+sys_setgroups(tcp)
+struct tcb *tcp;
+{
+ int i, len;
+ GETGROUPS_T *gidset;
+
+ if (entering(tcp)) {
+ len = tcp->u_arg[0];
+ tprintf("%u, ", len);
+ if (len <= 0) {
+ tprintf("[]");
+ return 0;
+ }
+ gidset = (GETGROUPS_T *) malloc(len * sizeof(GETGROUPS_T));
+ if (gidset == NULL) {
+ fprintf(stderr, "sys_setgroups: out of memory\n");
+ return -1;
+ }
+ if (!verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umoven(tcp, tcp->u_arg[1],
+ len * sizeof(GETGROUPS_T), (char *) gidset) < 0)
+ tprintf("[?]");
+ else {
+ tprintf("[");
+ for (i = 0; i < len; i++)
+ tprintf("%s%lu", i ? ", " : "",
+ (unsigned long) gidset[i]);
+ tprintf("]");
+ }
+ free((char *) gidset);
+ }
+ return 0;
+}
+
+int
+sys_getgroups(tcp)
+struct tcb *tcp;
+{
+ int i, len;
+ GETGROUPS_T *gidset;
+
+ if (entering(tcp)) {
+ len = tcp->u_arg[0];
+ tprintf("%u, ", len);
+ } else {
+ len = tcp->u_rval;
+ if (len <= 0) {
+ tprintf("[]");
+ return 0;
+ }
+ gidset = (GETGROUPS_T *) malloc(len * sizeof(GETGROUPS_T));
+ if (gidset == NULL) {
+ fprintf(stderr, "sys_getgroups: out of memory\n");
+ return -1;
+ }
+ if (!tcp->u_arg[1])
+ tprintf("NULL");
+ else if (!verbose(tcp) || tcp->u_arg[0] == 0)
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umoven(tcp, tcp->u_arg[1],
+ len * sizeof(GETGROUPS_T), (char *) gidset) < 0)
+ tprintf("[?]");
+ else {
+ tprintf("[");
+ for (i = 0; i < len; i++)
+ tprintf("%s%lu", i ? ", " : "",
+ (unsigned long) gidset[i]);
+ tprintf("]");
+ }
+ free((char *)gidset);
+ }
+ return 0;
+}
+
+int
+sys_setpgrp(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+#ifndef SVR4
+ tprintf("%lu, %lu", tcp->u_arg[0], tcp->u_arg[1]);
+#endif /* !SVR4 */
+ }
+ return 0;
+}
+
+int
+sys_getpgrp(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+#ifndef SVR4
+ tprintf("%lu", tcp->u_arg[0]);
+#endif /* !SVR4 */
+ }
+ return 0;
+}
+
+int
+sys_getsid(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_setsid(tcp)
+struct tcb *tcp;
+{
+ return 0;
+}
+
+int
+sys_getpgid(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu", tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+int
+sys_setpgid(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, %lu", tcp->u_arg[0], tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+void
+fake_execve(tcp, program, argv, envp)
+struct tcb *tcp;
+char *program;
+char *argv[];
+char *envp[];
+{
+ int i;
+
+#ifdef ARM
+ if (!(qual_flags[SYS_execve - __NR_SYSCALL_BASE] & QUAL_TRACE))
+ return;
+#else
+ if (!(qual_flags[SYS_execve] & QUAL_TRACE))
+ return;
+#endif /* !ARM */
+ printleader(tcp);
+ tprintf("execve(");
+ string_quote(program);
+ tprintf(", [");
+ for (i = 0; argv[i] != NULL; i++) {
+ if (i != 0)
+ tprintf(", ");
+ string_quote(argv[i]);
+ }
+ for (i = 0; envp[i] != NULL; i++)
+ ;
+ tprintf("], [/* %d var%s */]) ", i, (i != 1) ? "s" : "");
+ tabto(acolumn);
+ tprintf("= 0");
+ printtrailer(tcp);
+}
+
+static void
+printargv(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ char *cp;
+ char *sep;
+ int max = max_strlen / 2;
+
+ for (sep = ""; --max >= 0; sep = ", ") {
+ if (!abbrev(tcp))
+ max++;
+ if (umove(tcp, addr, &cp) < 0) {
+ tprintf("%#lx", addr);
+ return;
+ }
+ if (cp == 0)
+ break;
+ tprintf(sep);
+ printstr(tcp, (long) cp, -1);
+ addr += sizeof(char *);
+ }
+ if (cp)
+ tprintf(", ...");
+}
+
+static void
+printargc(fmt, tcp, addr)
+char *fmt;
+struct tcb *tcp;
+long addr;
+{
+ int count;
+ char *cp;
+
+ for (count = 0; umove(tcp, addr, &cp) >= 0 && cp != NULL; count++) {
+ addr += sizeof(char *);
+ }
+ tprintf(fmt, count, count == 1 ? "" : "s");
+}
+
+int
+sys_execv(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ if (!verbose(tcp))
+ tprintf(", %#lx", tcp->u_arg[1]);
+#if 0
+ else if (abbrev(tcp))
+ printargc(", [/* %d arg%s */]", tcp, tcp->u_arg[1]);
+#endif
+ else {
+ tprintf(", [");
+ printargv(tcp, tcp->u_arg[1]);
+ tprintf("]");
+ }
+ }
+ return 0;
+}
+
+int
+sys_execve(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ if (!verbose(tcp))
+ tprintf(", %#lx", tcp->u_arg[1]);
+#if 0
+ else if (abbrev(tcp))
+ printargc(", [/* %d arg%s */]", tcp, tcp->u_arg[1]);
+#endif
+ else {
+ tprintf(", [");
+ printargv(tcp, tcp->u_arg[1]);
+ tprintf("]");
+ }
+ if (!verbose(tcp))
+ tprintf(", %#lx", tcp->u_arg[2]);
+ else if (abbrev(tcp))
+ printargc(", [/* %d var%s */]", tcp, tcp->u_arg[2]);
+ else {
+ tprintf(", [");
+ printargv(tcp, tcp->u_arg[2]);
+ tprintf("]");
+ }
+ }
+#ifdef LINUX
+#if defined(ALPHA) || defined(SPARC) || defined(POWERPC)
+ tcp->flags |= TCB_WAITEXECVE;
+#endif /* ALPHA || SPARC || POWERPC */
+#endif /* LINUX */
+ return 0;
+}
+
+int
+internal_exec(tcp)
+struct tcb *tcp;
+{
+#ifdef SUNOS4
+ if (exiting(tcp) && !syserror(tcp) && followfork)
+ fixvfork(tcp);
+#endif /* SUNOS4 */
+ return 0;
+}
+
+#ifdef LINUX
+#ifndef __WCLONE
+#define __WCLONE 0x8000000
+#endif
+#endif /* LINUX */
+
+static struct xlat wait4_options[] = {
+ { WNOHANG, "WNOHANG" },
+#ifndef WSTOPPED
+ { WUNTRACED, "WUNTRACED" },
+#endif
+#ifdef WEXITED
+ { WEXITED, "WEXITED" },
+#endif
+#ifdef WTRAPPED
+ { WTRAPPED, "WTRAPPED" },
+#endif
+#ifdef WSTOPPED
+ { WSTOPPED, "WSTOPPED" },
+#endif
+#ifdef WCONTINUED
+ { WCONTINUED, "WCONTINUED" },
+#endif
+#ifdef WNOWAIT
+ { WNOWAIT, "WNOWAIT" },
+#endif
+#ifdef __WCLONE
+ { __WCLONE, "__WCLONE" },
+#endif
+ { 0, NULL },
+};
+
+static int
+printstatus(status)
+int status;
+{
+ int exited = 0;
+
+ /*
+ * Here is a tricky presentation problem. This solution
+ * is still not entirely satisfactory but since there
+ * are no wait status constructors it will have to do.
+ */
+ if (WIFSTOPPED(status))
+ tprintf("[WIFSTOPPED(s) && WSTOPSIG(s) == %s]",
+ signalent[WSTOPSIG(status)]);
+ else if WIFSIGNALED(status)
+ tprintf("[WIFSIGNALED(s) && WTERMSIG(s) == %s%s]",
+ signalent[WTERMSIG(status)],
+ WCOREDUMP(status) ? " && WCOREDUMP(s)" : "");
+ else if WIFEXITED(status) {
+ tprintf("[WIFEXITED(s) && WEXITSTATUS(s) == %d]",
+ WEXITSTATUS(status));
+ exited = 1;
+ }
+ else
+ tprintf("[%#x]", status);
+ return exited;
+}
+
+static int
+printwaitn(tcp, n)
+struct tcb *tcp;
+int n;
+{
+ int status;
+ int exited = 0;
+
+ if (entering(tcp)) {
+ tprintf("%ld, ", tcp->u_arg[0]);
+ } else {
+ /* status */
+ if (!tcp->u_arg[1])
+ tprintf("NULL");
+ else if (syserror(tcp) || tcp->u_rval == 0)
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umove(tcp, tcp->u_arg[1], &status) < 0)
+ tprintf("[?]");
+ else
+ exited = printstatus(status);
+ /* options */
+ tprintf(", ");
+ if (!printflags(wait4_options, tcp->u_arg[2]))
+ tprintf("0");
+ if (n == 4) {
+ tprintf(", ");
+ /* usage */
+ if (!tcp->u_arg[3])
+ tprintf("NULL");
+#ifdef LINUX
+ else if (tcp->u_rval > 0)
+ printrusage(tcp, tcp->u_arg[3]);
+#endif /* LINUX */
+#ifdef SUNOS4
+ else if (tcp->u_rval > 0 && exited)
+ printrusage(tcp, tcp->u_arg[3]);
+#endif /* SUNOS4 */
+ else
+ tprintf("%#lx", tcp->u_arg[3]);
+ }
+ }
+ return 0;
+}
+
+int
+internal_wait(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+/* WTA: fix bug with hanging children */
+ if (!(tcp->u_arg[2] & WNOHANG) && tcp->nchildren > 0) {
+ /* There are traced children */
+ tcp->flags |= TCB_SUSPENDED;
+ tcp->waitpid = tcp->u_arg[0];
+ }
+ }
+ return 0;
+}
+
+#ifdef SVR4
+
+int
+sys_wait(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ /* The library wrapper stuffs this into the user variable. */
+ if (!syserror(tcp))
+ printstatus(getrval2(tcp));
+ }
+ return 0;
+}
+
+#endif /* SVR4 */
+
+int
+sys_waitpid(tcp)
+struct tcb *tcp;
+{
+ return printwaitn(tcp, 3);
+}
+
+int
+sys_wait4(tcp)
+struct tcb *tcp;
+{
+ return printwaitn(tcp, 4);
+}
+
+#ifdef SVR4
+
+static struct xlat waitid_types[] = {
+ { P_PID, "P_PID" },
+ { P_PPID, "P_PPID" },
+ { P_PGID, "P_PGID" },
+ { P_SID, "P_SID" },
+ { P_CID, "P_CID" },
+ { P_UID, "P_UID" },
+ { P_GID, "P_GID" },
+ { P_ALL, "P_ALL" },
+#ifdef P_LWPID
+ { P_LWPID, "P_LWPID" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat siginfo_codes[] = {
+#ifdef SI_NOINFO
+ { SI_NOINFO, "SI_NOINFO" },
+#endif
+#ifdef SI_USER
+ { SI_USER, "SI_USER" },
+#endif
+#ifdef SI_LWP
+ { SI_LWP, "SI_LWP" },
+#endif
+#ifdef SI_QUEUE
+ { SI_QUEUE, "SI_QUEUE" },
+#endif
+#ifdef SI_TIMER
+ { SI_TIMER, "SI_TIMER" },
+#endif
+#ifdef SI_ASYNCIO
+ { SI_ASYNCIO, "SI_ASYNCIO" },
+#endif
+#ifdef SI_MESGQ
+ { SI_MESGQ, "SI_MESGQ" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat sigtrap_codes[] = {
+ { TRAP_BRKPT, "TRAP_BRKPT" },
+ { TRAP_TRACE, "TRAP_TRACE" },
+ { 0, NULL },
+};
+
+static struct xlat sigcld_codes[] = {
+ { CLD_EXITED, "CLD_EXITED" },
+ { CLD_KILLED, "CLD_KILLED" },
+ { CLD_DUMPED, "CLD_DUMPED" },
+ { CLD_TRAPPED, "CLD_TRAPPED" },
+ { CLD_STOPPED, "CLD_STOPPED" },
+ { CLD_CONTINUED,"CLD_CONTINUED" },
+ { 0, NULL },
+};
+
+static struct xlat sigpoll_codes[] = {
+ { POLL_IN, "POLL_IN" },
+ { POLL_OUT, "POLL_OUT" },
+ { POLL_MSG, "POLL_MSG" },
+ { POLL_ERR, "POLL_ERR" },
+ { POLL_PRI, "POLL_PRI" },
+ { POLL_HUP, "POLL_HUP" },
+ { 0, NULL },
+};
+
+static struct xlat sigprof_codes[] = {
+#ifdef PROF_SIG
+ { PROF_SIG, "PROF_SIG" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat sigill_codes[] = {
+ { ILL_ILLOPC, "ILL_ILLOPC" },
+ { ILL_ILLOPN, "ILL_ILLOPN" },
+ { ILL_ILLADR, "ILL_ILLADR" },
+ { ILL_ILLTRP, "ILL_ILLTRP" },
+ { ILL_PRVOPC, "ILL_PRVOPC" },
+ { ILL_PRVREG, "ILL_PRVREG" },
+ { ILL_COPROC, "ILL_COPROC" },
+ { ILL_BADSTK, "ILL_BADSTK" },
+ { 0, NULL },
+};
+
+static struct xlat sigemt_codes[] = {
+#ifdef EMT_TAGOVF
+ { EMT_TAGOVF, "EMT_TAGOVF" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat sigfpe_codes[] = {
+ { FPE_INTDIV, "FPE_INTDIV" },
+ { FPE_INTOVF, "FPE_INTOVF" },
+ { FPE_FLTDIV, "FPE_FLTDIV" },
+ { FPE_FLTOVF, "FPE_FLTOVF" },
+ { FPE_FLTUND, "FPE_FLTUND" },
+ { FPE_FLTRES, "FPE_FLTRES" },
+ { FPE_FLTINV, "FPE_FLTINV" },
+ { FPE_FLTSUB, "FPE_FLTSUB" },
+ { 0, NULL },
+};
+
+static struct xlat sigsegv_codes[] = {
+ { SEGV_MAPERR, "SEGV_MAPERR" },
+ { SEGV_ACCERR, "SEGV_ACCERR" },
+ { 0, NULL },
+};
+
+static struct xlat sigbus_codes[] = {
+ { BUS_ADRALN, "BUS_ADRALN" },
+ { BUS_ADRERR, "BUS_ADRERR" },
+ { BUS_OBJERR, "BUS_OBJERR" },
+ { 0, NULL },
+};
+
+void
+printsiginfo(sip)
+siginfo_t *sip;
+{
+ char *code;
+
+ tprintf("{si_signo=");
+ printsignal(sip->si_signo);
+ code = xlookup(siginfo_codes, sip->si_code);
+ if (!code) {
+ switch (sip->si_signo) {
+ case SIGTRAP:
+ code = xlookup(sigtrap_codes, sip->si_code);
+ break;
+ case SIGCHLD:
+ code = xlookup(sigcld_codes, sip->si_code);
+ break;
+ case SIGPOLL:
+ code = xlookup(sigpoll_codes, sip->si_code);
+ break;
+ case SIGPROF:
+ code = xlookup(sigprof_codes, sip->si_code);
+ break;
+ case SIGILL:
+ code = xlookup(sigill_codes, sip->si_code);
+ break;
+ case SIGEMT:
+ code = xlookup(sigemt_codes, sip->si_code);
+ break;
+ case SIGFPE:
+ code = xlookup(sigfpe_codes, sip->si_code);
+ break;
+ case SIGSEGV:
+ code = xlookup(sigsegv_codes, sip->si_code);
+ break;
+ case SIGBUS:
+ code = xlookup(sigbus_codes, sip->si_code);
+ break;
+ }
+ }
+ if (code)
+ tprintf(", si_code=%s", code);
+ else
+ tprintf(", si_code=%#x", sip->si_code);
+#ifdef SI_NOINFO
+ if (sip->si_code != SI_NOINFO) {
+#endif
+ if (sip->si_errno) {
+ if (sip->si_errno < 0 || sip->si_errno >= nerrnos)
+ tprintf(", si_errno=%d", sip->si_errno);
+ else
+ tprintf(", si_errno=%s",
+ errnoent[sip->si_errno]);
+ }
+ if (SI_FROMUSER(sip)) {
+#ifdef SI_QUEUE
+ tprintf(", si_pid=%ld, si_uid=%ld",
+ sip->si_pid, sip->si_uid);
+ switch (sip->si_code) {
+ case SI_QUEUE:
+#ifdef SI_TIMER
+ case SI_TIMER:
+#endif /* SI_QUEUE */
+ case SI_ASYNCIO:
+#ifdef SI_MESGQ
+ case SI_MESGQ:
+#endif /* SI_MESGQ */
+ tprintf(", si_value=%d",
+ sip->si_value.sival_int);
+ break;
+ }
+#endif /* SI_QUEUE */
+ }
+ else {
+ switch (sip->si_signo) {
+ case SIGCHLD:
+ tprintf(", si_pid=%ld, si_status=",
+ sip->si_pid);
+ if (sip->si_code == CLD_EXITED)
+ tprintf("%d", sip->si_status);
+ else
+ printsignal(sip->si_status);
+ break;
+ case SIGILL: case SIGFPE:
+ case SIGSEGV: case SIGBUS:
+ tprintf(", si_addr=%#lx",
+ (unsigned long) sip->si_addr);
+ break;
+ case SIGPOLL:
+ switch (sip->si_code) {
+ case POLL_IN: case POLL_OUT: case POLL_MSG:
+ tprintf(", si_band=%ld",
+ (long) sip->si_band);
+ break;
+ }
+ break;
+ }
+ }
+ tprintf(", ...");
+#ifdef SI_NOINFO
+ }
+#endif
+ tprintf("}");
+}
+
+int
+sys_waitid(tcp)
+struct tcb *tcp;
+{
+ siginfo_t si;
+ int exited;
+
+ if (entering(tcp)) {
+ printxval(waitid_types, tcp->u_arg[0], "P_???");
+ tprintf(", %ld, ", tcp->u_arg[1]);
+ if (tcp->nchildren > 0) {
+ /* There are traced children */
+ tcp->flags |= TCB_SUSPENDED;
+ tcp->waitpid = tcp->u_arg[0];
+ }
+ }
+ else {
+ /* siginfo */
+ exited = 0;
+ if (!tcp->u_arg[2])
+ tprintf("NULL");
+ else if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[2]);
+ else if (umove(tcp, tcp->u_arg[2], &si) < 0)
+ tprintf("{???}");
+ else
+ printsiginfo(&si);
+ /* options */
+ tprintf(", ");
+ if (!printflags(wait4_options, tcp->u_arg[3]))
+ tprintf("0");
+ }
+ return 0;
+}
+
+#endif /* SVR4 */
+
+int
+sys_alarm(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ tprintf("%lu", tcp->u_arg[0]);
+ return 0;
+}
+
+int
+sys_uname(tcp)
+struct tcb *tcp;
+{
+ struct utsname uname;
+
+ if (exiting(tcp)) {
+ if (syserror(tcp) || !verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else if (umove(tcp, tcp->u_arg[0], &uname) < 0)
+ tprintf("{...}");
+ else if (!abbrev(tcp)) {
+
+ tprintf("{sysname=\"%s\", nodename=\"%s\", ",
+ uname.sysname, uname.nodename);
+ tprintf("release=\"%s\", version=\"%s\", ",
+ uname.release, uname.version);
+ tprintf("machine=\"%s\"", uname.machine);
+#ifdef LINUX
+#ifndef __GLIBC__
+ tprintf(", domainname=\"%s\"", uname.domainname);
+#endif /* __GLIBC__ */
+#endif /* LINUX */
+ tprintf("}");
+ }
+ else
+ tprintf("{sys=\"%s\", node=\"%s\", ...}",
+ uname.sysname, uname.nodename);
+ }
+ return 0;
+}
+
+#ifndef SVR4
+
+static struct xlat ptrace_cmds[] = {
+ { PTRACE_TRACEME, "PTRACE_TRACEME" },
+ { PTRACE_PEEKTEXT, "PTRACE_PEEKTEXT", },
+ { PTRACE_PEEKDATA, "PTRACE_PEEKDATA", },
+ { PTRACE_PEEKUSER, "PTRACE_PEEKUSER", },
+ { PTRACE_POKETEXT, "PTRACE_POKETEXT", },
+ { PTRACE_POKEDATA, "PTRACE_POKEDATA", },
+ { PTRACE_POKEUSER, "PTRACE_POKEUSER", },
+ { PTRACE_CONT, "PTRACE_CONT" },
+ { PTRACE_KILL, "PTRACE_KILL" },
+ { PTRACE_SINGLESTEP, "PTRACE_SINGLESTEP" },
+ { PTRACE_ATTACH, "PTRACE_ATTACH" },
+ { PTRACE_DETACH, "PTRACE_DETACH" },
+#ifdef SUNOS4
+ { PTRACE_GETREGS, "PTRACE_GETREGS" },
+ { PTRACE_SETREGS, "PTRACE_SETREGS" },
+ { PTRACE_GETFPREGS, "PTRACE_GETFPREGS", },
+ { PTRACE_SETFPREGS, "PTRACE_SETFPREGS", },
+ { PTRACE_READDATA, "PTRACE_READDATA" },
+ { PTRACE_WRITEDATA, "PTRACE_WRITEDATA" },
+ { PTRACE_READTEXT, "PTRACE_READTEXT" },
+ { PTRACE_WRITETEXT, "PTRACE_WRITETEXT" },
+ { PTRACE_GETFPAREGS, "PTRACE_GETFPAREGS" },
+ { PTRACE_SETFPAREGS, "PTRACE_SETFPAREGS" },
+#ifdef SPARC
+ { PTRACE_GETWINDOW, "PTRACE_GETWINDOW" },
+ { PTRACE_SETWINDOW, "PTRACE_SETWINDOW" },
+#else /* !SPARC */
+ { PTRACE_22, "PTRACE_PTRACE_22" },
+ { PTRACE_23, "PTRACE_PTRACE_23" },
+#endif /* !SPARC */
+#endif /* SUNOS4 */
+ { PTRACE_SYSCALL, "PTRACE_SYSCALL" },
+#ifdef SUNOS4
+ { PTRACE_DUMPCORE, "PTRACE_DUMPCORE" },
+#ifdef I386
+ { PTRACE_SETWRBKPT, "PTRACE_SETWRBKPT" },
+ { PTRACE_SETACBKPT, "PTRACE_SETACBKPT" },
+ { PTRACE_CLRDR7, "PTRACE_CLRDR7" },
+#else /* !I386 */
+ { PTRACE_26, "PTRACE_26" },
+ { PTRACE_27, "PTRACE_27" },
+ { PTRACE_28, "PTRACE_28" },
+#endif /* !I386 */
+ { PTRACE_GETUCODE, "PTRACE_GETUCODE" },
+#endif /* SUNOS4 */
+ { 0, NULL },
+};
+
+#ifndef SUNOS4_KERNEL_ARCH_KLUDGE
+static
+#endif /* !SUNOS4_KERNEL_ARCH_KLUDGE */
+struct xlat struct_user_offsets[] = {
+#ifdef LINUX
+#ifdef SPARC
+ /* XXX No support for these offsets yet. */
+#elif defined(POWERPC)
+ { 4*PT_R0, "4*PT_R0" },
+ { 4*PT_R1, "4*PT_R1" },
+ { 4*PT_R2, "4*PT_R2" },
+ { 4*PT_R3, "4*PT_R3" },
+ { 4*PT_R4, "4*PT_R4" },
+ { 4*PT_R5, "4*PT_R5" },
+ { 4*PT_R6, "4*PT_R6" },
+ { 4*PT_R7, "4*PT_R7" },
+ { 4*PT_R8, "4*PT_R8" },
+ { 4*PT_R9, "4*PT_R9" },
+ { 4*PT_R10, "4*PT_R10" },
+ { 4*PT_R11, "4*PT_R11" },
+ { 4*PT_R12, "4*PT_R12" },
+ { 4*PT_R13, "4*PT_R13" },
+ { 4*PT_R14, "4*PT_R14" },
+ { 4*PT_R15, "4*PT_R15" },
+ { 4*PT_R16, "4*PT_R16" },
+ { 4*PT_R17, "4*PT_R17" },
+ { 4*PT_R18, "4*PT_R18" },
+ { 4*PT_R19, "4*PT_R19" },
+ { 4*PT_R20, "4*PT_R20" },
+ { 4*PT_R21, "4*PT_R21" },
+ { 4*PT_R22, "4*PT_R22" },
+ { 4*PT_R23, "4*PT_R23" },
+ { 4*PT_R24, "4*PT_R24" },
+ { 4*PT_R25, "4*PT_R25" },
+ { 4*PT_R26, "4*PT_R26" },
+ { 4*PT_R27, "4*PT_R27" },
+ { 4*PT_R28, "4*PT_R28" },
+ { 4*PT_R29, "4*PT_R29" },
+ { 4*PT_R30, "4*PT_R30" },
+ { 4*PT_R31, "4*PT_R31" },
+ { 4*PT_NIP, "4*PT_NIP" },
+ { 4*PT_MSR, "4*PT_MSR" },
+ { 4*PT_ORIG_R3, "4*PT_ORIG_R3" },
+ { 4*PT_CTR, "4*PT_CTR" },
+ { 4*PT_LNK, "4*PT_LNK" },
+ { 4*PT_XER, "4*PT_XER" },
+ { 4*PT_CCR, "4*PT_CCR" },
+ { 4*PT_FPR0, "4*PT_FPR0" },
+#else
+#ifdef ALPHA
+ { 0, "r0" },
+ { 1, "r1" },
+ { 2, "r2" },
+ { 3, "r3" },
+ { 4, "r4" },
+ { 5, "r5" },
+ { 6, "r6" },
+ { 7, "r7" },
+ { 8, "r8" },
+ { 9, "r9" },
+ { 10, "r10" },
+ { 11, "r11" },
+ { 12, "r12" },
+ { 13, "r13" },
+ { 14, "r14" },
+ { 15, "r15" },
+ { 16, "r16" },
+ { 17, "r17" },
+ { 18, "r18" },
+ { 19, "r19" },
+ { 20, "r20" },
+ { 21, "r21" },
+ { 22, "r22" },
+ { 23, "r23" },
+ { 24, "r24" },
+ { 25, "r25" },
+ { 26, "r26" },
+ { 27, "r27" },
+ { 28, "r28" },
+ { 29, "gp" },
+ { 30, "fp" },
+ { 31, "zero" },
+ { 32, "fp0" },
+ { 33, "fp" },
+ { 34, "fp2" },
+ { 35, "fp3" },
+ { 36, "fp4" },
+ { 37, "fp5" },
+ { 38, "fp6" },
+ { 39, "fp7" },
+ { 40, "fp8" },
+ { 41, "fp9" },
+ { 42, "fp10" },
+ { 43, "fp11" },
+ { 44, "fp12" },
+ { 45, "fp13" },
+ { 46, "fp14" },
+ { 47, "fp15" },
+ { 48, "fp16" },
+ { 49, "fp17" },
+ { 50, "fp18" },
+ { 51, "fp19" },
+ { 52, "fp20" },
+ { 53, "fp21" },
+ { 54, "fp22" },
+ { 55, "fp23" },
+ { 56, "fp24" },
+ { 57, "fp25" },
+ { 58, "fp26" },
+ { 59, "fp27" },
+ { 60, "fp28" },
+ { 61, "fp29" },
+ { 62, "fp30" },
+ { 63, "fp31" },
+ { 64, "pc" },
+#else /* !ALPHA */
+#ifdef I386
+ { 4*EBX, "4*EBX" },
+ { 4*ECX, "4*ECX" },
+ { 4*EDX, "4*EDX" },
+ { 4*ESI, "4*ESI" },
+ { 4*EDI, "4*EDI" },
+ { 4*EBP, "4*EBP" },
+ { 4*EAX, "4*EAX" },
+ { 4*DS, "4*DS" },
+ { 4*ES, "4*ES" },
+ { 4*FS, "4*FS" },
+ { 4*GS, "4*GS" },
+ { 4*ORIG_EAX, "4*ORIG_EAX" },
+ { 4*EIP, "4*EIP" },
+ { 4*CS, "4*CS" },
+ { 4*EFL, "4*EFL" },
+ { 4*UESP, "4*UESP" },
+ { 4*SS, "4*SS" },
+#else /* !I386 */
+#ifdef M68K
+ { 4*PT_D1, "4*PT_D1" },
+ { 4*PT_D2, "4*PT_D2" },
+ { 4*PT_D3, "4*PT_D3" },
+ { 4*PT_D4, "4*PT_D4" },
+ { 4*PT_D5, "4*PT_D5" },
+ { 4*PT_D6, "4*PT_D6" },
+ { 4*PT_D7, "4*PT_D7" },
+ { 4*PT_A0, "4*PT_A0" },
+ { 4*PT_A1, "4*PT_A1" },
+ { 4*PT_A2, "4*PT_A2" },
+ { 4*PT_A3, "4*PT_A3" },
+ { 4*PT_A4, "4*PT_A4" },
+ { 4*PT_A5, "4*PT_A5" },
+ { 4*PT_A6, "4*PT_A6" },
+ { 4*PT_D0, "4*PT_D0" },
+ { 4*PT_USP, "4*PT_USP" },
+ { 4*PT_ORIG_D0, "4*PT_ORIG_D0" },
+ { 4*PT_SR, "4*PT_SR" },
+ { 4*PT_PC, "4*PT_PC" },
+#endif /* M68K */
+#endif /* !I386 */
+ { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
+#ifdef I386
+ { uoff(i387), "offsetof(struct user, i387)" },
+#else /* !I386 */
+#ifdef M68K
+ { uoff(m68kfp), "offsetof(struct user, m68kfp)" },
+#endif /* M68K */
+#endif /* !I386 */
+ { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
+ { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
+ { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
+ { uoff(start_code), "offsetof(struct user, start_code)" },
+ { uoff(start_stack), "offsetof(struct user, start_stack)" },
+ { uoff(signal), "offsetof(struct user, signal)" },
+ { uoff(reserved), "offsetof(struct user, reserved)" },
+ { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
+#ifndef ARM
+ { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
+#endif
+ { uoff(magic), "offsetof(struct user, magic)" },
+ { uoff(u_comm), "offsetof(struct user, u_comm)" },
+#ifdef I386
+ { uoff(u_debugreg), "offsetof(struct user, u_debugreg)" },
+#endif /* I386 */
+#endif /* !ALPHA */
+#endif /* !POWERPC/!SPARC */
+#endif /* LINUX */
+#ifdef SUNOS4
+ { uoff(u_pcb), "offsetof(struct user, u_pcb)" },
+ { uoff(u_procp), "offsetof(struct user, u_procp)" },
+ { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
+ { uoff(u_comm[0]), "offsetof(struct user, u_comm[0])" },
+ { uoff(u_arg[0]), "offsetof(struct user, u_arg[0])" },
+ { uoff(u_ap), "offsetof(struct user, u_ap)" },
+ { uoff(u_qsave), "offsetof(struct user, u_qsave)" },
+ { uoff(u_rval1), "offsetof(struct user, u_rval1)" },
+ { uoff(u_rval2), "offsetof(struct user, u_rval2)" },
+ { uoff(u_error), "offsetof(struct user, u_error)" },
+ { uoff(u_eosys), "offsetof(struct user, u_eosys)" },
+ { uoff(u_ssave), "offsetof(struct user, u_ssave)" },
+ { uoff(u_signal[0]), "offsetof(struct user, u_signal)" },
+ { uoff(u_sigmask[0]), "offsetof(struct user, u_sigmask)" },
+ { uoff(u_sigonstack), "offsetof(struct user, u_sigonstack)" },
+ { uoff(u_sigintr), "offsetof(struct user, u_sigintr)" },
+ { uoff(u_sigreset), "offsetof(struct user, u_sigreset)" },
+ { uoff(u_oldmask), "offsetof(struct user, u_oldmask)" },
+ { uoff(u_code), "offsetof(struct user, u_code)" },
+ { uoff(u_addr), "offsetof(struct user, u_addr)" },
+ { uoff(u_sigstack), "offsetof(struct user, u_sigstack)" },
+ { uoff(u_ofile), "offsetof(struct user, u_ofile)" },
+ { uoff(u_pofile), "offsetof(struct user, u_pofile)" },
+ { uoff(u_ofile_arr[0]), "offsetof(struct user, u_ofile_arr[0])" },
+ { uoff(u_pofile_arr[0]),"offsetof(struct user, u_pofile_arr[0])"},
+ { uoff(u_lastfile), "offsetof(struct user, u_lastfile)" },
+ { uoff(u_cwd), "offsetof(struct user, u_cwd)" },
+ { uoff(u_cdir), "offsetof(struct user, u_cdir)" },
+ { uoff(u_rdir), "offsetof(struct user, u_rdir)" },
+ { uoff(u_cmask), "offsetof(struct user, u_cmask)" },
+ { uoff(u_ru), "offsetof(struct user, u_ru)" },
+ { uoff(u_cru), "offsetof(struct user, u_cru)" },
+ { uoff(u_timer[0]), "offsetof(struct user, u_timer[0])" },
+ { uoff(u_XXX[0]), "offsetof(struct user, u_XXX[0])" },
+ { uoff(u_ioch), "offsetof(struct user, u_ioch)" },
+ { uoff(u_start), "offsetof(struct user, u_start)" },
+ { uoff(u_acflag), "offsetof(struct user, u_acflag)" },
+ { uoff(u_prof.pr_base), "offsetof(struct user, u_prof.pr_base)" },
+ { uoff(u_prof.pr_size), "offsetof(struct user, u_prof.pr_size)" },
+ { uoff(u_prof.pr_off), "offsetof(struct user, u_prof.pr_off)" },
+ { uoff(u_prof.pr_scale),"offsetof(struct user, u_prof.pr_scale)"},
+ { uoff(u_rlimit[0]), "offsetof(struct user, u_rlimit)" },
+ { uoff(u_exdata.Ux_A), "offsetof(struct user, u_exdata.Ux_A)" },
+ { uoff(u_exdata.ux_shell[0]),"offsetof(struct user, u_exdata.ux_shell[0])"},
+ { uoff(u_lofault), "offsetof(struct user, u_lofault)" },
+#endif /* SUNOS4 */
+ { sizeof(struct user), "sizeof(struct user)" },
+ { 0, NULL },
+};
+
+int
+sys_ptrace(tcp)
+struct tcb *tcp;
+{
+ char *cmd;
+ struct xlat *x;
+ long addr;
+
+ cmd = xlookup(ptrace_cmds, tcp->u_arg[0]);
+ if (!cmd)
+ cmd = "PTRACE_???";
+ if (entering(tcp)) {
+ tprintf("%s, %lu, ", cmd, tcp->u_arg[1]);
+ addr = tcp->u_arg[2];
+ if (tcp->u_arg[0] == PTRACE_PEEKUSER
+ || tcp->u_arg[0] == PTRACE_POKEUSER) {
+ for (x = struct_user_offsets; x->str; x++) {
+ if (x->val >= addr)
+ break;
+ }
+ if (!x->str)
+ tprintf("%#lx, ", addr);
+ else if (x->val > addr && x != struct_user_offsets) {
+ x--;
+ tprintf("%s + %ld, ", x->str, addr - x->val);
+ }
+ else
+ tprintf("%s, ", x->str);
+ }
+ else
+ tprintf("%#lx, ", tcp->u_arg[2]);
+#ifdef LINUX
+ switch (tcp->u_arg[0]) {
+ case PTRACE_PEEKDATA:
+ case PTRACE_PEEKTEXT:
+ case PTRACE_PEEKUSER:
+ break;
+ case PTRACE_CONT:
+ case PTRACE_SINGLESTEP:
+ case PTRACE_SYSCALL:
+ case PTRACE_DETACH:
+ printsignal(tcp->u_arg[3]);
+ break;
+ default:
+ tprintf("%#lx", tcp->u_arg[3]);
+ break;
+ }
+ } else {
+ switch (tcp->u_arg[0]) {
+ case PTRACE_PEEKDATA:
+ case PTRACE_PEEKTEXT:
+ case PTRACE_PEEKUSER:
+ printnum(tcp, tcp->u_arg[3], "%#x");
+ break;
+ }
+ }
+#endif /* LINUX */
+#ifdef SUNOS4
+ if (tcp->u_arg[0] == PTRACE_WRITEDATA ||
+ tcp->u_arg[0] == PTRACE_WRITETEXT) {
+ tprintf("%lu, ", tcp->u_arg[3]);
+ printstr(tcp, tcp->u_arg[4], tcp->u_arg[3]);
+ } else if (tcp->u_arg[0] != PTRACE_READDATA &&
+ tcp->u_arg[0] != PTRACE_READTEXT) {
+ tprintf("%#lx", tcp->u_arg[3]);
+ }
+ } else {
+ if (tcp->u_arg[0] == PTRACE_READDATA ||
+ tcp->u_arg[0] == PTRACE_READTEXT) {
+ tprintf("%lu, ", tcp->u_arg[3]);
+ printstr(tcp, tcp->u_arg[4], tcp->u_arg[3]);
+ }
+ }
+#endif /* SUNOS4 */
+ return 0;
+}
+
+#endif /* !SVR4 */
diff --git a/resource.c b/resource.c
new file mode 100644
index 000000000..cb63214f4
--- /dev/null
+++ b/resource.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <sys/resource.h>
+#ifdef LINUX
+#include <sys/times.h>
+#include <linux/kernel.h>
+#endif /* LINUX */
+#ifdef SUNOS4
+#include <ufs/quota.h>
+#endif /* SUNOS4 */
+#ifdef SVR4
+#include <sys/times.h>
+#include <sys/time.h>
+#endif
+
+static struct xlat resources[] = {
+#ifdef RLIMIT_CPU
+ { RLIMIT_CPU, "RLIMIT_CPU" },
+#endif
+#ifdef RLIMIT_FSIZE
+ { RLIMIT_FSIZE, "RLIMIT_FSIZE" },
+#endif
+#ifdef RLIMIT_DATA
+ { RLIMIT_DATA, "RLIMIT_DATA" },
+#endif
+#ifdef RLIMIT_STACK
+ { RLIMIT_STACK, "RLIMIT_STACK" },
+#endif
+#ifdef RLIMIT_CORE
+ { RLIMIT_CORE, "RLIMIT_CORE" },
+#endif
+#ifdef RLIMIT_RSS
+ { RLIMIT_RSS, "RLIMIT_RSS" },
+#endif
+#ifdef RLIMIT_NOFILE
+ { RLIMIT_NOFILE,"RLIMIT_NOFILE" },
+#endif
+#ifdef RLIMIT_VMEM
+ { RLIMIT_VMEM, "RLIMIT_VMEM" },
+#endif
+#ifdef RLIMIT_AS
+ { RLIMIT_AS, "RLIMIT_AS" },
+#endif
+ { 0, NULL },
+};
+
+static char *
+sprintrlim(lim)
+long lim;
+{
+ static char buf[32];
+
+ if (lim == RLIM_INFINITY)
+ sprintf(buf, "RLIM_INFINITY");
+ else if (lim > 1024 && lim%1024 == 0)
+ sprintf(buf, "%ld*1024", lim/1024);
+ else
+ sprintf(buf, "%ld", lim);
+ return buf;
+}
+
+int
+sys_getrlimit(tcp)
+struct tcb *tcp;
+{
+ struct rlimit rlim;
+
+ if (entering(tcp)) {
+ printxval(resources, tcp->u_arg[0], "RLIMIT_???");
+ tprintf(", ");
+ }
+ else {
+ if (syserror(tcp) || !verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umove(tcp, tcp->u_arg[1], &rlim) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{rlim_cur=%s,", sprintrlim(rlim.rlim_cur));
+ tprintf(" rlim_max=%s}", sprintrlim(rlim.rlim_max));
+ }
+ }
+ return 0;
+}
+
+int
+sys_setrlimit(tcp)
+struct tcb *tcp;
+{
+ struct rlimit rlim;
+
+ if (entering(tcp)) {
+ printxval(resources, tcp->u_arg[0], "RLIMIT_???");
+ tprintf(", ");
+ if (!verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else if (umove(tcp, tcp->u_arg[1], &rlim) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{rlim_cur=%s,", sprintrlim(rlim.rlim_cur));
+ tprintf(" rlim_max=%s}", sprintrlim(rlim.rlim_max));
+ }
+ }
+ return 0;
+}
+
+#ifndef SVR4
+
+static struct xlat usagewho[] = {
+ { RUSAGE_SELF, "RUSAGE_SELF" },
+ { RUSAGE_CHILDREN, "RUSAGE_CHILDREN" },
+ { 0, NULL },
+};
+
+void
+printrusage(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ struct rusage ru;
+
+ if (!addr)
+ tprintf("NULL");
+ else if (syserror(tcp) || !verbose(tcp))
+ tprintf("%#lx", addr);
+ else if (umove(tcp, addr, &ru) < 0)
+ tprintf("{...}");
+ else if (!abbrev(tcp)) {
+ tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ",
+ (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
+ (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec);
+ tprintf("ru_maxrss=%lu, ru_ixrss=%lu, ",
+ ru.ru_maxrss, ru.ru_ixrss);
+ tprintf("ru_idrss=%lu, ru_isrss=%lu, ",
+ ru.ru_idrss, ru.ru_isrss);
+ tprintf("ru_minflt=%lu, ru_majflt=%lu, ru_nswap=%lu, ",
+ ru.ru_minflt, ru.ru_majflt, ru.ru_nswap);
+ tprintf("ru_inblock=%lu, ru_oublock=%lu, ",
+ ru.ru_inblock, ru.ru_oublock);
+ tprintf("ru_msgsnd=%lu, ru_msgrcv=%lu, ",
+ ru.ru_msgsnd, ru.ru_msgrcv);
+ tprintf("ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}",
+ ru.ru_nsignals, ru.ru_nvcsw, ru.ru_nivcsw);
+ }
+ else {
+ tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ...}",
+ (long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
+ (long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec);
+ }
+}
+
+int
+sys_getrusage(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
+ tprintf(", ");
+ }
+ else
+ printrusage(tcp, tcp->u_arg[1]);
+ return 0;
+}
+
+#endif /* !SVR4 */
+
+#ifdef LINUX
+
+int
+sys_sysinfo(tcp)
+struct tcb *tcp;
+{
+ struct sysinfo si;
+
+ if (exiting(tcp)) {
+ if (syserror(tcp) || !verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else if (umove(tcp, tcp->u_arg[0], &si) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{uptime=%lu, loads=[%lu, %lu, %lu] ",
+ si.uptime, si.loads[0], si.loads[1],
+ si.loads[2]);
+ tprintf("totalram=%lu, freeram=%lu, ",
+ si.totalram, si.freeram);
+ tprintf("sharedram=%lu, bufferram=%lu} ",
+ si.sharedram, si.bufferram);
+ tprintf("totalswap=%lu, freeswap=%lu, procs=%hu}",
+ si.totalswap, si.freeswap, si.procs);
+ }
+ }
+ return 0;
+}
+
+#endif /* LINUX */
+
+static struct xlat priorities[] = {
+ { PRIO_PROCESS, "PRIO_PROCESS" },
+ { PRIO_PGRP, "PRIO_PGRP" },
+ { PRIO_USER, "PRIO_USER" },
+ { 0, NULL },
+};
+
+int
+sys_getpriority(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(priorities, tcp->u_arg[0], "PRIO_???");
+ tprintf(", %lu", tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_setpriority(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(priorities, tcp->u_arg[0], "PRIO_???");
+ tprintf(", %lu, %ld", tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+int
+sys_nice(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ tprintf("%ld", tcp->u_arg[0]);
+ return 0;
+}
+
+#ifndef SUNOS4
+
+int
+sys_times(tcp)
+struct tcb *tcp;
+{
+ struct tms tbuf;
+
+ if (exiting(tcp)) {
+ if (tcp->u_arg[0] == 0)
+ tprintf("NULL");
+ else if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else if (umove(tcp, tcp->u_arg[0], &tbuf) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{tms_utime=%lu, tms_stime=%lu, ",
+ tbuf.tms_utime, tbuf.tms_stime);
+ tprintf("tms_cutime=%lu, tms_cstime=%lu}",
+ tbuf.tms_cutime, tbuf.tms_cstime);
+ }
+ }
+ return 0;
+}
+
+#endif /* !SUNOS4 */
+
+#ifdef SUNOS4
+
+static struct xlat quotacmds[] = {
+ { Q_QUOTAON, "Q_QUOTAON" },
+ { Q_QUOTAOFF, "Q_QUOTAOFF" },
+ { Q_GETQUOTA, "Q_GETQUOTA" },
+ { Q_SETQUOTA, "Q_SETQUOTA" },
+ { Q_SETQLIM, "Q_SETQLIM" },
+ { Q_SYNC, "Q_SYNC" },
+ { 0, NULL },
+};
+
+int
+sys_quotactl(tcp)
+struct tcb *tcp;
+{
+ /* fourth arg (addr) not interpreted here */
+ if (entering(tcp)) {
+ printxval(quotacmds, tcp->u_arg[0], "Q_???");
+ tprintf(", ");
+ printstr(tcp, tcp->u_arg[1], -1);
+ tprintf(", %lu, %#lx", tcp->u_arg[2], tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+#endif /* SUNOS4 */
diff --git a/signal.c b/signal.c
new file mode 100644
index 000000000..66f6b3f14
--- /dev/null
+++ b/signal.c
@@ -0,0 +1,1528 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+/* ugly hack to make header file do what I want - davidw */
+#ifdef __arm__
+#undef __USE_POSIX199309
+#endif
+
+#include <signal.h>
+#include <sys/user.h>
+#include <fcntl.h>
+#if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1
+# include <sys/reg.h>
+#endif
+
+#ifdef SVR4
+#include <sys/ucontext.h>
+#endif /* SVR4 */
+
+#ifdef LINUX
+#include <linux/ptrace.h>
+#ifdef HAVE_ASM_SIGCONTEXT_H
+#include <asm/sigcontext.h>
+#ifdef SPARC
+typedef struct {
+ struct pt_regs si_regs;
+ int si_mask;
+} m_siginfo_t;
+#endif
+#else /* !HAVE_ASM_SIGCONTEXT_H */
+#ifdef I386
+struct sigcontext_struct {
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned long edi;
+ unsigned long esi;
+ unsigned long ebp;
+ unsigned long esp;
+ unsigned long ebx;
+ unsigned long edx;
+ unsigned long ecx;
+ unsigned long eax;
+ unsigned long trapno;
+ unsigned long err;
+ unsigned long eip;
+ unsigned short cs, __csh;
+ unsigned long eflags;
+ unsigned long esp_at_signal;
+ unsigned short ss, __ssh;
+ unsigned long i387;
+ unsigned long oldmask;
+ unsigned long cr2;
+};
+#else /* !I386 */
+#ifdef M68K
+struct sigcontext_struct
+{
+ unsigned long sc_mask;
+ unsigned long sc_usp;
+ unsigned long sc_d0;
+ unsigned long sc_d1;
+ unsigned long sc_a0;
+ unsigned long sc_a1;
+ unsigned short sc_sr;
+ unsigned long sc_pc;
+ unsigned short sc_formatvec;
+};
+#endif /* M68K */
+#endif /* !I386 */
+#endif /* !HAVE_ASM_SIGCONTEXT_H */
+#ifndef NSIG
+#define NSIG 32
+#endif
+#ifdef ARM
+#undef NSIG
+#define NSIG 32
+#endif
+#endif /* LINUX */
+
+char *signalent0[] = {
+#include "signalent.h"
+};
+int nsignals0 = sizeof signalent0 / sizeof signalent0[0];
+
+#if SUPPORTED_PERSONALITIES >= 2
+char *signalent1[] = {
+#include "signalent1.h"
+};
+int nsignals1 = sizeof signalent1 / sizeof signalent1[0];
+#endif /* SUPPORTED_PERSONALITIES >= 2 */
+
+#if SUPPORTED_PERSONALITIES >= 3
+char *signalent2[] = {
+#include "signalent2.h"
+};
+int nsignals2 = sizeof signalent2 / sizeof signalent2[0];
+#endif /* SUPPORTED_PERSONALITIES >= 3 */
+
+char **signalent;
+int nsignals;
+
+#ifdef SUNOS4
+
+static struct xlat sigvec_flags[] = {
+ { SV_ONSTACK, "SV_ONSTACK" },
+ { SV_INTERRUPT, "SV_INTERRUPT" },
+ { SV_RESETHAND, "SV_RESETHAND" },
+ { SA_NOCLDSTOP, "SA_NOCLDSTOP" },
+ { 0, NULL },
+};
+
+#endif /* SUNOS4 */
+
+#ifdef HAVE_SIGACTION
+
+static struct xlat sigact_flags[] = {
+#ifdef SA_STACK
+ { SA_STACK, "SA_STACK" },
+#endif
+#ifdef SA_RESTART
+ { SA_RESTART, "SA_RESTART" },
+#endif
+#ifdef SA_INTERRUPT
+ { SA_INTERRUPT, "SA_INTERRUPT" },
+#endif
+#ifdef SA_NOMASK
+ { SA_NOMASK, "SA_NOMASK" },
+#endif
+#ifdef SA_ONESHOT
+ { SA_ONESHOT, "SA_ONESHOT" },
+#endif
+#ifdef SA_SIGINFO
+ { SA_SIGINFO, "SA_SIGINFO" },
+#endif
+#ifdef SA_RESETHAND
+ { SA_RESETHAND, "SA_RESETHAND" },
+#endif
+#ifdef SA_ONSTACK
+ { SA_ONSTACK, "SA_ONSTACK" },
+#endif
+#ifdef SA_NODEFER
+ { SA_NODEFER, "SA_NODEFER" },
+#endif
+#ifdef SA_NOCLDSTOP
+ { SA_NOCLDSTOP, "SA_NOCLDSTOP" },
+#endif
+#ifdef SA_NOCLDWAIT
+ { SA_NOCLDWAIT, "SA_NOCLDWAIT" },
+#endif
+#ifdef _SA_BSDCALL
+ { _SA_BSDCALL, "_SA_BSDCALL" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat sigprocmaskcmds[] = {
+ { SIG_BLOCK, "SIG_BLOCK" },
+ { SIG_UNBLOCK, "SIG_UNBLOCK" },
+ { SIG_SETMASK, "SIG_SETMASK" },
+#ifdef SIG_SETMASK32
+ { SIG_SETMASK32,"SIG_SETMASK32" },
+#endif
+ { 0, NULL },
+};
+
+#endif /* HAVE_SIGACTION */
+
+
+static char *
+sprintsigmask(s, mask)
+char *s;
+sigset_t *mask;
+{
+ int i, nsigs;
+ char *format;
+ static char outstr[256];
+
+ strcpy(outstr, s);
+ s = outstr + strlen(outstr);
+ nsigs = 0;
+ for (i = 1; i <= nsignals; i++) {
+ if (sigismember(mask, i) == 1)
+ nsigs++;
+ }
+ if (nsigs >= nsignals * 2 / 3) {
+ *s++ = '~';
+ for (i = 1; i <= nsignals; i++) {
+ switch (sigismember(mask, i)) {
+ case 1:
+ sigdelset(mask, i);
+ break;
+ case 0:
+ sigaddset(mask, i);
+ break;
+ }
+ }
+ }
+ format = "%s";
+ *s++ = '[';
+ for (i = 1; i <= nsignals; i++) {
+ if (sigismember(mask, i) == 1) {
+ sprintf(s, format, signalent[i] + 3); s += strlen(s);
+ format = " %s";
+ }
+ }
+ *s++ = ']';
+ *s = '\0';
+ return outstr;
+}
+
+static void
+printsigmask(mask)
+sigset_t *mask;
+{
+ tprintf("%s", sprintsigmask("", mask));
+}
+
+void
+printsignal(nr)
+int nr;
+{
+ if (nr > 0 && nr < nsignals)
+ tprintf("%s", signalent[nr]);
+ else
+ tprintf("%d", nr);
+}
+
+/*
+ * Check process TCP for the disposition of signal SIG.
+ * Return 1 if the process would somehow manage to survive signal SIG,
+ * else return 0. This routine will never be called with SIGKILL.
+ */
+int
+sigishandled(tcp, sig)
+struct tcb *tcp;
+int sig;
+{
+#ifdef LINUX
+ int sfd;
+ char sname[32];
+ char buf[1024];
+ char *s;
+ int i;
+ int signalled, blocked, ignored, caught;
+
+ /* This is incredibly costly but it's worth it. */
+ sprintf(sname, "/proc/%d/stat", tcp->pid);
+ if ((sfd = open(sname, O_RDONLY)) == -1) {
+ perror(sname);
+ return 1;
+ }
+ i = read(sfd, buf, 1024);
+ buf[i] = '\0';
+ close(sfd);
+ /*
+ * Skip the extraneous fields. This loses if the
+ * command name has any spaces in it. So be it.
+ */
+ for (i = 0, s = buf; i < 30; i++) {
+ while (*++s != ' ') {
+ if (!*s)
+ break;
+ }
+ }
+ if (sscanf(s, "%d%d%d%d",
+ &signalled, &blocked, &ignored, &caught) != 4) {
+ fprintf(stderr, "/proc/pid/stat format error\n");
+ return 1;
+ }
+#ifdef DEBUG
+ fprintf(stderr, "sigs: %08x %08x %08x %08x\n",
+ signalled, blocked, ignored, caught);
+#endif
+ if ((ignored & sigmask(sig)) || (caught & sigmask(sig)))
+ return 1;
+#endif /* LINUX */
+
+#ifdef SUNOS4
+ void (*u_signal)();
+
+ if (upeek(tcp->pid, uoff(u_signal[0]) + sig*sizeof(u_signal),
+ (long *) &u_signal) < 0) {
+ return 0;
+ }
+ if (u_signal != SIG_DFL)
+ return 1;
+#endif /* SUNOS4 */
+
+#ifdef SVR4
+ /*
+ * Since procfs doesn't interfere with wait I think it is safe
+ * to punt on this question. If not, the information is there.
+ */
+ return 1;
+#else /* !SVR4 */
+ switch (sig) {
+ case SIGCONT:
+ case SIGSTOP:
+ case SIGTSTP:
+ case SIGTTIN:
+ case SIGTTOU:
+ case SIGCHLD:
+ case SIGIO:
+#if defined(SIGURG) && SIGURG != SIGIO
+ case SIGURG:
+#endif
+ case SIGWINCH:
+ /* Gloria Gaynor says ... */
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+#endif /* !SVR4 */
+}
+
+#if defined(SUNOS4)
+
+int
+sys_sigvec(tcp)
+struct tcb *tcp;
+{
+ struct sigvec sv;
+ long addr;
+
+ if (entering(tcp)) {
+ printsignal(tcp->u_arg[0]);
+ tprintf(", ");
+ addr = tcp->u_arg[1];
+ } else {
+ addr = tcp->u_arg[2];
+ }
+ if (addr == 0)
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", addr);
+ else if (umove(tcp, addr, &sv) < 0)
+ tprintf("{...}");
+ else {
+ switch ((int) sv.sv_handler) {
+ case (int) SIG_ERR:
+ tprintf("{SIG_ERR}");
+ break;
+ case (int) SIG_DFL:
+ tprintf("{SIG_DFL}");
+ break;
+ case (int) SIG_IGN:
+ if (tcp->u_arg[0] == SIGTRAP) {
+ tcp->flags |= TCB_SIGTRAPPED;
+ kill(tcp->pid, SIGSTOP);
+ }
+ tprintf("{SIG_IGN}");
+ break;
+ case (int) SIG_HOLD:
+ if (tcp->u_arg[0] == SIGTRAP) {
+ tcp->flags |= TCB_SIGTRAPPED;
+ kill(tcp->pid, SIGSTOP);
+ }
+ tprintf("SIG_HOLD");
+ break;
+ default:
+ if (tcp->u_arg[0] == SIGTRAP) {
+ tcp->flags |= TCB_SIGTRAPPED;
+ kill(tcp->pid, SIGSTOP);
+ }
+ tprintf("{%#lx, ", (unsigned long) sv.sv_handler);
+ printsigmask(&sv.sv_mask);
+ tprintf(", ");
+ if (!printflags(sigvec_flags, sv.sv_flags))
+ tprintf("0");
+ tprintf("}");
+ }
+ }
+ if (entering(tcp))
+ tprintf(", ");
+ return 0;
+}
+
+int
+sys_sigpause(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) { /* WTA: UD had a bug here: he forgot the braces */
+ sigset_t sigm = tcp->u_arg[0];
+ printsigmask(&sigm);
+ }
+ return 0;
+}
+
+int
+sys_sigstack(tcp)
+struct tcb *tcp;
+{
+ struct sigstack ss;
+ long addr;
+
+ if (entering(tcp))
+ addr = tcp->u_arg[0];
+ else
+ addr = tcp->u_arg[1];
+ if (addr == 0)
+ tprintf("NULL");
+ else if (umove(tcp, addr, &ss) < 0)
+ tprintf("%#lx", addr);
+ else {
+ tprintf("{ss_sp %#lx ", (unsigned long) ss.ss_sp);
+ tprintf("ss_onstack %s}", ss.ss_onstack ? "YES" : "NO");
+ }
+ if (entering(tcp))
+ tprintf(", ");
+ return 0;
+}
+
+int
+sys_sigcleanup(tcp)
+struct tcb *tcp;
+{
+ return 0;
+}
+
+#endif /* SUNOS4 */
+
+#ifndef SVR4
+
+int
+sys_sigsetmask(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+#ifdef LINUX
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_arg[0];
+#else
+ sigset_t sigm = tcp->u_arg[0];
+#endif
+ printsigmask(&sigm);
+ if ((tcp->u_arg[0] & sigmask(SIGTRAP))) {
+ /* Mark attempt to block SIGTRAP */
+ tcp->flags |= TCB_SIGTRAPPED;
+ /* Send unblockable signal */
+ kill(tcp->pid, SIGSTOP);
+ }
+ }
+ else if (!syserror(tcp)) {
+#ifdef LINUX
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_rval;
+#else
+ sigset_t sigm = tcp->u_rval;
+#endif
+ tcp->auxstr = sprintsigmask("old mask ", &sigm);
+
+ return RVAL_HEX | RVAL_STR;
+ }
+ return 0;
+}
+
+int
+sys_sigblock(tcp)
+struct tcb *tcp;
+{
+ return sys_sigsetmask(tcp);
+}
+
+#endif /* !SVR4 */
+
+#ifdef HAVE_SIGACTION
+
+#ifdef LINUX
+struct old_sigaction {
+ __sighandler_t __sa_handler;
+ unsigned long sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+#endif
+
+int
+sys_sigaction(tcp)
+struct tcb *tcp;
+{
+ long addr;
+#ifdef LINUX
+ sigset_t sigset;
+ struct old_sigaction sa;
+ sigemptyset(&sigset);
+#else
+ struct sigaction sa;
+#endif
+
+
+ if (entering(tcp)) {
+ printsignal(tcp->u_arg[0]);
+ tprintf(", ");
+ addr = tcp->u_arg[1];
+ } else
+ addr = tcp->u_arg[2];
+ if (addr == 0)
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", addr);
+ else if (umove(tcp, addr, &sa) < 0)
+ tprintf("{...}");
+ else {
+ switch ((long) sa.__sa_handler) {
+ case (long) SIG_ERR:
+ tprintf("{SIG_ERR}");
+ break;
+ case (long) SIG_DFL:
+ tprintf("{SIG_DFL}");
+ break;
+ case (long) SIG_IGN:
+#ifndef SVR4
+ if (tcp->u_arg[0] == SIGTRAP) {
+ tcp->flags |= TCB_SIGTRAPPED;
+ kill(tcp->pid, SIGSTOP);
+ }
+#endif /* !SVR4 */
+ tprintf("{SIG_IGN}");
+ break;
+ default:
+#ifndef SVR4
+ if (tcp->u_arg[0] == SIGTRAP) {
+ tcp->flags |= TCB_SIGTRAPPED;
+ kill(tcp->pid, SIGSTOP);
+ }
+#endif /* !SVR4 */
+ tprintf("{%#lx, ", (long) sa.__sa_handler);
+#ifdef LINUX
+ sigset.__val[0] = sa.sa_mask;
+ printsigmask(&sigset);
+#else
+ printsigmask(&sa.sa_mask);
+#endif
+ tprintf(", ");
+ if (!printflags(sigact_flags, sa.sa_flags))
+ tprintf("0");
+ tprintf("}");
+ }
+ }
+ if (entering(tcp))
+ tprintf(", ");
+#ifdef LINUX
+ else
+ tprintf(", %#lx", (unsigned long) sa.sa_restorer);
+#endif
+ return 0;
+}
+
+int
+sys_signal(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printsignal(tcp->u_arg[0]);
+ switch (tcp->u_arg[1]) {
+ case (int) SIG_ERR:
+ tprintf("SIG_ERR");
+ break;
+ case (int) SIG_DFL:
+ tprintf("SIG_DFL");
+ break;
+ case (int) SIG_IGN:
+#ifndef SVR4
+ if (tcp->u_arg[0] == SIGTRAP) {
+ tcp->flags |= TCB_SIGTRAPPED;
+ kill(tcp->pid, SIGSTOP);
+ }
+#endif /* !SVR4 */
+ tprintf("SIG_IGN");
+ break;
+ default:
+#ifndef SVR4
+ if (tcp->u_arg[0] == SIGTRAP) {
+ tcp->flags |= TCB_SIGTRAPPED;
+ kill(tcp->pid, SIGSTOP);
+ }
+#endif /* !SVR4 */
+ tprintf("%#lx", tcp->u_arg[1]);
+ }
+ }
+ return 0;
+}
+
+#endif /* HAVE_SIGACTION */
+
+#ifdef LINUX
+
+int
+sys_sigreturn(tcp)
+struct tcb *tcp;
+{
+#ifdef I386
+ long esp;
+ struct sigcontext_struct sc;
+
+ if (entering(tcp)) {
+ tcp->u_arg[0] = 0;
+ if (upeek(tcp->pid, 4*UESP, &esp) < 0)
+ return 0;
+ if (umove(tcp, esp, &sc) < 0)
+ return 0;
+ tcp->u_arg[0] = 1;
+ tcp->u_arg[1] = sc.oldmask;
+ }
+ else {
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_arg[1];
+ tcp->u_rval = tcp->u_error = 0;
+ if (tcp->u_arg[0] == 0)
+ return 0;
+ tcp->auxstr = sprintsigmask("mask now ", &sigm);
+ return RVAL_NONE | RVAL_STR;
+ }
+ return 0;
+#else /* !I386 */
+#ifdef POWERPC
+ long esp;
+ struct sigcontext_struct sc;
+
+ if (entering(tcp)) {
+ tcp->u_arg[0] = 0;
+ if (upeek(tcp->pid, 4*PT_R1, &esp) < 0)
+ return 0;
+ if (umove(tcp, esp, &sc) < 0)
+ return 0;
+ tcp->u_arg[0] = 1;
+ tcp->u_arg[1] = sc.oldmask;
+ }
+ else {
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_arg[1];
+ tcp->u_rval = tcp->u_error = 0;
+ if (tcp->u_arg[0] == 0)
+ return 0;
+ tcp->auxstr = sprintsigmask("mask now ", &sigm);
+ return RVAL_NONE | RVAL_STR;
+ }
+ return 0;
+#else /* !POWERPC */
+#ifdef M68K
+ long usp;
+ struct sigcontext_struct sc;
+
+ if (entering(tcp)) {
+ tcp->u_arg[0] = 0;
+ if (upeek(tcp->pid, 4*PT_USP, &usp) < 0)
+ return 0;
+ if (umove(tcp, usp, &sc) < 0)
+ return 0;
+ tcp->u_arg[0] = 1;
+ tcp->u_arg[1] = sc.sc_mask;
+ }
+ else {
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_arg[1];
+ tcp->u_rval = tcp->u_error = 0;
+ if (tcp->u_arg[0] == 0)
+ return 0;
+ tcp->auxstr = sprintsigmask("mask now ", &sigm);
+ return RVAL_NONE | RVAL_STR;
+ }
+ return 0;
+#else /* !M68K */
+#ifdef ALPHA
+ long fp;
+ struct sigcontext_struct sc;
+
+ if (entering(tcp)) {
+ tcp->u_arg[0] = 0;
+ if (upeek(tcp->pid, REG_FP, &fp) < 0)
+ return 0;
+ if (umove(tcp, fp, &sc) < 0)
+ return 0;
+ tcp->u_arg[0] = 1;
+ tcp->u_arg[1] = sc.sc_mask;
+ }
+ else {
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_arg[1];
+ tcp->u_rval = tcp->u_error = 0;
+ if (tcp->u_arg[0] == 0)
+ return 0;
+ tcp->auxstr = sprintsigmask("mask now ", &sigm);
+ return RVAL_NONE | RVAL_STR;
+ }
+ return 0;
+#else
+#ifdef SPARC
+ long i1;
+ struct pt_regs regs;
+ m_siginfo_t si;
+
+ if(ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
+ perror("sigreturn: PTRACE_GETREGS ");
+ return 0;
+ }
+ memmove (&regs.u_regs [1], &regs.u_regs [0],
+ sizeof (regs.u_regs) - sizeof (regs.u_regs [0]));
+ if(entering(tcp)) {
+ tcp->u_arg[0] = 0;
+ i1 = regs.u_regs[UREG_I1];
+ if(umove(tcp, i1, &si) < 0) {
+ perror("sigreturn: umove ");
+ return 0;
+ }
+ tcp->u_arg[0] = 1;
+ tcp->u_arg[1] = si.si_mask;
+ } else {
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_arg[1];
+ tcp->u_rval = tcp->u_error = 0;
+ if(tcp->u_arg[0] == 0)
+ return 0;
+ tcp->auxstr = sprintsigmask("mask now ", &sigm);
+ return RVAL_NONE | RVAL_STR;
+ }
+ return 0;
+#endif /* SPARC */
+#endif /* ALPHA */
+#endif /* !M68K */
+#endif /* !POWERPC */
+#endif /* !I386 */
+}
+
+int
+sys_siggetmask(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+#ifdef LINUX
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_rval;
+#else
+ sigset_t sigm = tcp->u_rval;
+#endif
+ tcp->auxstr = sprintsigmask("mask ", &sigm);
+ }
+ return RVAL_HEX | RVAL_STR;
+}
+
+int
+sys_sigsuspend(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ sigm.__val[0] = tcp->u_arg[2];
+#if 0
+ /* first two are not really arguments, but print them anyway */
+ /* nevermind, they are an anachronism now, too bad... */
+ tprintf("%d, %#x, ", tcp->u_arg[0], tcp->u_arg[1]);
+#endif
+ printsigmask(&sigm);
+ }
+ return 0;
+}
+
+#endif /* LINUX */
+
+#ifdef SVR4
+
+int
+sys_sigsuspend(tcp)
+struct tcb *tcp;
+{
+ sigset_t sigset;
+
+ if (entering(tcp)) {
+ if (umove(tcp, tcp->u_arg[0], &sigset) < 0)
+ tprintf("[?]");
+ else
+ printsigmask(sigset);
+ }
+ return 0;
+}
+static struct xlat ucontext_flags[] = {
+ { UC_SIGMASK, "UC_SIGMASK" },
+ { UC_STACK, "UC_STACK" },
+ { UC_CPU, "UC_CPU" },
+#ifdef UC_FPU
+ { UC_FPU, "UC_FPU" },
+#endif
+#ifdef UC_INTR
+ { UC_INTR, "UC_INTR" },
+#endif
+ { 0, NULL },
+};
+
+#endif
+
+#if defined SVR4 || defined LINUX
+#if defined LINUX && !defined SS_ONSTACK
+#define SS_ONSTACK 1
+#define SS_DISABLE 2
+#if __GLIBC_MINOR__ == 0
+typedef struct
+{
+ __ptr_t ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
+#endif
+#endif
+
+static struct xlat sigaltstack_flags[] = {
+ { SS_ONSTACK, "SS_ONSTACK" },
+ { SS_DISABLE, "SS_DISABLE" },
+ { 0, NULL },
+};
+#endif
+
+#ifdef SVR4
+static void
+printcontext(tcp, ucp)
+struct tcb *tcp;
+ucontext_t *ucp;
+{
+ tprintf("{");
+ if (!abbrev(tcp)) {
+ tprintf("uc_flags=");
+ if (!printflags(ucontext_flags, ucp->uc_flags))
+ tprintf("0");
+ tprintf(", uc_link=%#lx, ", (unsigned long) ucp->uc_link);
+ }
+ tprintf("uc_sigmask=");
+ printsigmask(ucp->uc_sigmask);
+ if (!abbrev(tcp)) {
+ tprintf(", uc_stack={ss_sp=%#lx, ss_size=%d, ss_flags=",
+ (unsigned long) ucp->uc_stack.ss_sp,
+ ucp->uc_stack.ss_size);
+ if (!printflags(sigaltstack_flags, ucp->uc_stack.ss_flags))
+ tprintf("0");
+ tprintf("}");
+ }
+ tprintf(", ...}");
+}
+
+int
+sys_getcontext(tcp)
+struct tcb *tcp;
+{
+ ucontext_t uc;
+
+ if (entering(tcp)) {
+ if (!tcp->u_arg[0])
+ tprintf("NULL");
+ else if (umove(tcp, tcp->u_arg[0], &uc) < 0)
+ tprintf("{...}");
+ else
+ printcontext(tcp, &uc);
+ }
+ return 0;
+}
+
+int
+sys_setcontext(tcp)
+struct tcb *tcp;
+{
+ ucontext_t uc;
+
+ if (entering(tcp)) {
+ if (!tcp->u_arg[0])
+ tprintf("NULL");
+ else if (umove(tcp, tcp->u_arg[0], &uc) < 0)
+ tprintf("{...}");
+ else
+ printcontext(tcp, &uc);
+ }
+ else {
+ tcp->u_rval = tcp->u_error = 0;
+ if (tcp->u_arg[0] == 0)
+ return 0;
+ return RVAL_NONE;
+ }
+ return 0;
+}
+
+#endif /* SVR4 */
+
+#ifdef LINUX
+
+static int
+print_stack_t(tcp, addr)
+struct tcb *tcp;
+unsigned long addr;
+{
+ stack_t ss;
+ if (umove(tcp, addr, &ss) < 0)
+ return -1;
+ tprintf("{ss_sp=%#lx, ss_flags=", (unsigned long) ss.ss_sp);
+ if (!printflags(sigaltstack_flags, ss.ss_flags))
+ tprintf("0");
+ tprintf(", ss_size=%lu}", (unsigned long) ss.ss_size);
+ return 0;
+}
+
+int
+sys_sigaltstack(tcp)
+ struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ if (tcp->u_arg[0] == 0)
+ tprintf("NULL");
+ else if (print_stack_t(tcp, tcp->u_arg[0]) < 0)
+ return -1;
+ }
+ else {
+ tprintf(", ");
+ if (tcp->u_arg[1] == 0)
+ tprintf("NULL");
+ else if (print_stack_t(tcp, tcp->u_arg[1]) < 0)
+ return -1;
+ }
+ return 0;
+}
+#endif
+
+#ifdef HAVE_SIGACTION
+
+int
+sys_sigprocmask(tcp)
+struct tcb *tcp;
+{
+#ifdef ALPHA
+ if (entering(tcp)) {
+ printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
+ tprintf(", ");
+ printsigmask(tcp->u_arg[1]);
+ }
+ else if (!syserror(tcp)) {
+ tcp->auxstr = sprintsigmask("old mask ", tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ }
+#else /* !ALPHA */
+ sigset_t sigset;
+#ifdef LINUX
+ sigemptyset(&sigset);
+#endif
+
+ if (entering(tcp)) {
+#ifdef SVR4
+ if (tcp->u_arg[0] == 0)
+ tprintf("0");
+ else
+#endif /* SVR4 */
+ printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
+ tprintf(", ");
+ if (!tcp->u_arg[1])
+ tprintf("NULL, ");
+#ifdef LINUX
+ else if (umoven(tcp, tcp->u_arg[1], 4, (char *) &sigset.__val[0]) < 0)
+ tprintf("%#lx, ", tcp->u_arg[1]);
+#else
+ else if (umove(tcp, tcp->u_arg[1], &sigset) < 0)
+ tprintf("%#lx, ", tcp->u_arg[1]);
+#endif
+ else {
+ printsigmask(&sigset);
+ tprintf(", ");
+ }
+ }
+ else {
+ if (!tcp->u_arg[2])
+ tprintf("NULL");
+ else if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[2]);
+#ifdef LINUX
+ else if (umoven(tcp, tcp->u_arg[2], 4, (char *) &sigset.__val[0]) < 0)
+ tprintf("[?]");
+#else
+ else if (umove(tcp, tcp->u_arg[2], &sigset) < 0)
+ tprintf("[?]");
+#endif
+ else
+ printsigmask(&sigset);
+ }
+#endif /* !ALPHA */
+ return 0;
+}
+
+#endif /* HAVE_SIGACTION */
+
+int
+sys_kill(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ long sig = tcp->u_arg[1];
+
+ if (sig >= 0 && sig < NSIG)
+ tprintf("%ld, %s", tcp->u_arg[0], signalent[sig]);
+ else
+ tprintf("%ld, %ld", tcp->u_arg[0], sig);
+ }
+ return 0;
+}
+
+int
+sys_killpg(tcp)
+struct tcb *tcp;
+{
+ return sys_kill(tcp);
+}
+
+int
+sys_sigpending(tcp)
+struct tcb *tcp;
+{
+ sigset_t sigset;
+#ifdef LINUX
+ sigemptyset(&sigset);
+#endif
+
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+#ifdef LINUX
+ else if (umoven(tcp, tcp->u_arg[0], 4, (char *) &sigset.__val[0]) < 0)
+ tprintf("[?]");
+#else
+ else if (umove(tcp, tcp->u_arg[0], &sigset) < 0)
+ tprintf("[?]");
+#endif
+ else
+ printsigmask(sigset);
+ }
+ return 0;
+}
+
+#ifdef LINUX
+
+ int
+sys_rt_sigprocmask(tcp)
+ struct tcb *tcp;
+{
+ sigset_t sigset;
+
+ if (entering(tcp)) {
+ printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
+ tprintf(", ");
+ if (!tcp->u_arg[1])
+ tprintf("NULL, ");
+ else if (umove(tcp, tcp->u_arg[1], &sigset) < 0)
+ tprintf("%#lx, ", tcp->u_arg[1]);
+ else {
+ printsigmask(&sigset);
+ tprintf(", ");
+ }
+ }
+ else {
+ if (!tcp->u_arg[2])
+
+ tprintf("NULL");
+ else if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[2]);
+ else if (umove(tcp, tcp->u_arg[2], &sigset) < 0)
+ tprintf("[?]");
+ else
+ printsigmask(&sigset);
+ tprintf(", %lu", tcp->u_arg[4]);
+ }
+ return 0;
+}
+
+#if __GLIBC_MINOR__ < 1
+/* Type for data associated with a signal. */
+typedef union sigval
+{
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+# define __SI_MAX_SIZE 128
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
+
+typedef struct siginfo
+{
+ int si_signo; /* Signal number. */
+ int si_errno; /* If non-zero, an errno value associated with
+ this signal, as defined in <errno.h>. */
+ int si_code; /* Signal code. */
+
+ union
+ {
+ int _pad[__SI_PAD_SIZE];
+
+ /* kill(). */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ } _kill;
+
+ /* POSIX.1b timers. */
+ struct
+ {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals. */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ sigval_t si_sigval; /* Signal value. */
+ } _rt;
+
+ /* SIGCHLD. */
+ struct
+ {
+ __pid_t si_pid; /* Which child. */
+ int si_status; /* Exit value or signal. */
+ __clock_t si_utime;
+ __clock_t si_stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
+ struct
+ {
+ void *si_addr; /* Faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL. */
+ struct
+ {
+ int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+#endif
+
+/* Structure describing the action to be taken when a signal arrives. */
+struct new_sigaction
+{
+ union
+ {
+ __sighandler_t __sa_handler;
+ void (*__sa_sigaction) (int, siginfo_t *, void *);
+ }
+ __sigaction_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer) (void);
+ unsigned long int sa_mask[2];
+};
+
+
+ int
+sys_rt_sigaction(tcp)
+ struct tcb *tcp;
+{
+ struct new_sigaction sa;
+ sigset_t sigset;
+ long addr;
+ sigemptyset(&sigset);
+
+ if (entering(tcp)) {
+ printsignal(tcp->u_arg[0]);
+ tprintf(", ");
+ addr = tcp->u_arg[1];
+ } else
+ addr = tcp->u_arg[2];
+ if (addr == 0)
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", addr);
+ else if (umove(tcp, addr, &sa) < 0)
+ tprintf("{...}");
+ else {
+ switch ((long) sa.__sigaction_handler.__sa_handler) {
+ case (long) SIG_ERR:
+ tprintf("{SIG_ERR}");
+ break;
+ case (long) SIG_DFL:
+ tprintf("{SIG_DFL}");
+ break;
+ case (long) SIG_IGN:
+ tprintf("{SIG_IGN}");
+ break;
+ default:
+ tprintf("{%#lx, ",
+ (long) sa.__sigaction_handler.__sa_handler);
+ sigset.__val[0] = sa.sa_mask[0];
+ sigset.__val[1] = sa.sa_mask[1];
+ printsigmask(&sigset);
+ tprintf(", ");
+ if (!printflags(sigact_flags, sa.sa_flags))
+ tprintf("0");
+ tprintf("}");
+ }
+ }
+ if (entering(tcp))
+ tprintf(", ");
+ else
+ tprintf(", %lu", addr = tcp->u_arg[3]);
+ return 0;
+}
+
+ int
+sys_rt_sigpending(tcp)
+ struct tcb *tcp;
+{
+ sigset_t sigset;
+ sigemptyset(&sigset);
+
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else if (umoven(tcp, tcp->u_arg[0], tcp->u_arg[1],
+ (char *) &sigset.__val[0]) < 0)
+ tprintf("[?]");
+ else
+ printsigmask(sigset);
+ }
+ return 0;
+}
+ int
+sys_rt_sigsuspend(tcp)
+ struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ sigset_t sigm;
+ sigemptyset(&sigm);
+ umoven(tcp, tcp->u_arg[0], tcp->u_arg[1], (char *) &sigm);
+ printsigmask(&sigm);
+ }
+ return 0;
+}
+#ifndef ILL_ILLOPC
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLOPN 2 /* illegal operand */
+#define ILL_ILLADR 3 /* illegal addressing mode */
+#define ILL_ILLTRP 4 /* illegal trap */
+#define ILL_PRVOPC 5 /* privileged opcode */
+#define ILL_PRVREG 6 /* privileged register */
+#define ILL_COPROC 7 /* coprocessor error */
+#define ILL_BADSTK 8 /* internal stack error */
+#define FPE_INTDIV 1 /* integer divide by zero */
+#define FPE_INTOVF 2 /* integer overflow */
+#define FPE_FLTDIV 3 /* floating point divide by zero */
+#define FPE_FLTOVF 4 /* floating point overflow */
+#define FPE_FLTUND 5 /* floating point underflow */
+#define FPE_FLTRES 6 /* floating point inexact result */
+#define FPE_FLTINV 7 /* floating point invalid operation */
+#define FPE_FLTSUB 8 /* subscript out of range */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SEGV_ACCERR 2 /* invalid permissions for mapped object */
+#define BUS_ADRALN 1 /* invalid address alignment */
+#define BUS_ADRERR 2 /* non-existant physical address */
+#define BUS_OBJERR 3 /* object specific hardware error */
+#define TRAP_BRKPT 1 /* process breakpoint */
+#define TRAP_TRACE 2 /* process trace trap */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2 /* child was killed */
+#define CLD_DUMPED 3 /* child terminated abnormally */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+#define POLL_IN 1 /* data input available */
+#define POLL_OUT 2 /* output buffers available */
+#define POLL_MSG 3 /* input message available */
+#define POLL_ERR 4 /* i/o error */
+#define POLL_PRI 5 /* high priority input available */
+#define POLL_HUP 6 /* device disconnected */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER -2 /* sent by timer expiration */
+#define SI_MESGQ -3 /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+#else
+#undef si_pid
+#undef si_uid
+#undef si_status
+#undef si_utime
+#undef si_stime
+#undef si_value
+#undef si_int
+#undef si_ptr
+#undef si_addr
+#undef si_band
+#undef si_fd
+#endif
+
+static struct xlat sigill_flags[] = {
+ {ILL_ILLOPC, "ILL_ILLOPC"},
+ {ILL_ILLOPN, "ILL_ILLOPN"},
+ {ILL_ILLADR, "ILL_ILLADR"},
+ {ILL_ILLTRP, "ILL_ILLTRP"},
+ {ILL_PRVOPC, "ILL_PRVOPC"},
+ {ILL_PRVREG, "ILL_PRVREG"},
+ {ILL_COPROC, "ILL_COPROC"},
+ {ILL_BADSTK, "ILL_BADSTK"},
+ {0, NULL}
+};
+
+static struct xlat sigfpe_flags[] = {
+ {FPE_INTDIV, "FPE_INTDIV"},
+ {FPE_INTOVF, "FPE_INTOVF"},
+ {FPE_FLTDIV, "FPE_FLTDIV"},
+ {FPE_FLTOVF, "FPE_FLTOVF"},
+ {FPE_FLTUND, "FPE_FLTUND"},
+ {FPE_FLTRES, "FPE_FLTRES"},
+ {FPE_FLTINV, "FPE_FLTINV"},
+ {FPE_FLTSUB, "FPE_FLTSUB"},
+ {0, NULL}
+};
+
+static struct xlat sigsegv_flags[] = {
+ {SEGV_MAPERR, "SEGV_MAPERR"},
+ {SEGV_ACCERR, "SEGV_ACCERR"},
+ {0, NULL}
+};
+
+static struct xlat sigbus_flags[] = {
+ {BUS_ADRALN, "BUS_ADRALN"},
+ {BUS_ADRERR, "BUS_ADRERR"},
+ {BUS_OBJERR, "BUS_OBJERR"},
+ {0, NULL}
+};
+
+static struct xlat sigtrap_flags[] = {
+ {TRAP_BRKPT, "TRAP_BRKPT"},
+ {TRAP_TRACE, "TRAP_TRACE"},
+ {0, NULL}
+};
+
+static struct xlat sigchld_flags[] = {
+ {CLD_EXITED, "CLD_EXITED"},
+ {CLD_KILLED, "CLD_KILLED"},
+ {CLD_DUMPED, "CLD_DUMPED"},
+ {CLD_TRAPPED, "CLD_TRAPPED"},
+ {CLD_STOPPED, "CLD_STOPPED"},
+ {CLD_CONTINUED, "CLD_CONTINUED"},
+ {0, NULL}
+};
+
+static struct xlat sigpoll_flags[] = {
+ {POLL_IN, "POLL_IN"},
+ {POLL_OUT, "POLL_OUT"},
+ {POLL_MSG, "POLL_MSG"},
+ {POLL_ERR, "POLL_ERR"},
+ {POLL_PRI, "POLL_PRI"},
+ {POLL_HUP, "POLL_HUP"},
+ {0, NULL}
+};
+
+static struct xlat siginfo_flags[] = {
+ {SI_USER, "SI_USER"},
+ {SI_QUEUE, "SI_QUEUE"},
+ {SI_TIMER, "SI_TIMER"},
+ {SI_MESGQ, "SI_MESGQ"},
+ {SI_ASYNCIO, "SI_ASYNCIO"},
+ {0, NULL}
+};
+
+ static void
+printsiginfo(tcp, si)
+ struct tcb *tcp;
+ siginfo_t *si;
+{
+ tprintf("{si_signo=");
+ printsignal(si->si_signo);
+ tprintf(", si_errno=%d, si_code=", si->si_errno);
+ switch(si->si_signo)
+ {
+ case SIGILL:
+ if (!printflags(sigill_flags, si->si_code))
+ tprintf("%d /* ILL_??? */", si->si_code);
+ tprintf(", si_addr=%lx",
+ (unsigned long) si->_sifields._sigfault.si_addr);
+ break;
+ case SIGFPE:
+ if (!printflags(sigfpe_flags, si->si_code))
+ tprintf("%d /* FPE_??? */", si->si_code);
+ tprintf(", si_addr=%lx",
+ (unsigned long) si->_sifields._sigfault.si_addr);
+ break;
+ case SIGSEGV:
+ if (!printflags(sigsegv_flags, si->si_code))
+ tprintf("%d /* SEGV_??? */", si->si_code);
+ tprintf(", si_addr=%lx",
+ (unsigned long) si->_sifields._sigfault.si_addr);
+ break;
+ case SIGBUS:
+ if (!printflags(sigbus_flags, si->si_code))
+ tprintf("%d /* BUS_??? */", si->si_code);
+ tprintf(", si_addr=%lx",
+ (unsigned long) si->_sifields._sigfault.si_addr);
+ break;
+ case SIGTRAP:
+ if (!printflags(sigtrap_flags, si->si_code))
+ tprintf("%d /* TRAP_??? */", si->si_code);
+ break;
+ case SIGCHLD:
+ if (!printflags(sigchld_flags, si->si_code))
+ tprintf("%d /* CLD_??? */", si->si_code);
+ if (!verbose(tcp))
+ tprintf(", ...");
+ else
+ tprintf(", si_pid=%d, si_uid=%d, si_status=%d, si_utime=%lu, si_stime=%lu",
+ si->_sifields._kill.si_pid,
+ si->_sifields._kill.si_uid,
+ si->_sifields._sigchld.si_status,
+ si->_sifields._sigchld.si_utime,
+ si->_sifields._sigchld.si_stime);
+ break;
+ case SIGPOLL:
+ if (!printflags(sigpoll_flags, si->si_code))
+ tprintf("%d /* POLL_??? */", si->si_code);
+ if (si->si_code == POLL_IN
+ || si->si_code == POLL_OUT
+ || si->si_code == POLL_MSG)
+ tprintf(", si_bind=%lu, si_fd=%d",
+ (unsigned long) si->_sifields._sigpoll.si_band,
+ si->_sifields._sigpoll.si_fd);
+ break;
+ default:
+ if (!printflags(siginfo_flags, si->si_code))
+ tprintf("%d /* SI_??? */", si->si_code);
+ tprintf(", si_pid=%lu, si_uid=%lu, si_value={",
+ (unsigned long) si->_sifields._rt.si_pid,
+ (unsigned long) si->_sifields._rt.si_uid);
+ if (!verbose(tcp))
+ tprintf("...");
+ else {
+ tprintf("sival_int=%u, sival_ptr=%#lx",
+ si->_sifields._rt.si_sigval.sival_int,
+ (unsigned long) si->_sifields._rt.si_sigval.sival_ptr);
+ }
+ tprintf("}");
+ break;
+ }
+ tprintf("}");
+}
+
+ int
+sys_rt_sigqueueinfo(tcp)
+ struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ siginfo_t si;
+ tprintf("%lu, ", tcp->u_arg[0]);
+ printsignal(tcp->u_arg[1]);
+ tprintf(", ");
+ if (umove(tcp, tcp->u_arg[2], &si) < 0)
+ tprintf("%#lx", tcp->u_arg[2]);
+ else
+ printsiginfo(&si);
+ }
+ return 0;
+}
+
+int sys_rt_sigtimedwait(tcp)
+ struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ sigset_t sigset;
+ sigemptyset(&sigset);
+
+ if (umoven(tcp, tcp->u_arg[0], tcp->u_arg[3],
+ (char *) &sigset.__val[0]) < 0)
+ tprintf("[?]");
+ else
+ printsigmask(sigset);
+ tprintf(", ");
+ }
+ else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else {
+ siginfo_t si;
+ if (umove(tcp, tcp->u_arg[1], &si) < 0)
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printsiginfo(&si);
+ /* XXX For now */
+ tprintf(", %#lx", tcp->u_arg[2]);
+ tprintf(", %d", (int) tcp->u_arg[3]);
+ }
+ }
+ return 0;
+};
+
+#endif /* LINUX */
+
diff --git a/signalent.sh b/signalent.sh
new file mode 100644
index 000000000..de4bf6ecb
--- /dev/null
+++ b/signalent.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Copyright (c) 1996 Rick Sladkey <jrs@world.std.com>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+cat $* |
+ sed -n -e 's/\/\*.*\*\// /' -e 's/^#[ ]*define[ ][ ]*SIG\([^_ ]*\)[ ][ ]*\([0-9][0-9]*\)[ ]*$/\1 \2/p' |
+ sort +1n |
+ awk '
+ BEGIN {
+ tabs = "\t\t\t\t\t\t\t\t"
+ signal = -1;
+ }
+ $2 <= 256 {
+ if (signal == $2)
+ next
+ while (++signal < $2) {
+ n = "\"SIG_" signal "\""
+ s = "\t" n ","
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 1)/8))
+ s = s "/* " signal " */"
+ print s
+ }
+ if (signal == $2)
+ n = "\"SIG" $1 "\""
+ n = "\"SIG" $1 "\""
+ s = "\t" n ","
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 1)/8))
+ s = s "/* " signal " */"
+ print s
+ }
+ '
diff --git a/sock.c b/sock.c
new file mode 100644
index 000000000..dc0319056
--- /dev/null
+++ b/sock.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#ifdef linux
+#include <sys/socket.h>
+#else
+#include <sys/sockio.h>
+#endif
+
+#ifdef ALPHA
+#include <ioctls.h>
+#endif
+
+int
+sock_ioctl(tcp, code, arg)
+struct tcb *tcp;
+long code, arg;
+{
+ if (entering(tcp))
+ return 0;
+
+ switch (code) {
+#ifdef SIOCSHIWAT
+ case SIOCSHIWAT:
+#endif
+#ifdef SIOCGHIWAT
+ case SIOCGHIWAT:
+#endif
+#ifdef SIOCSLOWAT
+ case SIOCSLOWAT:
+#endif
+#ifdef SIOCGLOWAT
+ case SIOCGLOWAT:
+#endif
+#ifdef FIOSETOWN
+ case FIOSETOWN:
+#endif
+#ifdef FIOGETOWN
+ case FIOGETOWN:
+#endif
+#ifdef SIOCSPGRP
+ case SIOCSPGRP:
+#endif
+#ifdef SIOCGPGRP
+ case SIOCGPGRP:
+#endif
+#ifdef SIOCATMARK
+ case SIOCATMARK:
+#endif
+ printnum(tcp, arg, ", %#d");
+ return 1;
+ default:
+ return 0;
+ }
+}
diff --git a/strace.1 b/strace.1
new file mode 100644
index 000000000..5f045f966
--- /dev/null
+++ b/strace.1
@@ -0,0 +1,544 @@
+.\" Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+.\" Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+.\" Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+.\" 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. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+.\"
+.de CW
+.sp
+.nf
+.ft CW
+..
+.de CE
+.ft
+.fi
+.sp
+..
+.TH STRACE 1 "96/02/13"
+.SH NAME
+strace \- trace system calls and signals
+.SH SYNOPSIS
+.B strace
+[
+.B \-dffhiqrtttTvxx
+]
+[
+.BI \-a column
+]
+[
+.BI \-e expr
+]
+\&...
+[
+.BI \-o file
+]
+[
+.BI \-p pid
+]
+\&...
+[
+.BI \-s strsize
+]
+[
+.BI \-u username
+]
+[
+.I command
+[
+.I arg
+\&...
+]
+]
+.sp
+.B strace
+.B \-c
+[
+.BI \-e expr
+]
+\&...
+[
+.BI \-O overhead
+]
+[
+.BI \-S sortby
+]
+[
+.I command
+[
+.I arg
+\&...
+]
+]
+.SH DESCRIPTION
+.IX "strace command" "" "\fLstrace\fR command"
+.LP
+In the simplest case
+.B strace
+runs the specified
+.I command
+until it exits.
+It intercepts and records the system calls which are called
+by a process and the signals which are received by a process.
+The name of each system call, its arguments and its return value
+are printed on standard error or to the file specified with the
+.B \-o
+option.
+.LP
+.B strace
+is a useful diagnositic, instructional, and debugging tool.
+System adminstrators, diagnosticians and trouble-shooters will find
+it invaluable for solving problems with
+programs for which the source is not readily available since
+they do not need to be recompiled in order to trace them.
+Students, hackers and the overly-curious will find that
+a great deal can be learned about a system and its system calls by
+tracing even ordinary programs. And programmers will find that
+since system calls and signals are events that happen at the user/kernel
+interface, a close examination of this boundary is very
+useful for bug isolation, sanity checking and
+attempting to capture race conditions.
+.LP
+Each line in the trace contains the system call name, followed
+by its arguments in parentheses and its return value.
+An example from stracing the command ``cat /dev/null'' is:
+.CW
+open("/dev/null", O_RDONLY) = 3
+.CE
+Errors (typically a return value of \-1) have the errno symbol
+and error string appended.
+.CW
+open("/foo/bar", O_RDONLY) = -1 ENOENT (No such file or directory)
+.CE
+Signals are printed as a signal symbol and a signal string.
+An excerpt from stracing and interrupting the command ``sleep 666'' is:
+.CW
+sigsuspend([] <unfinished ...>
+--- SIGINT (Interrupt) ---
++++ killed by SIGINT +++
+.CE
+Arguments are printed in symbolic form with a passion.
+This example shows the shell peforming ``>>xyzzy'' output redirection:
+.CW
+open("xyzzy", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3
+.CE
+Here the three argument form of open is decoded by breaking down the
+flag argument into its three bitwise-OR constituents and printing the
+mode value in octal by tradition. Where traditional or native
+usage differs from ANSI or POSIX, the latter forms are preferred.
+In some cases, strace output has proven to be more readable than
+the source.
+.LP
+Structure pointers are dereferenced and the members are displayed
+as appropriate. In all cases arguments are formatted in the most C-like
+fashion possible.
+For example, the essence of the command ``ls \-l /dev/null'' is captured as:
+.CW
+lstat("/dev/null", {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
+.CE
+Notice how the `struct stat' argument is dereferenced and how each member is
+displayed symbolically. In particular, observe how the st_mode member
+is carefully decoded into a bitwise-OR of symbolic and numeric values.
+Also notice in this example that the first argument to lstat is an input
+to the system call and the second argument is an output. Since output
+arguments not modified if the system call fails, arguments may not
+always be dereferenced. For example, retrying the ``ls \-l'' example
+with a non-existent file produces the following line:
+.CW
+lstat("/foo/bar", 0xb004) = -1 ENOENT (No such file or directory)
+.CE
+In this case the porch light is on but nobody is home.
+.LP
+Character pointers are dereferenced and printed as C strings.
+Non-printing characters in strings are normally represented by
+ordinary C escape codes.
+Only the first
+.I strsize
+(32 by default) bytes of strings are printed;
+longer strings have an ellipsis appended following the closing quote.
+Here is a line from ``ls \-l'' where the getpwuid library routine is
+reading the password file:
+.CW
+read(3, "root::0:0:System Administrator:/"..., 1024) = 422
+.CE
+While structures are annotated using curly braces, simple pointers
+and arrays are printed using square brackets with commas separating
+elements. Here is an example from the command ``id'' on a system with
+supplementary group ids:
+.CW
+getgroups(32, [100, 0]) = 2
+.CE
+On the other hand, bit-sets are also shown using square brackets
+but set elements are separated only by a space. Here is the shell
+preparing to execute an external command:
+.CW
+sigprocmask(SIG_BLOCK, [CHLD TTOU], []) = 0
+.CE
+Here the second argument is a bit-set of two signals, SIGCHLD and SIGTTOU.
+In some cases the bit-set is so full that printing out the unset
+elements is more valuable. In that case, the bit-set is prefixed by
+a tilde like this:
+.CW
+sigprocmask(SIG_UNBLOCK, ~[], NULL) = 0
+.CE
+Here the second argument represents the full set of all signals.
+.SH OPTIONS
+.TP 12
+.TP
+.B \-c
+Count time, calls, and errors for each system call and report a
+summary on program exit.
+.TP
+.B \-d
+Show some debugging output of strace itself on
+.I stderr .
+.TP
+.B \-f
+Trace child processes as they are created by currently traced
+processes as a result of the fork(2) system call. The new process is
+attached to as soon as its pid is known (through the return value of
+fork(2) in the parent process). This means that such children may run
+uncontrolled for a while (especially in the case of a vfork(2)), until
+the parent is scheduled again to complete its (v)fork(2) call.
+If the parent process decides to wait(2) for a child that is currently
+being traced, it is suspended until an appropriate child process either
+terminates or incurs a signal that would cause it to terminate (as
+determined from the child's current signal disposition).
+.TP
+.B \-ff
+If the
+.B \-o
+.I filename
+option is in effect, each processes trace is written to
+.I filename.pid
+where pid is the numeric process id of each process.
+.TP
+.B \-F
+On SunOS 4.x, this option has the effect of attempting to follow
+vforks by performing some dynamic linking trickery. Otherwise,
+vforks will not be followed even if
+.B \-f
+has been given.
+.TP
+.B \-h
+Print the help summary.
+.TP
+.B \-i
+Print the instruction pointer at the time of the system call.
+.TP
+.B \-q
+Suppress messages about attaching, detaching etc. This happens
+automatically when output is redirected to a file and the command
+is run directly instead of attaching.
+.TP
+.B \-r
+Print a relative timestamp upon entry to each system call. This
+records the time difference between the beginning of successive
+system calls.
+.TP
+.B \-t
+Prefix each line of the trace with the time of day.
+.TP
+.B \-tt
+If given twice, the time printed will include the microseconds.
+.TP
+.B \-ttt
+If given thrice, the time printed will include the microseconds
+and the leading portion will be printed as the number
+of seconds since the epoch.
+.TP
+.B \-T
+Show the time spent in system calls. This records the time
+difference between the beginning and the end of each system call.
+.TP
+.B \-v
+Print unabbreviated versions of environment, stat, termios, etc.
+calls. These structures are very common in calls and so the default
+behavior displays a reasonable subset of structure members. Use
+this option to get all of the gory details.
+.TP
+.B \-V
+Print the version number of strace.
+.TP
+.B \-x
+Print all non-ascii strings in hexadecimal string format.
+.TP
+.B \-xx
+Print all strings in hexadecimal string format.
+.TP
+.BI "\-a " column
+Align return values in a secific column (default column 40).
+.TP
+.BI "\-e " expr
+A qualifying expression which modifies which events to trace
+or how to trace them. The format of the expression is:
+.br
+[qualifier=][!]value1[,value2]...
+.br
+where qualifier is one of trace, abbrev, verbose, raw, signal, read, or write
+and value is a qualifier-dependent symbol or number. The default
+qualifier is trace. Using an exclamation mark negates the set of values.
+For example \-eopen means literally \-e trace=open which in turn means
+trace only the open system call. By contrast, \-etrace=!open means
+to trace every system call except open. In addition the special values
+all and none have the obvious meanings.
+.LP
+Note that some shells use the exclamation point for history
+expansion; even inside quoted arguments. If so, you must escape
+the exclamation point with a backslash.
+.TP
+.BI "\-e trace=" set
+Trace only the specified set of system calls. The
+.B \-c
+option is useful for determining which system calls might be useful
+to trace. For example, trace=open,close,read,write means to only
+trace those four system calls. Be careful when making inferences
+about the user/kernel boundary if only a subset of system calls
+are being monitored. The default is trace=all.
+.TP
+.B "\-e trace=file"
+Trace all system calls which take a file name as an argument. You
+can think of this as an abbreviation for
+.BR "\-e trace=open,stat,chmod,unlink," ...
+which is useful to seeing what files the process is referencing.
+Furthermore, using the abbreviation will ensure that you don't
+accidentally forget to include a call like
+.B lstat
+in the list. Betchya woulda forgot that one.
+.TP
+.B "\-e trace=process"
+Trace all system calls which involve process management. This
+is useful for watching the fork, wait, and exec steps of a process.
+.TP
+.B "\-e trace=network"
+Trace all the network related system calls.
+.TP
+.B "\-e trace=signal"
+Trace all signal related system calls.
+.TP
+.B "\-e trace=ipc"
+Trace all IPC related system calls.
+.TP
+.BI "\-e abbrev=" set
+Abbreviate the output from printing each member of large structures.
+The default is abbrev=all. The
+.B \-v
+option has the effect of abbrev=none.
+.TP
+.BI "\-e verbose=" set
+Dereference structures for the specified set of system calls. The
+default is verbose=all.
+.TP
+.BI "\-e raw=" set
+Print raw, undecoded arguments for the specifed set of system calls.
+This option has the effect of causing all arguments to be printed
+in hexadecimal. This is mostly useful if you don't trust the
+decoding or you need to know the actual numeric value of an
+argument.
+.TP
+.BI "\-e signal=" set
+Trace only the specified subset of signals. The default is signal=all.
+For example signal=!SIGIO (or signal=!io) causes SIGIO signals not to
+be traced.
+.TP
+.BI "\-e read=" set
+Perform a full hexadecimal and ascii dump of all the data read from
+file descriptors listed in the specified set. For example, to see
+all input activity on file descriptors 3 and 5 use
+.BR "\-e read=3,5" .
+Note that this is independent from the normal tracing of the read
+system call which is controlled by the option
+.BR "\-e trace=read" .
+.TP
+.BI "\-e write=" set
+Perform a full hexadecimal and ascii dump of all the data written to
+file descriptors listed in the specified set. For example, to see
+all output activity on file descriptors 3 and 5 use
+.BR "\-e write=3,5" .
+Note that this is independent from the normal tracing of the write
+system call which is controlled by the option
+.BR "\-e trace=write" .
+.TP
+.BI "\-o " filename
+Write the trace output to the file
+.I filename
+rather than to stderr.
+Use
+.I filename.pid
+if
+.B \-ff
+is used.
+If the argument begins with `|' or with `!' then the rest of the
+argument is treated as a command and all output is piped to it.
+This is convenient for piping the debugging output to a program
+without affecting the redirections of executed programs.
+.TP
+.BI "\-O " overhead
+Set the overhead for tracing system calls to overhead microseconds.
+This is useful for overriding the default heuristic for guessing
+how much time is spent in mere measuring when timing system calls using
+the
+.B \-c
+option. The acuracy of the heuristic can be gauged by timing a given
+program run without tracing (using time(1)) and comparing the accumulated
+system call time to the total produced using
+.B \-c .
+.TP
+.BI "\-p " pid
+Attach to the process with the process
+.SM ID
+.I pid
+and begin tracing.
+The trace may be terminated
+at any time by a keyboard interrupt signal (\c
+.SM CTRL\s0-C).
+.B strace
+will respond by detaching itself from the traced process(es)
+leaving it (them) to continue running.
+Multiple
+.B \-p
+options can be used to attach to up to 32 processes in addition to
+.I command
+(which is optional if at least one
+.B \-p
+option is given).
+.TP
+.BI "\-s " strsize
+Specify the maximum string size to print (the default is 32). Note
+that filenames are not considered strings and are always printed in
+full.
+.TP
+.BI "\-S " sortby
+Sort the output of the histogram printed by the
+.B \-c
+option by the specified critereon. Legal values are
+time, calls, name, and nothing (default time).
+.TP
+.BI "\-u " username
+Run command with the userid, groupid and supplementary groups of
+.IR username .
+This option is only useful when running as root and enables the
+correct execution of setuid and/or setgid binaries.
+Unless this option is used setuid and setgid programs are executed
+without effective privileges.
+.SH "SETUID INSTALLATION"
+If
+.B strace
+is installed setuid to root then the invoking user will be able to
+attach to and trace processes owned by any user.
+In addition setuid and setgid programs will be executed and traced
+with the correct effective privileges.
+Since only users trusted with full root privileges should be allowed
+to do these things,
+it only makes sense to install
+.B strace
+as setuid to root when the users who can execute it are restricted
+to those users who have this trust.
+For example, it makes sense to install a special version of
+.B
+strace
+with mode `rwsr-xr--', user root and group trace,
+where members of the trace group are trusted users.
+If you do use this feature, please remember to install
+a non-setuid version of strace for ordinary lusers to use.
+.SH "SEE ALSO"
+.BR ptrace(2) ,
+.BR proc(4) ,
+.BR time(1) ,
+.BR trace(1) ,
+.BR truss(1)
+.SH NOTES
+It is a pity that so much tracing clutter is produced by systems
+employing shared libraries.
+.LP
+It is instructive to think about system call inputs and outputs
+as data-flow across the user/kernel boundary. Because user-space
+and kernel-space are separate and address-protected, it is
+sometimes possible to make deductive inferences about process
+behavior using inputs and outputs as propositions.
+.LP
+In some cases, a system call will differ from the documented behavior
+or have a different name. For example, on System V derived systems
+the true time(2) system call does not take an argument and the stat
+function is called xstat and takes an extra leading argument. These
+discrepancies are normal but idiosyncratic characteristics of the
+system call interface and are accounted for by C library wrapper
+functions.
+.LP
+On some platforms a process that has a system call trace applied
+to it with the
+.B \-p
+option will receive a
+.BR \s-1SIGSTOP\s0 .
+This signal may interrupt a system call that is not restartable.
+This may have an unpredictable effect on the process
+if the process takes no action to restart the system call.
+.SH BUGS
+Programs that use the
+.I setuid
+bit do not have
+effective user
+.SM ID
+privileges while being traced.
+.LP
+A traced process ignores
+.SM SIGSTOP
+except of SVR4 platforms.
+.LP
+A traced process which tries to block SIGTRAP will be sent a SIGSTOP
+in an attempt to force continuation of tracing.
+.LP
+A traced process runs slowly.
+.LP
+Traced processes which are descended from
+.I command
+may be left running after an interrupt signal (\c
+.SM CTRL\s0-C).
+.LP
+On Linux, exciting as it would be, tracing the init process is forbidden.
+.LP
+The
+.B \-i
+option is weakly supported.
+.SH HISTORY
+.B strace
+The original strace was written by Paul Kranenburg
+for SunOS and was inspired by its trace utility.
+The SunOS version of strace was ported to Linux and enhanced
+by Branko Lankester, who also wrote the Linux kernel support.
+Even though Paul released strace 2.5 in 1992,
+Branko's work was based on Paul's strace 1.5 release from 1991.
+In 1993, Rick Sladkey merged strace 2.5 for SunOS and the
+second release of strace for Linux, added many of the features of
+truss from SVR4, and produced an strace that worked on both platforms.
+In 1994 Rick ported strace to SVR4 and Solaris and wrote the
+automatic configuration support. In 1995 he ported strace to Irix
+and tired of writing about himself in the third person.
+.SH PROBLEMS
+Problems with
+.B strace
+should be reported to the current
+.B strace
+maintainer, Rick Sladkey, at <jrs@world.std.com>.
diff --git a/strace.c b/strace.c
new file mode 100644
index 000000000..5b23f810d
--- /dev/null
+++ b/strace.c
@@ -0,0 +1,1653 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <signal.h>
+#include <errno.h>
+#include <sys/param.h>
+#include <fcntl.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <pwd.h>
+#include <grp.h>
+#include <string.h>
+
+#ifdef SVR4
+#include <sys/stropts.h>
+#include <poll.h>
+#endif
+
+int debug = 0, followfork = 0, followvfork = 0, interactive = 0;
+int rflag = 0, tflag = 0, dtime = 0, cflag = 0;
+int iflag = 0, xflag = 0, qflag = 0;
+int pflag_seen = 0;
+
+char *username = NULL;
+uid_t run_uid;
+gid_t run_gid;
+
+int acolumn = DEFAULT_ACOLUMN;
+int max_strlen = DEFAULT_STRLEN;
+char *outfname = NULL;
+FILE *outf;
+struct tcb tcbtab[MAX_PROCS];
+int nprocs;
+char *progname;
+extern char version[];
+extern char **environ;
+
+static struct tcb *pid2tcb P((int pid));
+static int trace P((void));
+static void cleanup P((void));
+static void interrupt P((int sig));
+static sigset_t empty_set, blocked_set;
+
+#ifdef HAVE_SIG_ATOMIC_T
+static volatile sig_atomic_t interrupted;
+#else /* !HAVE_SIG_ATOMIC_T */
+#ifdef __STDC__
+static volatile int interrupted;
+#else /* !__STDC__ */
+static int interrupted;
+#endif /* !__STDC__ */
+#endif /* !HAVE_SIG_ATOMIC_T */
+
+#ifdef SVR4
+
+static struct tcb *pfd2tcb P((int pfd));
+static void reaper P((int sig));
+static void rebuild_pollv P((void));
+struct pollfd pollv[MAX_PROCS];
+
+#ifndef HAVE_POLLABLE_PROCFS
+
+static void proc_poll_open P((void));
+static void proc_poller P((int pfd));
+
+struct proc_pollfd {
+ int fd;
+ int revents;
+ int pid;
+};
+
+static int poller_pid;
+static int proc_poll_pipe[2] = { -1, -1 };
+
+#endif /* !HAVE_POLLABLE_PROCFS */
+
+#endif /* SVR4 */
+
+static void
+usage(ofp, exitval)
+FILE *ofp;
+int exitval;
+{
+ fprintf(ofp, "\
+usage: strace [-dffhiqrtttTvVxx] [-a column] [-e expr] ... [-o file]\n\
+ [-p pid] ... [-s strsize] [-u username] [command [arg ...]]\n\
+ or: strace -c [-e expr] ... [-O overhead] [-S sortby] [command [arg ...]]\n\
+-c -- count time, calls, and errors for each syscall and report summary\n\
+-f -- follow forks, -ff -- with output into separate files\n\
+-F -- attempt to follow vforks, -h -- print help message\n\
+-i -- print instruction pointer at time of syscall\n\
+-q -- suppress messages about attaching, detaching, etc.\n\
+-r -- print relative timestamp, -t -- absolute timestamp, -tt -- with usecs\n\
+-T -- print time spent in each syscall, -V -- print version\n\
+-v -- verbose mode: print unabbreviated argv, stat, termio[s], etc. args\n\
+-x -- print non-ascii strings in hex, -xx -- print all strings in hex\n\
+-a column -- alignment COLUMN for printing syscall results (default %d)\n\
+-e expr -- a qualifying expression: option=[!]all or option=[!]val1[,val2]...\n\
+ options: trace, abbrev, verbose, raw, signal, read, or write\n\
+-o file -- send trace output to FILE instead of stderr\n\
+-O overhead -- set overhead for tracing syscalls to OVERHEAD usecs\n\
+-p pid -- trace process with process id PID, may be repeated\n\
+-s strsize -- limit length of print strings to STRSIZE chars (default %d)\n\
+-S sortby -- sort syscall counts by: time, calls, name, nothing (default %s)\n\
+-u username -- run command as username handling setuid and/or setgid\n\
+", DEFAULT_ACOLUMN, DEFAULT_STRLEN, DEFAULT_SORTBY);
+ exit(exitval);
+}
+
+#ifdef SVR4
+#ifdef MIPS
+void
+foobar()
+{
+}
+#endif /* MIPS */
+#endif /* SVR4 */
+
+int
+main(argc, argv)
+int argc;
+char *argv[];
+{
+ extern int optind;
+ extern char *optarg;
+ struct tcb *tcp;
+ int c, pid = 0;
+ struct sigaction sa;
+
+ static char buf[BUFSIZ];
+
+ progname = argv[0];
+ outf = stderr;
+ interactive = 1;
+ qualify("trace=all");
+ qualify("abbrev=all");
+ qualify("verbose=all");
+ qualify("signal=all");
+ set_sortby(DEFAULT_SORTBY);
+ set_personality(DEFAULT_PERSONALITY);
+ while ((c = getopt(argc, argv,
+ "+cdfFhiqrtTvVxa:e:o:O:p:s:S:u:")) != EOF) {
+ switch (c) {
+ case 'c':
+ cflag++;
+ dtime++;
+ break;
+ case 'd':
+ debug++;
+ break;
+ case 'f':
+ followfork++;
+ break;
+ case 'F':
+ followvfork++;
+ break;
+ case 'h':
+ usage(stdout, 0);
+ break;
+ case 'i':
+ iflag++;
+ break;
+ case 'q':
+ qflag++;
+ break;
+ case 'r':
+ rflag++;
+ tflag++;
+ break;
+ case 't':
+ tflag++;
+ break;
+ case 'T':
+ dtime++;
+ break;
+ case 'x':
+ xflag++;
+ break;
+ case 'v':
+ qualify("abbrev=none");
+ break;
+ case 'V':
+ printf("%s\n", version);
+ exit(0);
+ break;
+ case 'a':
+ acolumn = atoi(optarg);
+ break;
+ case 'e':
+ qualify(optarg);
+ break;
+ case 'o':
+ outfname = strdup(optarg);
+ break;
+ case 'O':
+ set_overhead(atoi(optarg));
+ break;
+ case 'p':
+ if ((pid = atoi(optarg)) == 0) {
+ fprintf(stderr, "%s: Invalid process id: %s\n",
+ progname, optarg);
+ break;
+ }
+ if (pid == getpid()) {
+ fprintf(stderr, "%s: I'm sorry, I can't let you do that, Dave.", progname);
+ break;
+ }
+ if ((tcp = alloctcb(pid)) == NULL) {
+ fprintf(stderr, "%s: tcb table full, please recompile strace\n",
+ progname);
+ exit(1);
+ }
+ tcp->flags |= TCB_ATTACHED;
+ pflag_seen++;
+ break;
+ case 's':
+ max_strlen = atoi(optarg);
+ break;
+ case 'S':
+ set_sortby(optarg);
+ break;
+ case 'u':
+ username = strdup(optarg);
+ break;
+ default:
+ usage(stderr, 1);
+ break;
+ }
+ }
+
+ /* See if they want to run as another user. */
+ if (username != NULL) {
+ struct passwd *pent;
+
+ if (getuid() != 0 || geteuid() != 0) {
+ fprintf(stderr,
+ "%s: you must be root to use the -u option\n",
+ progname);
+ exit(1);
+ }
+ if ((pent = getpwnam(username)) == NULL) {
+ fprintf(stderr, "%s: cannot find user `%s'\n",
+ progname, optarg);
+ exit(1);
+ }
+ run_uid = pent->pw_uid;
+ run_gid = pent->pw_gid;
+ }
+ else {
+ run_uid = getuid();
+ run_gid = getgid();
+ }
+
+#ifndef SVR4
+ setreuid(geteuid(), getuid());
+#endif
+
+ /* See if they want to pipe the output. */
+ if (outfname && (outfname[0] == '|' || outfname[0] == '!')) {
+ if ((outf = popen(outfname + 1, "w")) == NULL) {
+ fprintf(stderr, "%s: can't popen '%s': %s\n",
+ progname, outfname + 1, strerror(errno));
+ exit(1);
+ }
+ free(outfname);
+ outfname = NULL;
+ }
+
+ /* Check if they want to redirect the output. */
+ if (outfname) {
+ if ((outf = fopen(outfname, "w")) == NULL) {
+ fprintf(stderr, "%s: can't fopen '%s': %s\n",
+ progname, outfname, strerror(errno));
+ exit(1);
+ }
+ }
+
+#ifndef SVR4
+ setreuid(geteuid(), getuid());
+#endif
+
+ if (!outfname) {
+ qflag = 1;
+ setvbuf(outf, buf, _IOLBF, BUFSIZ);
+ }
+ else if (optind < argc)
+ interactive = 0;
+ else
+ qflag = 1;
+
+ for (c = 0, tcp = tcbtab; c < MAX_PROCS; c++, tcp++) {
+ /* Reinitialize the output since it may have changed. */
+ tcp->outf = outf;
+ if (!(tcp->flags & TCB_INUSE) || !(tcp->flags & TCB_ATTACHED))
+ continue;
+#ifdef SVR4
+ if (proc_open(tcp, 1) < 0) {
+ fprintf(stderr, "trouble opening proc file\n");
+ droptcb(tcp);
+ continue;
+ }
+#else /* !SVR4 */
+ if (ptrace(PTRACE_ATTACH, tcp->pid, (char *) 1, 0) < 0) {
+ perror("attach: ptrace(PTRACE_ATTACH, ...)");
+ droptcb(tcp);
+ continue;
+ }
+#endif /* !SVR4 */
+ if (!qflag)
+ fprintf(stderr,
+ "Process %u attached - interrupt to quit\n",
+ pid);
+ }
+
+ if (optind < argc) {
+ struct stat statbuf;
+ char *filename;
+ char pathname[MAXPATHLEN];
+
+ filename = argv[optind];
+ if (strchr(filename, '/'))
+ strcpy(pathname, filename);
+#ifdef USE_DEBUGGING_EXEC
+ /*
+ * Debuggers customarily check the current directory
+ * first regardless of the path but doing that gives
+ * security geeks a panic attack.
+ */
+ else if (stat(filename, &statbuf) == 0)
+ strcpy(pathname, filename);
+#endif /* USE_DEBUGGING_EXEC */
+ else {
+ char *path;
+ int m, n, len;
+
+ for (path = getenv("PATH"); path && *path; path += m) {
+ if (strchr(path, ':')) {
+ n = strchr(path, ':') - path;
+ m = n + 1;
+ }
+ else
+ m = n = strlen(path);
+ if (n == 0) {
+ getcwd(pathname, MAXPATHLEN);
+ len = strlen(pathname);
+ }
+ else {
+ strncpy(pathname, path, n);
+ len = n;
+ }
+ if (len && pathname[len - 1] != '/')
+ pathname[len++] = '/';
+ strcpy(pathname + len, filename);
+ if (stat(pathname, &statbuf) == 0)
+ break;
+ }
+ }
+ if (stat(pathname, &statbuf) < 0) {
+ fprintf(stderr, "%s: %s: command not found\n",
+ progname, filename);
+ exit(1);
+ }
+ switch (pid = fork()) {
+ case -1:
+ perror("strace: fork");
+ cleanup();
+ exit(1);
+ break;
+ case 0: {
+#ifdef SVR4
+#ifdef MIPS
+ /* Kludge for SGI, see proc_open for details. */
+ sa.sa_handler = foobar;
+ sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGINT, &sa, NULL);
+#endif /* MIPS */
+ pause();
+#else /* !SVR4 */
+ if (ptrace(PTRACE_TRACEME, 0, (char *) 1, 0) < 0) {
+ perror("strace: ptrace(PTRACE_TRACEME, ...)");
+ return -1;
+ }
+ if (debug)
+ kill(getpid(), SIGSTOP);
+
+ if (username != NULL || geteuid() == 0) {
+ uid_t run_euid = run_uid;
+ gid_t run_egid = run_gid;
+
+ if (statbuf.st_mode & S_ISUID)
+ run_euid = statbuf.st_uid;
+ if (statbuf.st_mode & S_ISGID)
+ run_egid = statbuf.st_gid;
+
+ /*
+ * It is important to set groups before we
+ * lose privileges on setuid.
+ */
+ if (username != NULL
+ && initgroups(username, run_gid) < 0) {
+ perror("initgroups");
+ exit(1);
+ }
+ if (setregid(run_gid, run_egid) < 0) {
+ perror("setregid");
+ exit(1);
+ }
+ if (setreuid(run_uid, run_euid) < 0) {
+ perror("setreuid");
+ exit(1);
+ }
+ }
+ else
+ setreuid(run_uid, run_uid);
+#endif /* !SVR4 */
+
+ execv(pathname, &argv[optind]);
+ perror("strace: exec");
+ _exit(1);
+ break;
+ }
+ default:
+ if ((tcp = alloctcb(pid)) == NULL) {
+ fprintf(stderr, "tcb table full\n");
+ cleanup();
+ exit(1);
+ }
+#ifdef SVR4
+ if (proc_open(tcp, 0) < 0) {
+ fprintf(stderr, "trouble opening proc file\n");
+ cleanup();
+ exit(1);
+ }
+#endif /* SVR4 */
+#ifndef SVR4
+ fake_execve(tcp, pathname, &argv[optind], environ);
+#endif
+ break;
+ }
+ }
+ else if (pflag_seen == 0)
+ usage(stderr, 1);
+
+ sigemptyset(&empty_set);
+ sigemptyset(&blocked_set);
+ sa.sa_handler = SIG_IGN;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sigaction(SIGTTOU, &sa, NULL);
+ sigaction(SIGTTIN, &sa, NULL);
+ if (interactive) {
+ sigaddset(&blocked_set, SIGHUP);
+ sigaddset(&blocked_set, SIGINT);
+ sigaddset(&blocked_set, SIGQUIT);
+ sigaddset(&blocked_set, SIGPIPE);
+ sigaddset(&blocked_set, SIGTERM);
+ sa.sa_handler = interrupt;
+#ifdef SUNOS4
+ /* POSIX signals on sunos4.1 are a little broken. */
+ sa.sa_flags = SA_INTERRUPT;
+#endif /* SUNOS4 */
+ }
+ sigaction(SIGHUP, &sa, NULL);
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGQUIT, &sa, NULL);
+ sigaction(SIGPIPE, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+#ifdef SVR4
+ sa.sa_handler = reaper;
+ sigaction(SIGCHLD, &sa, NULL);
+#endif /* SVR4 */
+
+ if (trace() < 0)
+ exit(1);
+ cleanup();
+ exit(0);
+}
+
+void
+newoutf(tcp)
+struct tcb *tcp;
+{
+ char name[MAXPATHLEN];
+ FILE *fp;
+
+ if (outfname && followfork > 1) {
+ sprintf(name, "%s.%u", outfname, tcp->pid);
+#ifndef SVR4
+ setreuid(geteuid(), getuid());
+#endif
+ fp = fopen(name, "w");
+#ifndef SVR4
+ setreuid(geteuid(), getuid());
+#endif
+ if (fp == NULL) {
+ perror("fopen");
+ return;
+ }
+ tcp->outf = fp;
+ }
+ return;
+}
+
+struct tcb *
+alloctcb(pid)
+int pid;
+{
+ int i;
+ struct tcb *tcp;
+
+ for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
+ if ((tcp->flags & TCB_INUSE) == 0) {
+ tcp->pid = pid;
+ tcp->parent = NULL;
+ tcp->nchildren = 0;
+ tcp->flags = TCB_INUSE | TCB_STARTUP;
+ tcp->outf = outf; /* Initialise to current out file */
+ tcp->stime.tv_sec = 0;
+ tcp->stime.tv_usec = 0;
+ tcp->pfd = -1;
+ nprocs++;
+ return tcp;
+ }
+ }
+ return NULL;
+}
+
+#ifdef SVR4
+
+int
+proc_open(tcp, attaching)
+struct tcb *tcp;
+int attaching;
+{
+ char proc[32];
+ long arg;
+ sysset_t sc_enter, sc_exit;
+ sigset_t signals;
+ fltset_t faults;
+#ifndef MIPS
+ prrun_t run;
+#endif
+#ifndef HAVE_POLLABLE_PROCFS
+ static int last_pfd;
+#endif
+
+ /* Open the process pseudo-file in /proc. */
+ sprintf(proc, "/proc/%d", tcp->pid);
+ if ((tcp->pfd = open(proc, O_RDWR|O_EXCL)) < 0) {
+ perror("strace: open(\"/proc/...\", ...)");
+ return -1;
+ }
+ rebuild_pollv();
+ if (!attaching) {
+ /*
+ * Wait for the child to pause. Because of a race
+ * condition we have to poll for the event.
+ */
+ for (;;) {
+ if (ioctl(tcp->pfd, PIOCSTATUS, &tcp->status) < 0) {
+ perror("strace: PIOCSTATUS");
+ return -1;
+ }
+ if (tcp->status.pr_flags & PR_ASLEEP)
+ break;
+ }
+ }
+ /* Stop the process so that we own the stop. */
+ if (ioctl(tcp->pfd, PIOCSTOP, &tcp->status) < 0) {
+ perror("strace: PIOCSTOP");
+ return -1;
+ }
+ if ((arg = fcntl(tcp->pfd, F_GETFD)) < 0) {
+ perror("F_GETFD");
+ return -1;
+ }
+ if (fcntl(tcp->pfd, F_SETFD, arg|FD_CLOEXEC) < 0) {
+ perror("F_SETFD");
+ return -1;
+ }
+#ifdef PIOCSET
+ /* Set Run-on-Last-Close. */
+ arg = PR_RLC;
+ if (ioctl(tcp->pfd, PIOCSET, &arg) < 0) {
+ perror("PIOCSET PR_RLC");
+ return -1;
+ }
+ /* Set or Reset Inherit-on-Fork. */
+ arg = PR_FORK;
+ if (ioctl(tcp->pfd, followfork ? PIOCSET : PIOCRESET, &arg) < 0) {
+ perror("PIOC{SET,RESET} PR_FORK");
+ return -1;
+ }
+#else /* !PIOCSET */
+ if (ioctl(tcp->pfd, PIOCSRLC) < 0) {
+ perror("PIOCSRLC");
+ return -1;
+ }
+ if (ioctl(tcp->pfd, followfork ? PIOCSFORK : PIOCRFORK) < 0) {
+ perror("PIOC{S,R}FORK");
+ return -1;
+ }
+#endif /* !PIOCSET */
+ /* Enable all syscall entries. */
+ prfillset(&sc_enter);
+ if (ioctl(tcp->pfd, PIOCSENTRY, &sc_enter) < 0) {
+ perror("PIOCSENTRY");
+ return -1;
+ }
+ /* Enable all syscall exits. */
+ prfillset(&sc_exit);
+ if (ioctl(tcp->pfd, PIOCSEXIT, &sc_exit) < 0) {
+ perror("PIOSEXIT");
+ return -1;
+ }
+ /* Enable all signals. */
+ prfillset(&signals);
+ if (ioctl(tcp->pfd, PIOCSTRACE, &signals) < 0) {
+ perror("PIOCSTRACE");
+ return -1;
+ }
+ /* Enable all faults. */
+ prfillset(&faults);
+ if (ioctl(tcp->pfd, PIOCSFAULT, &faults) < 0) {
+ perror("PIOCSFAULT");
+ return -1;
+ }
+ if (!attaching) {
+#ifdef MIPS
+ /*
+ * The SGI PRSABORT doesn't work for pause() so
+ * we send it a caught signal to wake it up.
+ */
+ kill(tcp->pid, SIGINT);
+#else /* !MIPS */
+ /* The child is in a pause(), abort it. */
+ run.pr_flags = PRSABORT;
+ if (ioctl(tcp->pfd, PIOCRUN, &run) < 0) {
+ perror("PIOCRUN");
+ return -1;
+ }
+#endif /* !MIPS */
+ for (;;) {
+ /* Wait for the child to do something. */
+ if (ioctl(tcp->pfd, PIOCWSTOP, &tcp->status) < 0) {
+ perror("PIOCWSTOP");
+ return -1;
+ }
+ if (tcp->status.pr_why == PR_SYSENTRY) {
+#ifdef HAVE_PR_SYSCALL
+ int scno = tcp->status.pr_syscall;
+#else /* !HAVE_PR_SYSCALL */
+ int scno = tcp->status.pr_what;
+#endif /* !HAVE_PR_SYSCALL */
+ if (scno == SYS_execve)
+ break;
+ }
+ /* Set it running: maybe execve will be next. */
+ if (ioctl(tcp->pfd, PIOCRUN, NULL) < 0) {
+ perror("PIOCRUN");
+ return -1;
+ }
+ }
+ }
+#ifndef HAVE_POLLABLE_PROCFS
+ if (proc_poll_pipe[0] != -1)
+ proc_poller(tcp->pfd);
+ else if (nprocs > 1) {
+ proc_poll_open();
+ proc_poller(last_pfd);
+ proc_poller(tcp->pfd);
+ }
+ last_pfd = tcp->pfd;
+#endif /* !HAVE_POLLABLE_PROCFS */
+ return 0;
+}
+
+#endif /* SVR4 */
+
+static struct tcb *
+pid2tcb(pid)
+int pid;
+{
+ int i;
+ struct tcb *tcp;
+
+ for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
+ if (pid && tcp->pid != pid)
+ continue;
+ if (tcp->flags & TCB_INUSE)
+ return tcp;
+ }
+ return NULL;
+}
+
+#ifdef SVR4
+
+static struct tcb *
+pfd2tcb(pfd)
+int pfd;
+{
+ int i;
+ struct tcb *tcp;
+
+ for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
+ if (tcp->pfd != pfd)
+ continue;
+ if (tcp->flags & TCB_INUSE)
+ return tcp;
+ }
+ return NULL;
+}
+
+#endif /* SVR4 */
+
+void
+droptcb(tcp)
+struct tcb *tcp;
+{
+ if (tcp->pid == 0)
+ return;
+ nprocs--;
+ tcp->pid = 0;
+ tcp->flags = 0;
+ if (tcp->pfd != -1) {
+ close(tcp->pfd);
+ tcp->pfd = -1;
+#ifdef SVR4
+ rebuild_pollv();
+#endif
+ }
+ if (tcp->parent != NULL) {
+ tcp->parent->nchildren--;
+ tcp->parent = NULL;
+ }
+#if 0
+ if (tcp->outf != stderr)
+ fclose(tcp->outf);
+#endif
+ tcp->outf = 0;
+}
+
+#ifndef SVR4
+
+static int
+resume(tcp)
+struct tcb *tcp;
+{
+ if (tcp == NULL)
+ return -1;
+
+ if (!(tcp->flags & TCB_SUSPENDED)) {
+ fprintf(stderr, "PANIC: pid %u not suspended\n", tcp->pid);
+ return -1;
+ }
+ tcp->flags &= ~TCB_SUSPENDED;
+
+ if (ptrace(PTRACE_SYSCALL, tcp->pid, (char *) 1, 0) < 0) {
+ perror("resume: ptrace(PTRACE_SYSCALL, ...)");
+ return -1;
+ }
+
+ if (!qflag)
+ fprintf(stderr, "Process %u resumed\n", tcp->pid);
+ return 0;
+}
+
+#endif /* !SVR4 */
+
+/* detach traced process; continue with sig */
+
+static int
+detach(tcp, sig)
+struct tcb *tcp;
+int sig;
+{
+ int error = 0;
+#ifdef LINUX
+ int status;
+#endif
+
+ if (tcp->flags & TCB_BPTSET)
+ sig = SIGKILL;
+
+#ifdef LINUX
+ /*
+ * Linux wrongly insists the child be stopped
+ * before detaching. Arghh. We go through hoops
+ * to make a clean break of things.
+ */
+ if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) == 0) {
+ /* On a clear day, you can see forever. */
+ }
+ else if (errno != ESRCH) {
+ /* Shouldn't happen. */
+ perror("detach: ptrace(PTRACE_DETACH, ...)");
+ }
+ else if (kill(tcp->pid, 0) < 0) {
+ if (errno != ESRCH)
+ perror("detach: checking sanity");
+ }
+ else if (kill(tcp->pid, SIGSTOP) < 0) {
+ if (errno != ESRCH)
+ perror("detach: stopping child");
+ }
+ else {
+ for (;;) {
+ if (waitpid(tcp->pid, &status, 0) < 0) {
+ if (errno != ECHILD)
+ perror("detach: waiting");
+ break;
+ }
+ if (!WIFSTOPPED(status)) {
+ /* Au revoir, mon ami. */
+ break;
+ }
+ if (WSTOPSIG(status) == SIGSTOP) {
+ if ((error = ptrace(PTRACE_DETACH,
+ tcp->pid, (char *) 1, sig)) < 0) {
+ if (errno != ESRCH)
+ perror("detach: ptrace(PTRACE_DETACH, ...)");
+ /* I died trying. */
+ }
+ break;
+ }
+ if ((error = ptrace(PTRACE_CONT, tcp->pid, (char *) 1,
+ WSTOPSIG(status) == SIGTRAP ?
+ 0 : WSTOPSIG(status))) < 0) {
+ if (errno != ESRCH)
+ perror("detach: ptrace(PTRACE_CONT, ...)");
+ break;
+ }
+ }
+ }
+#endif /* LINUX */
+
+#if defined(SUNOS4)
+ /* PTRACE_DETACH won't respect `sig' argument, so we post it here. */
+ if (sig && kill(tcp->pid, sig) < 0)
+ perror("detach: kill");
+ sig = 0;
+ if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) < 0)
+ perror("detach: ptrace(PTRACE_DETACH, ...)");
+#endif /* SUNOS4 */
+
+#ifndef SVR4
+ if (waiting_parent(tcp))
+ error = resume(tcp->parent);
+#endif /* !SVR4 */
+
+ if (!qflag)
+ fprintf(stderr, "Process %u detached\n", tcp->pid);
+
+ droptcb(tcp);
+ return error;
+}
+
+#ifdef SVR4
+
+static void
+reaper(sig)
+int sig;
+{
+ int pid;
+ int status;
+
+ while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
+#if 0
+ struct tcb *tcp;
+
+ tcp = pid2tcb(pid);
+ if (tcp)
+ droptcb(tcp);
+#endif
+ }
+}
+
+#endif /* SVR4 */
+
+static void
+cleanup()
+{
+ int i;
+ struct tcb *tcp;
+
+ for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
+ if (!(tcp->flags & TCB_INUSE))
+ continue;
+ if (debug)
+ fprintf(stderr,
+ "cleanup: looking at pid %u\n", tcp->pid);
+ if (tcp_last &&
+ (!outfname || followfork < 2 || tcp_last == tcp)) {
+ tprintf(" <unfinished ...>\n");
+ tcp_last = NULL;
+ }
+ if (tcp->flags & TCB_ATTACHED)
+ detach(tcp, 0);
+ else {
+ kill(tcp->pid, SIGCONT);
+ kill(tcp->pid, SIGTERM);
+ }
+ }
+ if (cflag)
+ call_summary(outf);
+}
+
+static void
+interrupt(sig)
+int sig;
+{
+ interrupted = 1;
+}
+
+#ifndef HAVE_STRERROR
+
+#ifndef SYS_ERRLIST_DECLARED
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif /* SYS_ERRLIST_DECLARED */
+
+const char *
+strerror(errno)
+int errno;
+{
+ static char buf[64];
+
+ if (errno < 1 || errno >= sys_nerr) {
+ sprintf(buf, "Unknown error %d", errno);
+ return buf;
+ }
+ return sys_errlist[errno];
+}
+
+#endif /* HAVE_STERRROR */
+
+#ifndef HAVE_STRSIGNAL
+
+#ifndef SYS_SIGLIST_DECLARED
+#ifdef HAVE__SYS_SIGLIST
+ extern char *_sys_siglist[];
+#else
+ extern char *sys_siglist[];
+#endif
+#endif /* SYS_SIGLIST_DECLARED */
+
+const char *
+strsignal(sig)
+int sig;
+{
+ static char buf[64];
+
+ if (sig < 1 || sig >= NSIG) {
+ sprintf(buf, "Unknown signal %d", sig);
+ return buf;
+ }
+#ifdef HAVE__SYS_SIGLIST
+ return _sys_siglist[sig];
+#else
+ return sys_siglist[sig];
+#endif
+}
+
+#endif /* HAVE_STRSIGNAL */
+
+#ifdef SVR4
+
+static void
+rebuild_pollv()
+{
+ int i, j;
+ struct tcb *tcp;
+
+ for (i = j = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
+ if (!(tcp->flags & TCB_INUSE))
+ continue;
+ pollv[j].fd = tcp->pfd;
+ pollv[j].events = POLLPRI;
+ j++;
+ }
+ if (j != nprocs) {
+ fprintf(stderr, "strace: proc miscount\n");
+ exit(1);
+ }
+}
+
+#ifndef HAVE_POLLABLE_PROCFS
+
+static void
+proc_poll_open()
+{
+ int arg;
+ int i;
+
+ if (pipe(proc_poll_pipe) < 0) {
+ perror("pipe");
+ exit(1);
+ }
+ for (i = 0; i < 2; i++) {
+ if ((arg = fcntl(proc_poll_pipe[i], F_GETFD)) < 0) {
+ perror("F_GETFD");
+ exit(1);
+ }
+ if (fcntl(proc_poll_pipe[i], F_SETFD, arg|FD_CLOEXEC) < 0) {
+ perror("F_SETFD");
+ exit(1);
+ }
+ }
+}
+
+static int
+proc_poll(pollv, nfds, timeout)
+struct pollfd *pollv;
+int nfds;
+int timeout;
+{
+ int i;
+ int n;
+ struct proc_pollfd pollinfo;
+
+ if ((n = read(proc_poll_pipe[0], &pollinfo, sizeof(pollinfo))) < 0)
+ return n;
+ if (n != sizeof(struct proc_pollfd)) {
+ fprintf(stderr, "panic: short read: %d\n", n);
+ exit(1);
+ }
+ for (i = 0; i < nprocs; i++) {
+ if (pollv[i].fd == pollinfo.fd)
+ pollv[i].revents = pollinfo.revents;
+ else
+ pollv[i].revents = 0;
+ }
+ poller_pid = pollinfo.pid;
+ return 1;
+}
+
+static void
+wakeup_handler(sig)
+int sig;
+{
+}
+
+static void
+proc_poller(pfd)
+int pfd;
+{
+ struct proc_pollfd pollinfo;
+ struct sigaction sa;
+ sigset_t blocked_set, empty_set;
+ int i;
+ int n;
+ struct rlimit rl;
+
+ switch (fork()) {
+ case -1:
+ perror("fork");
+ _exit(0);
+ case 0:
+ break;
+ default:
+ return;
+ }
+
+ sa.sa_handler = interactive ? SIG_DFL : SIG_IGN;
+ sa.sa_flags = 0;
+ sigemptyset(&sa.sa_mask);
+ sigaction(SIGHUP, &sa, NULL);
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGQUIT, &sa, NULL);
+ sigaction(SIGPIPE, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+ sa.sa_handler = wakeup_handler;
+ sigaction(SIGUSR1, &sa, NULL);
+ sigemptyset(&blocked_set);
+ sigaddset(&blocked_set, SIGUSR1);
+ sigprocmask(SIG_BLOCK, &blocked_set, NULL);
+ sigemptyset(&empty_set);
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
+ perror("getrlimit(RLIMIT_NOFILE, ...)");
+ _exit(0);
+ }
+ n = rl.rlim_cur;
+ for (i = 0; i < n; i++) {
+ if (i != pfd && i != proc_poll_pipe[1])
+ close(i);
+ }
+
+ pollinfo.fd = pfd;
+ pollinfo.pid = getpid();
+ for (;;) {
+ if (ioctl(pfd, PIOCWSTOP, NULL) < 0) {
+ switch (errno) {
+ case EINTR:
+ continue;
+ case EBADF:
+ pollinfo.revents = POLLERR;
+ break;
+ case ENOENT:
+ pollinfo.revents = POLLHUP;
+ break;
+ default:
+ perror("proc_poller: PIOCWSTOP");
+ }
+ write(proc_poll_pipe[1], &pollinfo, sizeof(pollinfo));
+ _exit(0);
+ }
+ pollinfo.revents = POLLPRI;
+ write(proc_poll_pipe[1], &pollinfo, sizeof(pollinfo));
+ sigsuspend(&empty_set);
+ }
+}
+
+#endif /* !HAVE_POLLABLE_PROCFS */
+
+static int
+choose_pfd()
+{
+ int i, j;
+ struct tcb *tcp;
+
+ static int last;
+
+ if (followfork < 2 &&
+ last < nprocs && (pollv[last].revents & POLLPRI)) {
+ /*
+ * The previous process is ready to run again. We'll
+ * let it do so if it is currently in a syscall. This
+ * heuristic improves the readability of the trace.
+ */
+ tcp = pfd2tcb(pollv[last].fd);
+ if (tcp && (tcp->flags & TCB_INSYSCALL))
+ return pollv[last].fd;
+ }
+
+ for (i = 0; i < nprocs; i++) {
+ /* Let competing children run round robin. */
+ j = (i + last + 1) % nprocs;
+ if (pollv[j].revents & (POLLHUP | POLLERR)) {
+ tcp = pfd2tcb(pollv[j].fd);
+ if (!tcp) {
+ fprintf(stderr, "strace: lost proc\n");
+ exit(1);
+ }
+ droptcb(tcp);
+ return -1;
+ }
+ if (pollv[j].revents & POLLPRI) {
+ last = j;
+ return pollv[j].fd;
+ }
+ }
+ fprintf(stderr, "strace: nothing ready\n");
+ exit(1);
+}
+
+static int
+trace()
+{
+ struct tcb *tcp;
+ int pfd;
+ int what;
+ int ioctl_result = 0, ioctl_errno = 0;
+
+ for (;;) {
+ if (interactive)
+ sigprocmask(SIG_SETMASK, &empty_set, NULL);
+
+ if (nprocs == 0)
+ break;
+
+ switch (nprocs) {
+ case 1:
+#ifndef HAVE_POLLABLE_PROCFS
+ if (proc_poll_pipe[0] == -1) {
+#endif
+ tcp = pid2tcb(0);
+ if (!tcp)
+ continue;
+ pfd = tcp->pfd;
+ if (pfd == -1)
+ continue;
+ break;
+#ifndef HAVE_POLLABLE_PROCFS
+ }
+ /* fall through ... */
+#endif /* !HAVE_POLLABLE_PROCFS */
+ default:
+#ifdef HAVE_POLLABLE_PROCFS
+ if (poll(pollv, nprocs, INFTIM) < 0) {
+ if (interrupted)
+ return 0;
+ continue;
+ }
+#else /* !HAVE_POLLABLE_PROCFS */
+ if (proc_poll(pollv, nprocs, INFTIM) < 0) {
+ if (interrupted)
+ return 0;
+ continue;
+ }
+#endif /* !HAVE_POLLABLE_PROCFS */
+ pfd = choose_pfd();
+ if (pfd == -1)
+ continue;
+ break;
+ }
+
+ /* Look up `pfd' in our table. */
+ if ((tcp = pfd2tcb(pfd)) == NULL) {
+ fprintf(stderr, "unknown pfd: %u\n", pfd);
+ exit(1);
+ }
+ /* Get the status of the process. */
+ if (!interrupted) {
+ ioctl_result = ioctl(tcp->pfd, PIOCWSTOP,
+ &tcp->status);
+ ioctl_errno = errno;
+#ifndef HAVE_POLLABLE_PROCFS
+ if (proc_poll_pipe[0] != -1) {
+ if (ioctl_result < 0)
+ kill(poller_pid, SIGKILL);
+ else
+ kill(poller_pid, SIGUSR1);
+ }
+#endif /* !HAVE_POLLABLE_PROCFS */
+ }
+ if (interrupted)
+ return 0;
+
+ if (interactive)
+ sigprocmask(SIG_BLOCK, &blocked_set, NULL);
+
+ if (ioctl_result < 0) {
+ /* Find out what happened if it failed. */
+ switch (ioctl_errno) {
+ case EINTR:
+ case EBADF:
+ continue;
+ case ENOENT:
+ droptcb(tcp);
+ continue;
+ default:
+ perror("PIOCWSTOP");
+ exit(1);
+ }
+ }
+
+ /* clear the just started flag */
+ tcp->flags &= ~TCB_STARTUP;
+
+ /* set current output file */
+ outf = tcp->outf;
+
+ if (cflag) {
+ struct timeval stime;
+
+ stime.tv_sec = tcp->status.pr_stime.tv_sec;
+ stime.tv_usec = tcp->status.pr_stime.tv_nsec/1000;
+ tv_sub(&tcp->dtime, &stime, &tcp->stime);
+ tcp->stime = stime;
+ }
+
+ what = tcp->status.pr_what;
+ switch (tcp->status.pr_why) {
+ case PR_REQUESTED:
+ if (tcp->status.pr_flags & PR_ASLEEP) {
+ tcp->status.pr_why = PR_SYSENTRY;
+ if (trace_syscall(tcp) < 0) {
+ fprintf(stderr, "syscall trouble\n");
+ exit(1);
+ }
+ }
+ break;
+ case PR_SYSENTRY:
+ case PR_SYSEXIT:
+ if (trace_syscall(tcp) < 0) {
+ fprintf(stderr, "syscall trouble\n");
+ exit(1);
+ }
+ break;
+ case PR_SIGNALLED:
+ if (!cflag && (qual_flags[what] & QUAL_SIGNAL)) {
+ printleader(tcp);
+ tprintf("--- %s (%s) ---",
+ signalent[what], strsignal(what));
+ printtrailer(tcp);
+ }
+ break;
+ case PR_FAULTED:
+ if (!cflag && (qual_flags[what] & QUAL_FAULT)) {
+ printleader(tcp);
+ tprintf("=== FAULT %d ===", what);
+ printtrailer(tcp);
+ }
+ break;
+ default:
+ fprintf(stderr, "odd stop %d\n", tcp->status.pr_why);
+ exit(1);
+ break;
+ }
+ if (ioctl(tcp->pfd, PIOCRUN, NULL) < 0) {
+ perror("PIOCRUN");
+ exit(1);
+ }
+ }
+ return 0;
+}
+
+#else /* !SVR4 */
+
+static int
+trace()
+{
+ int pid;
+ int wait_errno;
+ int status;
+ struct tcb *tcp;
+#ifdef LINUX
+ struct rusage ru;
+#endif /* LINUX */
+
+ while (nprocs != 0) {
+ if (interactive)
+ sigprocmask(SIG_SETMASK, &empty_set, NULL);
+#ifdef LINUX
+ pid = wait4(-1, &status, 0, cflag ? &ru : NULL);
+#endif /* LINUX */
+#ifdef SUNOS4
+ pid = wait(&status);
+#endif /* SUNOS4 */
+ wait_errno = errno;
+ if (interactive)
+ sigprocmask(SIG_BLOCK, &blocked_set, NULL);
+
+ if (interrupted)
+ return 0;
+
+ if (pid == -1) {
+ switch (wait_errno) {
+ case EINTR:
+ continue;
+ case ECHILD:
+ /*
+ * We would like to verify this case
+ * but sometimes a race in Solbourne's
+ * version of SunOS sometimes reports
+ * ECHILD before sending us SIGCHILD.
+ */
+#if 0
+ if (nprocs == 0)
+ return 0;
+ fprintf(stderr, "strace: proc miscount\n");
+ exit(1);
+#endif
+ return 0;
+ default:
+ errno = wait_errno;
+ perror("strace: wait");
+ return -1;
+ }
+ }
+ if (debug)
+ fprintf(stderr, " [wait(%#x) = %u]\n", status, pid);
+
+ /* Look up `pid' in our table. */
+ if ((tcp = pid2tcb(pid)) == NULL) {
+ fprintf(stderr, "unknown pid: %u\n", pid);
+ if (WIFSTOPPED(status))
+ ptrace(PTRACE_CONT, pid, (char *) 1, 0);
+ exit(1);
+ }
+ /* set current output file */
+ outf = tcp->outf;
+ if (cflag) {
+#ifdef LINUX
+ tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime);
+ tcp->stime = ru.ru_stime;
+#endif /* !LINUX */
+ }
+
+ if (tcp->flags & TCB_SUSPENDED) {
+ /*
+ * Apparently, doing any ptrace() call on a stopped
+ * process, provokes the kernel to report the process
+ * status again on a subsequent wait(), even if the
+ * process has not been actually restarted.
+ * Since we have inspected the arguments of suspended
+ * processes we end up here testing for this case.
+ */
+ continue;
+ }
+ if (WIFSIGNALED(status)) {
+ if (!cflag
+ && (qual_flags[WTERMSIG(status)] & QUAL_SIGNAL)) {
+ printleader(tcp);
+ tprintf("+++ killed by %s +++",
+ signalent[WTERMSIG(status)]);
+ printtrailer(tcp);
+ }
+ droptcb(tcp);
+ continue;
+ }
+ if (WIFEXITED(status)) {
+ if (debug)
+ fprintf(stderr, "pid %u exited\n", pid);
+ if (tcp->flags & TCB_ATTACHED)
+ fprintf(stderr,
+ "PANIC: attached pid %u exited\n",
+ pid);
+ droptcb(tcp);
+ continue;
+ }
+ if (!WIFSTOPPED(status)) {
+ fprintf(stderr, "PANIC: pid %u not stopped\n", pid);
+ droptcb(tcp);
+ continue;
+ }
+ if (debug)
+ fprintf(stderr, "pid %u stopped, [%s]\n",
+ pid, signalent[WSTOPSIG(status)]);
+
+ if (tcp->flags & TCB_STARTUP) {
+ /*
+ * This flag is there to keep us in sync.
+ * Next time this process stops it should
+ * really be entering a system call.
+ */
+ tcp->flags &= ~TCB_STARTUP;
+ if (tcp->flags & TCB_ATTACHED) {
+ /*
+ * Interestingly, the process may stop
+ * with STOPSIG equal to some other signal
+ * than SIGSTOP if we happend to attach
+ * just before the process takes a signal.
+ */
+ if (!WIFSTOPPED(status)) {
+ fprintf(stderr,
+ "pid %u not stopped\n", pid);
+ detach(tcp, WSTOPSIG(status));
+ continue;
+ }
+ }
+ else {
+#ifdef SUNOS4
+ /* A child of us stopped at exec */
+ if (WSTOPSIG(status) == SIGTRAP && followvfork)
+ fixvfork(tcp);
+#endif /* SUNOS4 */
+ }
+ if (tcp->flags & TCB_BPTSET) {
+ if (clearbpt(tcp) < 0) /* Pretty fatal */ {
+ droptcb(tcp);
+ cleanup();
+ return -1;
+ }
+ }
+ goto tracing;
+ }
+
+ if (WSTOPSIG(status) != SIGTRAP) {
+ if (WSTOPSIG(status) == SIGSTOP &&
+ (tcp->flags & TCB_SIGTRAPPED)) {
+ /*
+ * Trapped attempt to block SIGTRAP
+ * Hope we are back in control now.
+ */
+ tcp->flags &= ~(TCB_INSYSCALL | TCB_SIGTRAPPED);
+ if (ptrace(PTRACE_SYSCALL,
+ pid, (char *) 1, 0) < 0) {
+ perror("trace: ptrace(PTRACE_SYSCALL, ...)");
+ cleanup();
+ return -1;
+ }
+ continue;
+ }
+ if (!cflag
+ && (qual_flags[WSTOPSIG(status)] & QUAL_SIGNAL)) {
+ printleader(tcp);
+ tprintf("--- %s (%s) ---",
+ signalent[WSTOPSIG(status)],
+ strsignal(WSTOPSIG(status)));
+ printtrailer(tcp);
+ }
+ if ((tcp->flags & TCB_ATTACHED) &&
+ !sigishandled(tcp, WSTOPSIG(status))) {
+ detach(tcp, WSTOPSIG(status));
+ continue;
+ }
+ if (ptrace(PTRACE_SYSCALL, pid, (char *) 1,
+ WSTOPSIG(status)) < 0) {
+ perror("trace: ptrace(PTRACE_SYSCALL, ...)");
+ cleanup();
+ return -1;
+ }
+ tcp->flags &= ~TCB_SUSPENDED;
+ continue;
+ }
+ if (trace_syscall(tcp) < 0) {
+ if (tcp->flags & TCB_ATTACHED)
+ detach(tcp, 0);
+ else {
+ ptrace(PTRACE_KILL,
+ tcp->pid, (char *) 1, SIGTERM);
+ droptcb(tcp);
+ }
+ continue;
+ }
+ if (tcp->flags & TCB_EXITING) {
+ if (tcp->flags & TCB_ATTACHED)
+ detach(tcp, 0);
+ else if (ptrace(PTRACE_CONT, pid, (char *) 1, 0) < 0) {
+ perror("strace: ptrace(PTRACE_CONT, ...)");
+ cleanup();
+ return -1;
+ }
+ continue;
+ }
+ if (tcp->flags & TCB_SUSPENDED) {
+ if (!qflag)
+ fprintf(stderr, "Process %u suspended\n", pid);
+ continue;
+ }
+ tracing:
+ if (ptrace(PTRACE_SYSCALL, pid, (char *) 1, 0) < 0) {
+ perror("trace: ptrace(PTRACE_SYSCALL, ...)");
+ cleanup();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+#endif /* !SVR4 */
+
+static int curcol;
+
+#ifdef __STDC__
+#include <stdarg.h>
+#define VA_START(a, b) va_start(a, b)
+#else
+#include <varargs.h>
+#define VA_START(a, b) va_start(a)
+#endif
+
+void
+#ifdef __STDC__
+tprintf(const char *fmt, ...)
+#else
+tprintf(fmt, va_alist)
+char *fmt;
+va_dcl
+#endif
+{
+ va_list args;
+
+ VA_START(args, fmt);
+ if (outf)
+ curcol += vfprintf(outf, fmt, args);
+ va_end(args);
+ return;
+}
+
+void
+printleader(tcp)
+struct tcb *tcp;
+{
+ if (tcp_last && (!outfname || followfork < 2 || tcp_last == tcp)) {
+ tcp_last->flags |= TCB_REPRINT;
+ tprintf(" <unfinished ...>\n");
+ }
+ curcol = 0;
+ if ((followfork == 1 || pflag_seen > 1) && outfname)
+ tprintf("%-5d ", tcp->pid);
+ else if (nprocs > 1 && !outfname)
+ tprintf("[pid %5u] ", tcp->pid);
+ if (tflag) {
+ char str[sizeof("HH:MM:SS")];
+ struct timeval tv, dtv;
+ static struct timeval otv;
+
+ gettimeofday(&tv, NULL);
+ if (rflag) {
+ if (otv.tv_sec == 0)
+ otv = tv;
+ tv_sub(&dtv, &tv, &otv);
+ tprintf("%6ld.%06ld ",
+ (long) dtv.tv_sec, (long) dtv.tv_usec);
+ otv = tv;
+ }
+ else if (tflag > 2) {
+ tprintf("%ld.%06ld ",
+ (long) tv.tv_sec, (long) tv.tv_usec);
+ }
+ else {
+ time_t local = tv.tv_sec;
+ strftime(str, sizeof(str), "%T", localtime(&local));
+ if (tflag > 1)
+ tprintf("%s.%06ld ", str, (long) tv.tv_usec);
+ else
+ tprintf("%s ", str);
+ }
+ }
+ if (iflag)
+ printcall(tcp);
+}
+
+void
+tabto(col)
+int col;
+{
+ if (curcol < col)
+ tprintf("%*s", col - curcol, "");
+}
+
+void
+printtrailer(tcp)
+struct tcb *tcp;
+{
+ tprintf("\n");
+ tcp_last = NULL;
+}
diff --git a/stream.c b/stream.c
new file mode 100644
index 000000000..4c632f305
--- /dev/null
+++ b/stream.c
@@ -0,0 +1,822 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#if defined(HAVE_SYS_STREAM_H) || defined(LINUXSPARC) || defined(linux)
+
+#if defined(LINUXSPARC) || defined(linux)
+#include <sys/poll.h>
+
+#define RS_HIPRI 1
+struct strbuf {
+ int maxlen; /* no. of bytes in buffer */
+ int len; /* no. of bytes returned */
+ char *buf; /* pointer to data */
+};
+#define MORECTL 1
+#define MOREDATA 2
+
+#else /* LINUXSPARC */
+
+#include <stropts.h>
+#include <poll.h>
+#include <sys/conf.h>
+#include <sys/stream.h>
+#include <sys/tihdr.h>
+
+#endif /* LINUXSPARC */
+
+#ifdef HAVE_SYS_TIUSER_H
+#include <sys/tiuser.h>
+#include <sys/sockmod.h>
+#include <sys/timod.h>
+#endif /* HAVE_SYS_TIUSER_H */
+
+static struct xlat msgflags[] = {
+ { RS_HIPRI, "RS_HIPRI" },
+ { 0, NULL },
+};
+
+#if 0
+static struct xlat getmsgflags[] = {
+ { MORECTL, "MORECTL" },
+ { MOREDATA, "MOREDATA" },
+ { 0, NULL },
+};
+#endif
+
+static void
+printstrbuf(tcp, sbp, getting)
+struct tcb *tcp;
+struct strbuf *sbp;
+int getting;
+{
+ if (sbp->maxlen == -1 && getting)
+ tprintf("{maxlen=-1}");
+ else {
+ tprintf("{");
+ if (getting)
+ tprintf("maxlen=%d, ", sbp->maxlen);
+ tprintf("len=%d, buf=", sbp->len);
+ printstr(tcp, (int) sbp->buf, sbp->len);
+ tprintf("}");
+ }
+}
+
+static void
+printstrbufarg(tcp, arg, getting)
+struct tcb *tcp;
+int arg;
+int getting;
+{
+ struct strbuf buf;
+
+ if (arg == 0)
+ tprintf("NULL");
+ else if (umove(tcp, arg, &buf) < 0)
+ tprintf("{...}");
+ else
+ printstrbuf(tcp, &buf, getting);
+ tprintf(", ");
+}
+
+int
+sys_putmsg(tcp)
+struct tcb *tcp;
+{
+ int i;
+
+ if (entering(tcp)) {
+ /* fd */
+ tprintf("%ld, ", tcp->u_arg[0]);
+ /* control and data */
+ for (i = 1; i < 3; i++)
+ printstrbufarg(tcp, tcp->u_arg[i], 0);
+ /* flags */
+ if (!printflags(msgflags, tcp->u_arg[3]))
+ tprintf("0");
+ }
+ return 0;
+}
+
+int
+sys_getmsg(tcp)
+struct tcb *tcp;
+{
+ int i, flags;
+
+ if (entering(tcp)) {
+ /* fd */
+ tprintf("%lu, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %#lx, %#lx",
+ tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
+ return 0;
+ }
+ /* control and data */
+ for (i = 1; i < 3; i++)
+ printstrbufarg(tcp, tcp->u_arg[i], 1);
+ /* pointer to flags */
+ if (tcp->u_arg[3] == 0)
+ tprintf("NULL");
+ else if (umove(tcp, tcp->u_arg[3], &flags) < 0)
+ tprintf("[?]");
+ else {
+ tprintf("[");
+ if (!printflags(msgflags, flags))
+ tprintf("0");
+ tprintf("]");
+ }
+ /* decode return value */
+ switch (tcp->u_rval) {
+ case MORECTL:
+ tcp->auxstr = "MORECTL";
+ break;
+ case MORECTL|MOREDATA:
+ tcp->auxstr = "MORECTL|MOREDATA";
+ break;
+ case MOREDATA:
+ tcp->auxstr = "MORECTL";
+ break;
+ default:
+ tcp->auxstr = NULL;
+ break;
+ }
+ }
+ return RVAL_HEX | RVAL_STR;
+}
+
+#ifdef HAVE_PUTPMSG
+
+static struct xlat pmsgflags[] = {
+ { MSG_HIPRI, "MSG_HIPRI" },
+ { MSG_ANY, "MSG_ANY" },
+ { MSG_BAND, "MSG_BAND" },
+ { 0, NULL },
+};
+
+int
+sys_putpmsg(tcp)
+struct tcb *tcp;
+{
+ int i;
+
+ if (entering(tcp)) {
+ /* fd */
+ tprintf("%ld, ", tcp->u_arg[0]);
+ /* control and data */
+ for (i = 1; i < 3; i++)
+ printstrbufarg(tcp, tcp->u_arg[i], 0);
+ /* band */
+ tprintf("%ld, ", tcp->u_arg[3]);
+ /* flags */
+ if (!printflags(pmsgflags, tcp->u_arg[4]))
+ tprintf("0");
+ }
+ return 0;
+}
+
+int
+sys_getpmsg(tcp)
+struct tcb *tcp;
+{
+ int i, flags;
+
+ if (entering(tcp)) {
+ /* fd */
+ tprintf("%lu, ", tcp->u_arg[0]);
+ } else {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %#lx, %#lx, %#lx", tcp->u_arg[1],
+ tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[4]);
+ return 0;
+ }
+ /* control and data */
+ for (i = 1; i < 3; i++)
+ printstrbufarg(tcp, tcp->u_arg[i], 1);
+ /* pointer to band */
+ printnum(tcp, tcp->u_arg[3], "%d");
+ /* pointer to flags */
+ if (tcp->u_arg[4] == 0)
+ tprintf("NULL");
+ else if (umove(tcp, tcp->u_arg[4], &flags) < 0)
+ tprintf("[?]");
+ else {
+ tprintf("[");
+ if (!printflags(pmsgflags, flags))
+ tprintf("0");
+ tprintf("]");
+ }
+ /* decode return value */
+ switch (tcp->u_rval) {
+ case MORECTL:
+ tcp->auxstr = "MORECTL";
+ break;
+ case MORECTL|MOREDATA:
+ tcp->auxstr = "MORECTL|MOREDATA";
+ break;
+ case MOREDATA:
+ tcp->auxstr = "MORECTL";
+ break;
+ default:
+ tcp->auxstr = NULL;
+ break;
+ }
+ }
+ return RVAL_HEX | RVAL_STR;
+}
+
+#endif /* HAVE_PUTPMSG */
+
+#if !defined(LINUXSPARC)
+
+static struct xlat pollflags[] = {
+ { POLLIN, "POLLIN" },
+ { POLLPRI, "POLLPRI" },
+ { POLLOUT, "POLLOUT" },
+#ifdef POLLRDNORM
+ { POLLRDNORM, "POLLRDNORM" },
+#endif
+#ifdef POLLWRNORM
+ { POLLWRNORM, "POLLWRNORM" },
+#endif
+#ifdef POLLRDBAND
+ { POLLRDBAND, "POLLRDBAND" },
+#endif
+#ifdef POLLWRBAND
+ { POLLWRBAND, "POLLWRBAND" },
+#endif
+ { POLLERR, "POLLERR" },
+ { POLLHUP, "POLLHUP" },
+ { POLLNVAL, "POLLNVAL" },
+ { 0, NULL },
+};
+
+int
+sys_poll(tcp)
+struct tcb *tcp;
+{
+ struct pollfd *pollp;
+
+ if (exiting(tcp)) {
+ int i;
+ int nfds = tcp->u_arg[1];
+
+ if (nfds <= 0) {
+ tprintf("%#lx, %d, %ld\n",
+ tcp->u_arg[0], nfds, tcp->u_arg[2]);
+ return 0;
+ }
+ pollp = (struct pollfd *) malloc(nfds * sizeof(*pollp));
+ if (pollp == NULL) {
+ fprintf(stderr, "sys_poll: no memory\n");
+ tprintf("%#lx, %d, %ld",
+ tcp->u_arg[0], nfds, tcp->u_arg[2]);
+ return 0;
+ }
+ if (umoven(tcp, tcp->u_arg[0],
+ (nfds * sizeof(*pollp)), (char *) pollp) < 0) {
+ tprintf("%#lx", tcp->u_arg[0]);
+ }
+ else {
+ tprintf("[");
+ for (i = 0; i < nfds; i++) {
+ if (i)
+ tprintf(", ");
+ if (pollp[i].fd < 0) {
+ tprintf("{fd=%d}", pollp[i].fd);
+ continue;
+ }
+ tprintf("{fd=%d, events=", pollp[i].fd);
+ if (!printflags(pollflags, pollp[i].events))
+ tprintf("0");
+ if (!syserror(tcp) && pollp[i].revents) {
+ tprintf(", revents=");
+ if (!printflags(pollflags,
+ pollp[i].revents))
+ tprintf("0");
+ }
+ tprintf("}");
+ }
+ tprintf("]");
+ }
+ tprintf(", %d, ", nfds);
+#ifdef INFTIM
+ if (tcp->u_arg[2] == INFTIM)
+ tprintf("INFTIM");
+ else
+#endif
+ tprintf("%ld", tcp->u_arg[2]);
+ free(pollp);
+ }
+ return 0;
+}
+
+#ifndef linux
+
+static struct xlat stream_flush_options[] = {
+ { FLUSHR, "FLUSHR" },
+ { FLUSHW, "FLUSHW" },
+ { FLUSHRW, "FLUSHRW" },
+#ifdef FLUSHBAND
+ { FLUSHBAND, "FLUSHBAND" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat stream_setsig_flags[] = {
+ { S_INPUT, "S_INPUT" },
+ { S_HIPRI, "S_HIPRI" },
+ { S_OUTPUT, "S_OUTPUT" },
+ { S_MSG, "S_MSG" },
+#ifdef S_ERROR
+ { S_ERROR, "S_ERROR" },
+#endif
+#ifdef S_HANGUP
+ { S_HANGUP, "S_HANGUP" },
+#endif
+#ifdef S_RDNORM
+ { S_RDNORM, "S_RDNORM" },
+#endif
+#ifdef S_WRNORM
+ { S_WRNORM, "S_WRNORM" },
+#endif
+#ifdef S_RDBAND
+ { S_RDBAND, "S_RDBAND" },
+#endif
+#ifdef S_WRBAND
+ { S_WRBAND, "S_WRBAND" },
+#endif
+#ifdef S_BANDURG
+ { S_BANDURG, "S_BANDURG" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat stream_read_options[] = {
+ { RNORM, "RNORM" },
+ { RMSGD, "RMSGD" },
+ { RMSGN, "RMSGN" },
+ { 0, NULL },
+};
+
+static struct xlat stream_read_flags[] = {
+#ifdef RPROTDAT
+ { RPROTDAT, "RPROTDAT" },
+#endif
+#ifdef RPROTDIS
+ { RPROTDIS, "RPROTDIS" },
+#endif
+#ifdef RPROTNORM
+ { RPROTNORM, "RPROTNORM" },
+#endif
+ { 0, NULL },
+};
+
+#ifndef RMODEMASK
+#define RMODEMASK (~0)
+#endif
+
+#ifdef I_SWROPT
+static struct xlat stream_write_flags[] = {
+ { SNDZERO, "SNDZERO" },
+ { SNDPIPE, "SNDPIPE" },
+ { 0, NULL },
+};
+#endif /* I_SWROPT */
+
+#ifdef I_ATMARK
+static struct xlat stream_atmark_options[] = {
+ { ANYMARK, "ANYMARK" },
+ { LASTMARK, "LASTMARK" },
+ { 0, NULL },
+};
+#endif /* I_ATMARK */
+
+#ifdef TI_BIND
+static struct xlat transport_user_options[] = {
+ { T_CONN_REQ, "T_CONN_REQ" },
+ { T_CONN_RES, "T_CONN_RES" },
+ { T_DISCON_REQ, "T_DISCON_REQ" },
+ { T_DATA_REQ, "T_DATA_REQ" },
+ { T_EXDATA_REQ, "T_EXDATA_REQ" },
+ { T_INFO_REQ, "T_INFO_REQ" },
+ { T_BIND_REQ, "T_BIND_REQ" },
+ { T_UNBIND_REQ, "T_UNBIND_REQ" },
+ { T_UNITDATA_REQ,"T_UNITDATA_REQ"},
+ { T_OPTMGMT_REQ,"T_OPTMGMT_REQ" },
+ { T_ORDREL_REQ, "T_ORDREL_REQ" },
+ { 0, NULL },
+};
+
+static struct xlat transport_provider_options[] = {
+ { T_CONN_IND, "T_CONN_IND" },
+ { T_CONN_CON, "T_CONN_CON" },
+ { T_DISCON_IND, "T_DISCON_IND" },
+ { T_DATA_IND, "T_DATA_IND" },
+ { T_EXDATA_IND, "T_EXDATA_IND" },
+ { T_INFO_ACK, "T_INFO_ACK" },
+ { T_BIND_ACK, "T_BIND_ACK" },
+ { T_ERROR_ACK, "T_ERROR_ACK" },
+ { T_OK_ACK, "T_OK_ACK" },
+ { T_UNITDATA_IND,"T_UNITDATA_IND"},
+ { T_UDERROR_IND,"T_UDERROR_IND" },
+ { T_OPTMGMT_ACK,"T_OPTMGMT_ACK" },
+ { T_ORDREL_IND, "T_ORDREL_IND" },
+ { 0, NULL },
+};
+#endif /* TI_BIND */
+
+static int
+internal_stream_ioctl(tcp, arg)
+struct tcb *tcp;
+int arg;
+{
+ struct strioctl si;
+ char *name;
+ int in_and_out;
+#ifdef SI_GETUDATA
+ struct si_udata udata;
+#endif /* SI_GETUDATA */
+
+ if (!arg)
+ return 0;
+ if (umove(tcp, arg, &si) < 0) {
+ if (entering(tcp))
+ tprintf(", {...}");
+ return 1;
+ }
+ if (entering(tcp)) {
+ name = ioctl_lookup(si.ic_cmd);
+ if (name)
+ tprintf(", {ic_cmd=%s", name);
+ else
+ tprintf(", {ic_cmd=%#x", si.ic_cmd);
+ if (si.ic_timout == INFTIM)
+ tprintf(", ic_timout=INFTIM, ");
+ else
+ tprintf(" ic_timout=%d, ", si.ic_timout);
+ }
+ in_and_out = 1;
+ switch (si.ic_cmd) {
+#ifdef SI_GETUDATA
+ case SI_GETUDATA:
+ in_and_out = 0;
+ break;
+#endif /* SI_GETUDATA */
+ }
+ if (in_and_out) {
+ if (entering(tcp))
+ tprintf("/* in */ ");
+ else
+ tprintf(", /* out */ ");
+ }
+ if (in_and_out || entering(tcp))
+ tprintf("ic_len=%d, ic_dp=", si.ic_len);
+ switch (si.ic_cmd) {
+#ifdef TI_BIND
+ case TI_BIND:
+ /* in T_BIND_REQ, out T_BIND_ACK */
+ if (entering(tcp)) {
+ struct T_bind_req data;
+
+#if 0
+ tprintf("struct T_bind_req ");
+#endif
+ if (umove(tcp, (int) si.ic_dp, &data) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{PRIM_type=");
+ printxval(transport_user_options,
+ data.PRIM_type, "T_???");
+ tprintf(", ADDR_length=%ld, ADDR_offset=%ld",
+ data.ADDR_length, data.ADDR_offset);
+ tprintf(", CONIND_number=%ld}",
+ data.CONIND_number);
+ }
+ }
+ else {
+ struct T_bind_ack data;
+
+#if 0
+ tprintf("struct T_bind_ack ");
+#endif
+ if (umove(tcp, (int) si.ic_dp, &data) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("[");
+ tprintf("{PRIM_type=");
+ printxval(transport_provider_options,
+ data.PRIM_type, "T_???");
+ tprintf(", ADDR_length=%ld, ADDR_offset=%ld",
+ data.ADDR_length, data.ADDR_offset);
+ tprintf(", CONIND_number=%ld}",
+ data.CONIND_number);
+ tprintf(", ");
+ printstr(tcp,
+ (int) si.ic_dp + data.ADDR_offset,
+ data.ADDR_length);
+ tprintf("]");
+ }
+ }
+ break;
+#endif /* TI_BIND */
+#if 0
+#ifdef TI_UNBIND
+ case TI_UNBIND:
+ /* in T_UNBIND_REQ, out T_OK_ACK */
+ break;
+#endif /* TI_UNBIND */
+#ifdef TI_GETINFO
+ case TI_GETINFO:
+ /* in T_INFO_REQ, out T_INFO_ACK */
+ break;
+#endif /* TI_GETINFO */
+#ifdef TI_OPTMGMT
+ case TI_OPTMGMT:
+ /* in T_OPTMGMT_REQ, out T_OPTMGMT_ACK */
+ break;
+#endif /* TI_OPTMGMT */
+#endif
+#ifdef SI_GETUDATA
+ case SI_GETUDATA:
+ if (entering(tcp))
+ break;
+#if 0
+ tprintf("struct si_udata ");
+#endif
+ if (umove(tcp, (int) si.ic_dp, &udata) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{tidusize=%d, addrsize=%d, ",
+ udata.tidusize, udata.addrsize);
+ tprintf("optsize=%d, etsdusize=%d, ",
+ udata.optsize, udata.etsdusize);
+ tprintf("servtype=%d, so_state=%d, ",
+ udata.servtype, udata.so_state);
+ tprintf("so_options=%d", udata.so_options);
+#if 0
+ tprintf(", tsdusize=%d", udata.tsdusize);
+#endif
+ tprintf("}");
+ }
+ break;
+#endif /* SI_GETUDATA */
+ default:
+ printstr(tcp, (int) si.ic_dp, si.ic_len);
+ break;
+ }
+ if (exiting(tcp))
+ tprintf("}");
+ return 1;
+}
+
+int
+stream_ioctl(tcp, code, arg)
+struct tcb *tcp;
+int code, arg;
+{
+#ifdef I_LIST
+ int i;
+#endif
+ int val;
+#ifdef I_FLUSHBAND
+ struct bandinfo bi;
+#endif
+ struct strpeek sp;
+ struct strfdinsert sfi;
+ struct strrecvfd srf;
+#ifdef I_LIST
+ struct str_list sl;
+#endif
+
+ /* I_STR is a special case because the data is read & written. */
+ if (code == I_STR)
+ return internal_stream_ioctl(tcp, arg);
+ if (entering(tcp))
+ return 0;
+
+ switch (code) {
+ case I_PUSH:
+ case I_LOOK:
+ case I_FIND:
+ /* arg is a string */
+ tprintf(", ");
+ printpath(tcp, arg);
+ return 1;
+ case I_POP:
+ /* doesn't take an argument */
+ return 1;
+ case I_FLUSH:
+ /* argument is an option */
+ tprintf(", ");
+ printxval(stream_flush_options, arg, "FLUSH???");
+ return 1;
+#ifdef I_FLUSHBAND
+ case I_FLUSHBAND:
+ /* argument is a pointer to a bandinfo struct */
+ if (umove(tcp, arg, &bi) < 0)
+ tprintf(", {...}");
+ else {
+ tprintf(", {bi_pri=%d, bi_flag=", bi.bi_pri);
+ if (!printflags(stream_flush_options, bi.bi_flag))
+ tprintf("0");
+ tprintf("}");
+ }
+ return 1;
+#endif /* I_FLUSHBAND */
+ case I_SETSIG:
+ /* argument is a set of flags */
+ tprintf(", ");
+ if (!printflags(stream_setsig_flags, arg))
+ tprintf("0");
+ return 1;
+ case I_GETSIG:
+ /* argument is a pointer to a set of flags */
+ if (syserror(tcp))
+ return 0;
+ tprintf(", [");
+ if (umove(tcp, arg, &val) < 0)
+ tprintf("?");
+ else if (!printflags(stream_setsig_flags, val))
+ tprintf("0");
+ tprintf("]");
+ return 1;
+ case I_PEEK:
+ /* argument is a pointer to a strpeek structure */
+ if (syserror(tcp) || !arg)
+ return 0;
+ if (umove(tcp, arg, &sp) < 0) {
+ tprintf(", {...}");
+ return 1;
+ }
+ tprintf(", {ctlbuf=");
+ printstrbuf(tcp, &sp.ctlbuf, 1);
+ tprintf(", databuf=");
+ printstrbuf(tcp, &sp.databuf, 1);
+ if (!printflags(msgflags, sp.flags))
+ tprintf("0");
+ return 1;
+ case I_SRDOPT:
+ /* argument is an option with flags */
+ tprintf(", ");
+ printxval(stream_read_options, arg & RMODEMASK, "R???");
+ addflags(stream_read_flags, arg & ~RMODEMASK);
+ return 1;
+ case I_GRDOPT:
+ /* argument is an pointer to an option with flags */
+ if (syserror(tcp))
+ return 0;
+ tprintf(", [");
+ if (umove(tcp, arg, &val) < 0)
+ tprintf("?");
+ else {
+ printxval(stream_read_options,
+ arg & RMODEMASK, "R???");
+ addflags(stream_read_flags, arg & ~RMODEMASK);
+ }
+ tprintf("]");
+ return 1;
+ case I_NREAD:
+#ifdef I_GETBAND
+ case I_GETBAND:
+#endif
+#ifdef I_SETCLTIME
+ case I_SETCLTIME:
+#endif
+#ifdef I_GETCLTIME
+ case I_GETCLTIME:
+#endif
+ /* argument is a pointer to a decimal integer */
+ if (syserror(tcp))
+ return 0;
+ tprintf(", ");
+ printnum(tcp, arg, "%d");
+ return 1;
+ case I_FDINSERT:
+ /* argument is a pointer to a strfdinsert structure */
+ if (syserror(tcp) || !arg)
+ return 0;
+ if (umove(tcp, arg, &sfi) < 0) {
+ tprintf(", {...}");
+ return 1;
+ }
+ tprintf(", {ctlbuf=");
+ printstrbuf(tcp, &sfi.ctlbuf, 1);
+ tprintf(", databuf=");
+ printstrbuf(tcp, &sfi.databuf, 1);
+ if (!printflags(msgflags, sfi.flags))
+ tprintf("0");
+ tprintf(", filedes=%d, offset=%d}", sfi.fildes, sfi.offset);
+ return 1;
+#ifdef I_SWROPT
+ case I_SWROPT:
+ /* argument is a set of flags */
+ tprintf(", ");
+ if (!printflags(stream_write_flags, arg))
+ tprintf("0");
+ return 1;
+#endif /* I_SWROPT */
+#ifdef I_GWROPT
+ case I_GWROPT:
+ /* argument is an pointer to an option with flags */
+ if (syserror(tcp))
+ return 0;
+ tprintf(", [");
+ if (umove(tcp, arg, &val) < 0)
+ tprintf("?");
+ else if (!printflags(stream_write_flags, arg))
+ tprintf("0");
+ tprintf("]");
+ return 1;
+#endif /* I_GWROPT */
+ case I_SENDFD:
+#ifdef I_CKBAND
+ case I_CKBAND:
+#endif
+#ifdef I_CANPUT
+ case I_CANPUT:
+#endif
+ case I_LINK:
+ case I_UNLINK:
+ case I_PLINK:
+ case I_PUNLINK:
+ /* argument is a decimal integer */
+ tprintf(", %d", arg);
+ return 1;
+ case I_RECVFD:
+ /* argument is a pointer to a strrecvfd structure */
+ if (syserror(tcp) || !arg)
+ return 0;
+ if (umove(tcp, arg, &srf) < 0) {
+ tprintf(", {...}");
+ return 1;
+ }
+ tprintf(", {fd=%d, uid=%lu, gid=%lu}", srf.fd,
+ (unsigned long) srf.uid, (unsigned long) srf.gid);
+ return 1;
+#ifdef I_LIST
+ case I_LIST:
+ if (syserror(tcp))
+ return 0;
+ if (arg == 0) {
+ tprintf(", NULL");
+ return 1;
+ }
+ if (umove(tcp, arg, &sl) < 0) {
+ tprintf(", {...}");
+ return 1;
+ }
+ tprintf(", {sl_nmods=%d, sl_modlist=[", sl.sl_nmods);
+ for (i = 0; i < tcp->u_rval; i++) {
+ if (i)
+ tprintf(", ");
+ printpath(tcp, (int) sl.sl_modlist[i].l_name);
+ }
+ tprintf("]}");
+ return 1;
+#endif /* I_LIST */
+#ifdef I_ATMARK
+ case I_ATMARK:
+ tprintf(", ");
+ printxval(stream_atmark_options, arg, "???MARK");
+ return 1;
+#endif /* I_ATMARK */
+ default:
+ return 0;
+ }
+}
+
+#endif /* linux */
+
+#endif /* LINUXSPARC && linux */
+
+#endif /* HAVE_SYS_STREAM_H */
diff --git a/sunos4/Makefile.in b/sunos4/Makefile.in
new file mode 100644
index 000000000..efc973dab
--- /dev/null
+++ b/sunos4/Makefile.in
@@ -0,0 +1,56 @@
+#
+# $Id$
+#
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+CC = @CC@
+CPP = @CPP@
+SHELL = /bin/sh
+
+DEFS = @DEFS@
+LDLIBS = @LIBS@
+
+CFLAGS = -g
+LDFLAGS = -g
+WARNFLAGS = @WARNFLAGS@
+
+CPPFLAGS =
+INCLUDES = -I. -I.. -I$(srcdir)
+
+includedir = @includedir@
+
+all: ioctlent.h errnoent.h signalent.h syscallent.h
+
+ioctlent.raw: ioctlent.sh
+ $(SHELL) $(srcdir)/ioctlent.sh $(includedir) >$@
+
+ioctlent.h: ioctlent.raw ioctlsort
+ ./ioctlsort >$@
+
+ioctlsort: ioctlsort.o
+ $(CC) $(LDFLAGS) ioctlsort.o -o ioctlsort
+
+ioctlsort.o: ../ioctlsort.c ioctlent.raw
+ $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $(srcdir)/../ioctlsort.c
+
+errnoent.h: ../errnoent.sh $(includedir)/sys/errno.h
+ $(SHELL) $(srcdir)/../errnoent.sh $(includedir)/sys/errno.h >$@
+
+signalent.h: ../signalent.sh $(includedir)/sys/signal.h
+ $(SHELL) $(srcdir)/../signalent.sh $(includedir)/sys/signal.h >$@
+
+#syscallent.h: ../syscallent.sh $(includedir)/sys/syscall.h
+syscallent.h:
+ $(SHELL) $(srcdir)/../syscallent.sh $(includedir)/sys/syscall.h >$@
+
+clean:
+ rm -f ioctlent.c *.raw *.tmp *.o ioctlsort
+
+distclean: clean
+ rm -f Makefile
+
+realclean: distclean
+ rm -f ioctlent.h errnoent.h signalent.h
+
diff --git a/sunos4/dummy.h b/sunos4/dummy.h
new file mode 100644
index 000000000..9f0259dd1
--- /dev/null
+++ b/sunos4/dummy.h
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+/* Obsolete syscalls */
+#define sys_otime printargs
+#define sys_osetuid printargs
+#define sys_ostime printargs
+#define sys_oalarm printargs
+#define sys_ofstat printargs
+#define sys_opause printargs
+#define sys_outime printargs
+#define sys_onice printargs
+#define sys_oftime printargs
+#define sys_osetpgrp printargs
+#define sys_otimes printargs
+#define sys_osetgid printargs
+#define sys_ossig printargs
+#define sys_owait3 printargs
+#define sys_omsync printargs
+#define sys_ovadvise printargs
+#define sys_omadvise printargs
+#define sys_ovlimit printargs
+#define sys_owait printargs
+#define sys_ovtimes printargs
+#define sys_oldquota printargs
+#define sys_getdirentries printargs
+
+/* No interesting parameters or return values */
+#define sys_vhangup printargs
+#define sys_sys_setsid printargs
+#define sys_errsys printargs
+#define sys_nosys printargs
+
+/* Don't know what to do with these */
+#define sys_sstk printargs
+#define sys_profil printargs
+#define sys_vtrace printargs
+#define sys_async_daemon printargs
+#define sys_nfs_getfh printargs
+#define sys_rtschedule printargs
+#define sys_auditsys printargs
+#define sys_rfssys printargs
+#define sys_vpixsys printargs
+#define sys_getdopt printargs
+#define sys_setdopt printargs
+#define sys_semsys printargs
+#define sys_msgsys printargs
+#define sys_shmsys printargs
+#define sys_semop printargs
+
+#if DONE
+#define sys_rexit printargs
+#define sys_indir printargs
+#define sys_read printargs
+#define sys_write printargs
+#define sys_readv printargs
+#define sys_writev printargs
+#define sys_ioctl printargs
+#define sys_fcntl printargs
+#define sys_fstat printargs
+#define sys_stat printargs
+#define sys_lstat printargs
+#define sys_open printargs
+#define sys_creat printargs
+#define sys_close printargs
+#define sys_chdir printargs
+#define sys_fchdir printargs
+#define sys_mkdir printargs
+#define sys_rmdir printargs
+#define sys_chroot printargs
+#define sys_fchroot printargs
+#define sys_mknod printargs
+#define sys_link printargs
+#define sys_unlink printargs
+#define sys_chown printargs
+#define sys_fchown printargs
+#define sys_chmod printargs
+#define sys_fchmod printargs
+#define sys_utimes printargs
+#define sys_symlink printargs
+#define sys_readlink printargs
+#define sys_rename printargs
+#define sys_getdents printargs
+#define sys_truncate printargs
+#define sys_ftruncate printargs
+#define sys_access printargs
+#define sys_lseek printargs
+#define sys_socket printargs
+#define sys_bind printargs
+#define sys_connect printargs
+#define sys_listen printargs
+#define sys_accept printargs
+#define sys_shutdown printargs
+#define sys_send printargs
+#define sys_sendto printargs
+#define sys_sendmsg printargs
+#define sys_recv printargs
+#define sys_recvfrom printargs
+#define sys_recvmsg printargs
+#define sys_pipe printargs
+#define sys_socketpair printargs
+#define sys_setsockopt printargs
+#define sys_getsockopt printargs
+#define sys_getsockname printargs
+#define sys_getpeername printargs
+#define sys_gethostid printargs
+#define sys_gethostname printargs
+#define sys_sethostname printargs
+#define sys_getpid printargs
+#define sys_getdomainname printargs
+#define sys_setdomainname printargs
+#define sys_vfork printargs
+#define sys_fork printargs
+#define sys_getuid printargs
+#define sys_getgid printargs
+#define sys_setreuid printargs
+#define sys_setregid printargs
+#define sys_getgroups printargs
+#define sys_setgroups printargs
+#define sys_getpgrp printargs
+#define sys_setpgrp printargs
+#define sys_setpgid printargs
+#define sys_execv printargs
+#define sys_execve printargs
+#define sys_wait4 printargs
+#define sys_uname printargs
+#define sys_ptrace printargs
+#define sys_brk printargs
+#define sys_sbrk printargs
+#define sys_mmap printargs
+#define sys_munmap printargs
+#define sys_mprotect printargs
+#define sys_mctl printargs
+#define sys_mincore printargs
+#define sys_sigvec printargs
+#define sys_sigblock printargs
+#define sys_sigsetmask printargs
+#define sys_sigpause printargs
+#define sys_sigstack printargs
+#define sys_sigcleanup printargs
+#define sys_sigpending printargs
+#define sys_kill printargs
+#define sys_killpg printargs
+#define sys_dup printargs
+#define sys_dup2 printargs
+#define sys_getdtablesize printargs
+#define sys_select printargs
+#define sys_flock printargs
+#define sys_umask printargs
+#define sys_gettimeofday printargs
+#define sys_settimeofday printargs
+#define sys_getitimer printargs
+#define sys_setitimer printargs
+#define sys_adjtime printargs
+#define sys_setpriority printargs
+#define sys_getpriority printargs
+#define sys_getrusage printargs
+#define sys_getrlimit printargs
+#define sys_setrlimit printargs
+#define sys_quotactl printargs
+#define sys_sysacct printargs
+#define sys_reboot printargs
+#define sys_sync printargs
+#define sys_mount printargs
+#define sys_umount printargs
+#define sys_unmount printargs
+#define sys_swapon printargs
+#define sys_fsync printargs
+#define sys_exportfs printargs
+#define sys_nfs_svc printargs
+#define sys_statfs printargs
+#define sys_fstatfs printargs
+#define sys_ustat printargs
+#define sys_aioread printargs
+#define sys_aiowrite printargs
+#define sys_aiowait printargs
+#define sys_aiocancel printargs
+#define sys_getpagesize printargs
+#define sys_pathconf printargs
+#define sys_fpathconf printargs
+#define sys_sysconf printargs
+#define sys_getmsg printargs
+#define sys_putmsg printargs
+#define sys_poll printargs
+#endif
diff --git a/sunos4/errnoent.h b/sunos4/errnoent.h
new file mode 100644
index 000000000..b90eb534a
--- /dev/null
+++ b/sunos4/errnoent.h
@@ -0,0 +1,91 @@
+ "ERRNO_0", /* 0 */
+ "EPERM", /* 1 */
+ "ENOENT", /* 2 */
+ "ESRCH", /* 3 */
+ "EINTR", /* 4 */
+ "EIO", /* 5 */
+ "ENXIO", /* 6 */
+ "E2BIG", /* 7 */
+ "ENOEXEC", /* 8 */
+ "EBADF", /* 9 */
+ "ECHILD", /* 10 */
+ "EAGAIN", /* 11 */
+ "ENOMEM", /* 12 */
+ "EACCES", /* 13 */
+ "EFAULT", /* 14 */
+ "ENOTBLK", /* 15 */
+ "EBUSY", /* 16 */
+ "EEXIST", /* 17 */
+ "EXDEV", /* 18 */
+ "ENODEV", /* 19 */
+ "ENOTDIR", /* 20 */
+ "EISDIR", /* 21 */
+ "EINVAL", /* 22 */
+ "ENFILE", /* 23 */
+ "EMFILE", /* 24 */
+ "ENOTTY", /* 25 */
+ "ETXTBSY", /* 26 */
+ "EFBIG", /* 27 */
+ "ENOSPC", /* 28 */
+ "ESPIPE", /* 29 */
+ "EROFS", /* 30 */
+ "EMLINK", /* 31 */
+ "EPIPE", /* 32 */
+ "EDOM", /* 33 */
+ "ERANGE", /* 34 */
+ "EWOULDBLOCK", /* 35 */
+ "EINPROGRESS", /* 36 */
+ "EALREADY", /* 37 */
+ "ENOTSOCK", /* 38 */
+ "EDESTADDRREQ", /* 39 */
+ "EMSGSIZE", /* 40 */
+ "EPROTOTYPE", /* 41 */
+ "ENOPROTOOPT", /* 42 */
+ "EPROTONOSUPPORT", /* 43 */
+ "ESOCKTNOSUPPORT", /* 44 */
+ "EOPNOTSUPP", /* 45 */
+ "EPFNOSUPPORT", /* 46 */
+ "EAFNOSUPPORT", /* 47 */
+ "EADDRINUSE", /* 48 */
+ "EADDRNOTAVAIL", /* 49 */
+ "ENETDOWN", /* 50 */
+ "ENETUNREACH", /* 51 */
+ "ENETRESET", /* 52 */
+ "ECONNABORTED", /* 53 */
+ "ECONNRESET", /* 54 */
+ "ENOBUFS", /* 55 */
+ "EISCONN", /* 56 */
+ "ENOTCONN", /* 57 */
+ "ESHUTDOWN", /* 58 */
+ "ETOOMANYREFS", /* 59 */
+ "ETIMEDOUT", /* 60 */
+ "ECONNREFUSED", /* 61 */
+ "ELOOP", /* 62 */
+ "ENAMETOOLONG", /* 63 */
+ "EHOSTDOWN", /* 64 */
+ "EHOSTUNREACH", /* 65 */
+ "ENOTEMPTY", /* 66 */
+ "EPROCLIM", /* 67 */
+ "EUSERS", /* 68 */
+ "EDQUOT", /* 69 */
+ "ESTALE", /* 70 */
+ "EREMOTE", /* 71 */
+ "ENOSTR", /* 72 */
+ "ETIME", /* 73 */
+ "ENOSR", /* 74 */
+ "ENOMSG", /* 75 */
+ "EBADMSG", /* 76 */
+ "EIDRM", /* 77 */
+ "EDEADLK", /* 78 */
+ "ENOLCK", /* 79 */
+ "ENONET", /* 80 */
+ "ERREMOTE", /* 81 */
+ "ENOLINK", /* 82 */
+ "EADV", /* 83 */
+ "ESRMNT", /* 84 */
+ "ECOMM", /* 85 */
+ "EPROTO", /* 86 */
+ "EMULTIHOP", /* 87 */
+ "EDOTDOT", /* 88 */
+ "EREMCHG", /* 89 */
+ "ENOSYS", /* 90 */
diff --git a/sunos4/ioctlent.h b/sunos4/ioctlent.h
new file mode 100644
index 000000000..6bfc79b9e
--- /dev/null
+++ b/sunos4/ioctlent.h
@@ -0,0 +1,493 @@
+{"sun/audioio.h", "AUDIO_DRAIN", 0x20004103},
+{"sun/isdnio.h", "ISDN_PH_ACTIVATE_REQ", 0x2000410a},
+{"sun/isdnio.h", "ISDN_MPH_DEACTIVATE_REQ", 0x2000410b},
+{"sun/fbio.h", "FBIO_WID_DBL_SET", 0x20004625},
+{"pixrect/gp1var.h", "GP1IO_SCMAP", 0x20004766},
+{"sun/mem.h", "MM_HRCNT", 0x20004d02},
+{"sundev/openpromio.h", "OPROMGETOPT", 0x20004f01},
+{"sundev/openpromio.h", "OPROMSETOPT", 0x20004f02},
+{"sundev/openpromio.h", "OPROMNXTOPT", 0x20004f03},
+{"sundev/openpromio.h", "OPROMSETOPT2", 0x20004f04},
+{"sundev/openpromio.h", "OPROMNEXT", 0x20004f05},
+{"sundev/openpromio.h", "OPROMCHILD", 0x20004f06},
+{"sundev/openpromio.h", "OPROMGETPROP", 0x20004f07},
+{"sundev/openpromio.h", "OPROMNXTPROP", 0x20004f08},
+{"sundev/openpromio.h", "OPROMU2P", 0x20004f09},
+{"sundev/openpromio.h", "OPROMGETCONS", 0x20004f0a},
+{"stropts.h", "I_POP", 0x20005303},
+{"sys/stropts.h", "I_POP", 0x20005303},
+{"stropts.h", "I_FLUSH", 0x20005305},
+{"sys/stropts.h", "I_FLUSH", 0x20005305},
+{"sys/stropts.h", "I_SRDOPT", 0x20005306},
+{"stropts.h", "I_SRDOPT", 0x20005306},
+{"sys/stropts.h", "I_SETSIG", 0x20005309},
+{"stropts.h", "I_SETSIG", 0x20005309},
+{"sys/stropts.h", "I_LINK", 0x2000530c},
+{"stropts.h", "I_LINK", 0x2000530c},
+{"sys/stropts.h", "I_UNLINK", 0x2000530d},
+{"stropts.h", "I_UNLINK", 0x2000530d},
+{"sys/stropts.h", "I_SENDFD", 0x20005311},
+{"stropts.h", "I_SENDFD", 0x20005311},
+{"sys/stropts.h", "I_PLINK", 0x20005313},
+{"stropts.h", "I_PLINK", 0x20005313},
+{"stropts.h", "I_PUNLINK", 0x20005314},
+{"sys/stropts.h", "I_PUNLINK", 0x20005314},
+{"termio.h", "TCSBRK", 0x20005405},
+{"sys/termio.h", "TCSBRK", 0x20005405},
+{"termios.h", "TCXONC", 0x20005406},
+{"sys/termios.h", "TCXONC", 0x20005406},
+{"sys/termios.h", "TCFLSH", 0x20005407},
+{"termios.h", "TCFLSH", 0x20005407},
+{"sun/tvio.h", "TVIOGRAB", 0x2000581d},
+{"sun/tvio.h", "TVIORELEASE", 0x2000581e},
+{"sun/tvio.h", "TVIOREDIRECT", 0x20005822},
+{"sun/tvio.h", "TVIOSYNC", 0x20005825},
+{"sun/tvio.h", "TVIOVWAIT", 0x2000582d},
+{"sun/tvio.h", "TVIOSLOOPBACKCAL", 0x2000583d},
+{"sbusdev/bpp_io.h", "BPPIOC_TESTIO", 0x20006206},
+{"scsi/targets/srdef.h", "CDROMPAUSE", 0x2000630a},
+{"sundev/srreg.h", "CDROMPAUSE", 0x2000630a},
+{"sundev/srreg.h", "CDROMRESUME", 0x2000630b},
+{"sundev/srreg.h", "CDROMSTOP", 0x20006369},
+{"scsi/targets/srdef.h", "CDROMSTOP", 0x20006369},
+{"scsi/targets/srdef.h", "CDROMSTART", 0x2000636a},
+{"sundev/srreg.h", "CDROMSTART", 0x2000636a},
+{"scsi/targets/srdef.h", "CDROMEJECT", 0x2000636b},
+{"sundev/srreg.h", "CDROMEJECT", 0x2000636b},
+{"sun/dkio.h", "FDKEJECT", 0x20006470},
+{"sys/filio.h", "FIOCLEX", 0x20006601},
+{"sys/filio.h", "FIONCLEX", 0x20006602},
+{"sys/filio.h", "FIOLFS", 0x20006640},
+{"sys/filio.h", "FIOLFSS", 0x20006641},
+{"sys/filio.h", "FIOFFS", 0x20006642},
+{"sys/filio.h", "FIOAI", 0x20006643},
+{"sys/filio.h", "FIODUTIMES", 0x20006644},
+{"sys/filio.h", "FIODIO", 0x20006645},
+{"sys/filio.h", "FIODIOS", 0x20006646},
+{"sunwindow/win_ioctl.h", "WININSERT", 0x20006703},
+{"sunwindow/win_ioctl.h", "WINREMOVE", 0x20006704},
+{"sunwindow/win_ioctl.h", "WINCOMPUTECLIPPING", 0x20006712},
+{"sunwindow/win_ioctl.h", "WINLOCKDATA", 0x20006715},
+{"sunwindow/win_ioctl.h", "WINUNLOCKDATA", 0x20006716},
+{"sunwindow/win_ioctl.h", "WINGRABIO", 0x20006717},
+{"sunwindow/win_ioctl.h", "WINRELEASEIO", 0x20006718},
+{"sunwindow/win_ioctl.h", "WINUNLOCKEVENT", 0x2000671c},
+{"sunwindow/win_ioctl.h", "WINUNLOCKSCREEN", 0x2000671e},
+{"sunwindow/win_ioctl.h", "WINSCREENDESTROY", 0x2000672a},
+{"sunwindow/win_ioctl.h", "WINPRINT", 0x2000672c},
+{"sunwindow/win_ioctl.h", "WINREFUSEKBDFOCUS", 0x2000673a},
+{"sunwindow/win_ioctl.h", "WINDBLACCESS", 0x20006747},
+{"sunwindow/win_ioctl.h", "WINDBLFLIP", 0x20006748},
+{"sunwindow/win_ioctl.h", "WINDBLABSORB", 0x20006749},
+{"sunwindow/win_ioctl.h", "WINDBLRLSE", 0x2000674a},
+{"sunwindow/win_ioctl.h", "WINSHAREQUEUE", 0x20006750},
+{"sunwindow/win_ioctl.h", "WINDISCONNECT", 0x20006798},
+{"sunwindow/win_ioctl.h", "WINRECONNECT", 0x20006799},
+{"sun/ndio.h", "NDIOCSON", 0x20006e00},
+{"sun/ndio.h", "NDIOCSOFF", 0x20006e01},
+{"sun/ndio.h", "NDIOCCLEAR", 0x20006e05},
+{"net/nit_buf.h", "NIOCCTIME", 0x20007008},
+{"sys/ttold.h", "TIOCHPCL", 0x20007402},
+{"sbusdev/gtreg.h", "FB_SETSERVER", 0x20007407},
+{"sys/ttold.h", "TIOCEXCL", 0x2000740d},
+{"sys/ttold.h", "TIOCNXCL", 0x2000740e},
+{"sbusdev/gtreg.h", "FB_DISCONNECT", 0x20007410},
+{"sbusdev/gtreg.h", "FB_UNGRABHW", 0x20007414},
+{"sys/ttycom.h", "TIOCCONS", 0x20007424},
+{"sys/ttold.h", "_O_TIOCCONS", 0x20007468},
+{"sys/ttold.h", "TIOCSTART", 0x2000746e},
+{"sys/ttold.h", "TIOCSTOP", 0x2000746f},
+{"sys/ttycom.h", "TIOCNOTTY", 0x20007471},
+{"sys/ttold.h", "TIOCCDTR", 0x20007478},
+{"sys/ttold.h", "TIOCSDTR", 0x20007479},
+{"sys/ttold.h", "TIOCCBRK", 0x2000747a},
+{"sys/ttold.h", "TIOCSBRK", 0x2000747b},
+{"sys/ttycom.h", "TIOCSCTTY", 0x20007484},
+{"sun/gpio.h", "GP1IO_GET_TRUMINORDEV", 0x40014708},
+{"sundev/kbio.h", "KIOCGLED", 0x40016b0f},
+{"sundev/ppreg.h", "PPIOCGETS", 0x40017000},
+{"sundev/ppreg.h", "PPIOCGETC", 0x40017001},
+{"sun/gpio.h", "GP1IO_GET_REQDEV", 0x40024707},
+{"sun/tvio.h", "TVIOGBIND", 0x4002581f},
+{"sbusdev/bpp_io.h", "BPPIOC_GETOUTPINS", 0x40026204},
+{"sundev/srreg.h", "CDROMREADTOCHDR", 0x40026367},
+{"sbusdev/bpp_io.h", "BPPIOC_GETERR", 0x40036205},
+{"sun/audioio.h", "AUDIO_GETDEV", 0x40044104},
+{"sun/fbio.h", "FBIOGVIDEO", 0x40044608},
+{"sun/fbio.h", "GRABPAGEALLOC", 0x4004460a},
+{"sun/fbio.h", "FBIOGPLNGRP", 0x4004460d},
+{"sun/fbio.h", "FBIOGCMSIZE", 0x4004460e},
+{"sun/fbio.h", "FBIOAVAILPLNGRP", 0x40044611},
+{"sun/fbio.h", "FBIOSWINFD", 0x40044614},
+{"sun/fbio.h", "FBIOSAVWINFD", 0x40044615},
+{"sun/fbio.h", "FBIORESWINFD", 0x40044616},
+{"sun/fbio.h", "FBIOSRWINFD", 0x40044617},
+{"sun/fbio.h", "FBIOGCURMAX", 0x4004461c},
+{"sun/fbio.h", "GRABLOCKINFO", 0x4004461d},
+{"sun/fbio.h", "FBIO_DEVID", 0x40044622},
+{"sun/fbio.h", "FBIO_FULLSCREEN_ELIMINATION_GROUPS", 0x40044624},
+{"sun/fbio.h", "FBIOVRTOFFSET", 0x40044626},
+{"sun/gpio.h", "GP1IO_GET_STATIC_BLOCK", 0x40044701},
+{"sun/gpio.h", "GP1IO_GET_GBUFFER_STATE", 0x40044703},
+{"sun/gpio.h", "GP1IO_GET_RESTART_COUNT", 0x40044705},
+{"sun/gpio.h", "GP1IO_CHK_FOR_GBUFFER", 0x40044709},
+{"stropts.h", "I_NREAD", 0x40045301},
+{"sys/stropts.h", "I_NREAD", 0x40045301},
+{"sys/stropts.h", "I_GRDOPT", 0x40045307},
+{"stropts.h", "I_GRDOPT", 0x40045307},
+{"sys/stropts.h", "I_GETSIG", 0x4004530a},
+{"stropts.h", "I_GETSIG", 0x4004530a},
+{"sun/tvio.h", "TVIOGFORMAT", 0x40045801},
+{"sun/tvio.h", "TVIOGCOMPOUT", 0x40045803},
+{"sun/tvio.h", "TVIOGSYNC", 0x40045805},
+{"pixrect/cg8var.h", "PIPIO_G_PIP_ON_OFF", 0x40045805},
+{"sun/tvio.h", "TVIOGOUT", 0x40045807},
+{"sun/tvio.h", "TVIOGCOMPRESS", 0x40045809},
+{"pixrect/cg8var.h", "PIPIO_G_PIP_ON_OFF_RESUME", 0x40045809},
+{"pixrect/cg8var.h", "PIPIO_G_PIP_ON_OFF_SUSPEND", 0x4004580a},
+{"sun/tvio.h", "TVIOGCHROMAGAIN", 0x4004580b},
+{"sun/tvio.h", "TVIOGREDGAIN", 0x4004580d},
+{"sun/tvio.h", "TVIOGREDBLACK", 0x4004580f},
+{"sun/tvio.h", "TVIOGGREENGAIN", 0x40045811},
+{"sun/tvio.h", "TVIOGGREENBLACK", 0x40045813},
+{"sun/tvio.h", "TVIOGBLUEGAIN", 0x40045815},
+{"sun/tvio.h", "TVIOGBLUEBLACK", 0x40045817},
+{"sun/tvio.h", "TVIOGLUMAGAIN", 0x40045819},
+{"sun/tvio.h", "TVIOGBTYPE", 0x40045821},
+{"sun/tvio.h", "TVIOGLIVE", 0x40045823},
+{"sun/tvio.h", "TVIOGCHROMASEP", 0x40045827},
+{"pixrect/cg8var.h", "PIPIO_G_CURSOR_COLOR_FREEZE", 0x40045828},
+{"sun/tvio.h", "TVIOGCHROMADEMOD", 0x40045829},
+{"pixrect/cg8var.h", "PIPIO_G_TEST", 0x4004582b},
+{"sun/tvio.h", "TVIOGGENLOCK", 0x4004582b},
+{"sun/tvio.h", "TVIOGSYNCABSENT", 0x4004582e},
+{"sun/tvio.h", "TVIOGBURSTABSENT", 0x4004582f},
+{"sun/tvio.h", "TVIOGIBSTATE", 0x40045837},
+{"sun/tvio.h", "TVIOGABSTATE", 0x40045839},
+{"sun/tvio.h", "TVIOGCONTROL", 0x4004583b},
+{"sun/dkio.h", "FDKGETCHANGE", 0x4004646f},
+{"sys/filio.h", "FIOGETOWN", 0x4004667b},
+{"sys/filio.h", "FIONREAD", 0x4004667f},
+{"sunwindow/win_ioctl.h", "WINGETUSERFLAGS", 0x4004670e},
+{"sunwindow/win_ioctl.h", "WINGETOWNER", 0x40046710},
+{"sunwindow/win_ioctl.h", "WINGETBUTTONORDER", 0x40046724},
+{"sunwindow/win_ioctl.h", "WINGETNEXTINPUT", 0x40046739},
+{"sunwindow/win_ioctl.h", "WINGETPLANEGROUP", 0x40046740},
+{"sunwindow/win_ioctl.h", "WINGETNOTIFYALL", 0x40046751},
+{"sundev/kbio.h", "KIOCGTRANS", 0x40046b05},
+{"sundev/kbio.h", "KIOCGTRANSABLE", 0x40046b07},
+{"sundev/kbio.h", "KIOCTYPE", 0x40046b09},
+{"sundev/kbio.h", "KIOCGDIRECT", 0x40046b0b},
+{"sundev/kbio.h", "KIOCGCOMPAT", 0x40046b11},
+{"sundev/kbio.h", "KIOCLAYOUT", 0x40046b14},
+{"sys/sockio.h", "SIOCGHIWAT", 0x40047301},
+{"sys/sockio.h", "SIOCGLOWAT", 0x40047303},
+{"sys/sockio.h", "SIOCATMARK", 0x40047307},
+{"sys/sockio.h", "SIOCGPGRP", 0x40047309},
+{"sys/ttold.h", "TIOCGETD", 0x40047400},
+{"sys/ttold.h", "TIOCMODG", 0x40047403},
+{"sbusdev/gtreg.h", "FB_GETWPART", 0x4004740a},
+{"sbusdev/gtreg.h", "FB_GETMONITOR", 0x4004740c},
+{"sbusdev/gtreg.h", "FB_GRABHW", 0x40047413},
+{"sbusdev/gtreg.h", "FB_GETCLUTPART", 0x40047418},
+{"sys/ttold.h", "TIOCGETX", 0x40047423},
+{"sys/ttycom.h", "TIOCGSOFTCAR", 0x40047464},
+{"sys/ttycom.h", "TIOCMGET", 0x4004746a},
+{"sys/ttycom.h", "TIOCOUTQ", 0x40047473},
+{"sys/ttycom.h", "TIOCGPGRP", 0x40047477},
+{"sys/ttold.h", "TIOCLGET", 0x4004747c},
+{"sys/ttycom.h", "TIOCISPACE", 0x40047480},
+{"sys/ttycom.h", "TIOCISIZE", 0x40047481},
+{"sys/ttycom.h", "TIOCGETPGRP", 0x40047483},
+{"sys/vcmd.h", "VGETSTATE", 0x40047600},
+{"sundev/vuid_event.h", "VUIDGFORMAT", 0x40047602},
+{"sun/dkio.h", "DKIOCGTYPE", 0x4006647c},
+{"sys/ttold.h", "TIOCGETP", 0x40067408},
+{"sys/ttold.h", "TIOCGETC", 0x40067412},
+{"sys/ttold.h", "TIOCGLTC", 0x40067474},
+{"sun/tvio.h", "TVIOGPOS", 0x4008581b},
+{"sun/dkio.h", "DKIOCGPART", 0x40086404},
+{"sun/dkio.h", "FDKGETSEARCH", 0x4008646c},
+{"sunwindow/win_ioctl.h", "WINNEXTFREE", 0x40086705},
+{"sunwindow/win_ioctl.h", "WINGETRECT", 0x4008670a},
+{"sunwindow/win_ioctl.h", "WINGETSAVEDRECT", 0x4008670d},
+{"sunwindow/win_ioctl.h", "WINGETEVENTTIMEOUT", 0x4008673c},
+{"sunwindow/win_ioctl.h", "WINDBLCURRENT", 0x4008674d},
+{"sun/sqz.h", "SQZGET", 0x40087102},
+{"sbusdev/gtreg.h", "FB_GETLIGHTPENPARAM", 0x4008741b},
+{"sbusdev/gtreg.h", "FB_GETGAMMA", 0x40087420},
+{"sys/ttycom.h", "TIOCGSIZE", 0x40087426},
+{"sys/ttold.h", "_O_TIOCGSIZE", 0x40087466},
+{"sys/ttycom.h", "TIOCGWINSZ", 0x40087468},
+{"sun/dkio.h", "DKIOCINFO", 0x400c6408},
+{"sun/dkio.h", "DKIOCGDIAG", 0x400c6474},
+{"sun/dkio.h", "DKIOCGLOG", 0x400c6476},
+{"sunwindow/win_ioctl.h", "WINGETFOCUSEVENT", 0x400c6747},
+{"sunwindow/win_ioctl.h", "WINGETSWALLOWEVENT", 0x400c6749},
+{"pixrect/cg8var.h", "PIPIO_G_EMULATION_MODE", 0x400e5803},
+{"sun/fbio.h", "FBIOGXINFO", 0x40104627},
+{"sys/stropts.h", "I_RECVFD", 0x40105312},
+{"stropts.h", "I_RECVFD", 0x40105312},
+{"sunwindow/win_ioctl.h", "WINGETSCREENPOSITIONS", 0x4010672d},
+{"scsi/targets/stdef.h", "STIOCGET", 0x40106d02},
+{"sundev/streg.h", "STIOCGET", 0x40106d02},
+{"sys/termio.h", "TCGETA", 0x40125401},
+{"termio.h", "TCGETA", 0x40125401},
+{"sunwindow/win_ioctl.h", "WINGETAVAILPLANEGROUPS", 0x40146742},
+{"sun/fbio.h", "FBIOGTYPE", 0x40184600},
+{"sun/fbio.h", "FBIOGINFO", 0x40184602},
+{"sun/fbio.h", "FBIODBLGINFO", 0x40184612},
+{"sys/mtio.h", "MTIOCGET", 0x40186d02},
+{"sun/dkio.h", "FDKIOGCHAR", 0x401c6472},
+{"sun/fbio.h", "FBIOMONINFO", 0x40204628},
+{"sbusdev/bpp_io.h", "BPPIOC_GETPARMS", 0x40206202},
+{"sbusdev/gtreg.h", "FB_GT_GETVERSION", 0x40207429},
+{"sys/termios.h", "TCGETS", 0x40245408},
+{"termios.h", "TCGETS", 0x40245408},
+{"sun/dkio.h", "DKIOCGGEOM", 0x40266402},
+{"sunwindow/win_ioctl.h", "WINGETKBDMASK", 0x40346734},
+{"sunwindow/win_ioctl.h", "WINGETPICKMASK", 0x40346735},
+{"sun/dkio.h", "FDKGETDRIVECHAR", 0x4038646e},
+{"sun/dkio.h", "DKIOCGCONF", 0x403c647e},
+{"sun/tvio.h", "TVIOGVIDEOCAL", 0x40405831},
+{"sun/tvio.h", "TVIONVREAD", 0x40405833},
+{"sun/dkio.h", "DKIOCGAPART", 0x4040647a},
+{"sunwindow/win_ioctl.h", "WINGETSCALING", 0x40406726},
+{"sun/fbio.h", "FBIOGATTR", 0x40584606},
+{"sunwindow/win_ioctl.h", "WINSCREENGET", 0x40646729},
+{"sunwindow/win_ioctl.h", "WINGETINPUTMASK", 0x406c6713},
+{"sun/audioio.h", "AUDIO_GETINFO", 0x40844101},
+{"pixrect/cg8var.h", "PIPIO_G_FB_INFO", 0x40d05801},
+{"sundev/kbio.h", "KIOCSLED", 0x80016b0e},
+{"sundev/ppreg.h", "PPIOCSETC", 0x80017002},
+{"sys/ttycom.h", "TIOCSTI", 0x80017472},
+{"sun/tvio.h", "TVIOSBIND", 0x80025820},
+{"sbusdev/bpp_io.h", "BPPIOC_SETOUTPINS", 0x80026203},
+{"sun/isdnio.h", "ISDN_MESSAGE_SET", 0x8004410c},
+{"sun/fbio.h", "FBIOSVIDEO", 0x80044607},
+{"sun/fbio.h", "FBIOVERTICAL", 0x80044609},
+{"sun/fbio.h", "GRABPAGEFREE", 0x8004460b},
+{"sun/fbio.h", "GRABATTACH", 0x8004460c},
+{"sun/fbio.h", "FBIOSCMSIZE", 0x8004460f},
+{"sun/fbio.h", "FBIOSCMS", 0x80044610},
+{"sun/fbio.h", "FBIOSCURPOS", 0x8004461a},
+{"sun/fbio.h", "FBIOGCURPOS", 0x8004461b},
+{"sun/fbio.h", "FBIO_U_RST", 0x80044623},
+{"sun/gpio.h", "GP1IO_FREE_STATIC_BLOCK", 0x80044702},
+{"sun/gpio.h", "GP1IO_CHK_GP", 0x80044704},
+{"sun/gpio.h", "GP1IO_REDIRECT_DEVFB", 0x80044706},
+{"sun/gpio.h", "GP1IO_SET_USING_GBUFFER", 0x8004470a},
+{"sun/mem.h", "MM_CCRW", 0x80044d03},
+{"sun/mem.h", "MM_PCNT0", 0x80044d04},
+{"sun/mem.h", "MM_PCNT1", 0x80044d05},
+{"sun/vddrv.h", "VDFREEVADDR", 0x80045604},
+{"sun/tvio.h", "TVIOSFORMAT", 0x80045802},
+{"sun/tvio.h", "TVIOSCOMPOUT", 0x80045804},
+{"sun/tvio.h", "TVIOSSYNC", 0x80045806},
+{"pixrect/cg8var.h", "PIPIO_S_PIP_ON_OFF", 0x80045807},
+{"sun/tvio.h", "TVIOSOUT", 0x80045808},
+{"sun/tvio.h", "TVIOSCOMPRESS", 0x8004580a},
+{"sun/tvio.h", "TVIOSCHROMAGAIN", 0x8004580c},
+{"sun/tvio.h", "TVIOSREDGAIN", 0x8004580e},
+{"sun/tvio.h", "TVIOSREDBLACK", 0x80045810},
+{"sun/tvio.h", "TVIOSGREENGAIN", 0x80045812},
+{"sun/tvio.h", "TVIOSGREENBLACK", 0x80045814},
+{"sun/tvio.h", "TVIOSBLUEGAIN", 0x80045816},
+{"sun/tvio.h", "TVIOSBLUEBLACK", 0x80045818},
+{"sun/tvio.h", "TVIOSLUMAGAIN", 0x8004581a},
+{"sun/tvio.h", "TVIOSLIVE", 0x80045824},
+{"sun/tvio.h", "TVIOSCHROMASEP", 0x80045828},
+{"pixrect/cg8var.h", "PIPIO_S_CURSOR_COLOR_FREEZE", 0x80045829},
+{"pixrect/cg8var.h", "PIPIO_S_MAP_SLOT", 0x8004582a},
+{"sun/tvio.h", "TVIOSCHROMADEMOD", 0x8004582a},
+{"pixrect/cg8var.h", "PIPIO_S_TEST", 0x8004582c},
+{"sun/tvio.h", "TVIOSGENLOCK", 0x8004582c},
+{"sun/tvio.h", "TVIOSIBADVANCE", 0x80045835},
+{"sun/tvio.h", "TVIOSABSTATE", 0x80045838},
+{"sun/tvio.h", "TVIOSCONTROL", 0x8004583c},
+{"sundev/srreg.h", "CDROMPLAYTRKIND", 0x8004630d},
+{"scsi/targets/srdef.h", "CDROMPLAYTRKIND", 0x8004630d},
+{"sundev/srreg.h", "CDROMVOLCTRL", 0x8004630e},
+{"sun/dkio.h", "DKIOCGBAD", 0x80046478},
+{"sun/dkio.h", "DKIOCSBAD", 0x80046479},
+{"sys/filio.h", "FIOSETOWN", 0x8004667c},
+{"sys/filio.h", "FIOASYNC", 0x8004667d},
+{"sys/filio.h", "FIONBIO", 0x8004667e},
+{"sunwindow/win_ioctl.h", "WINSETMOUSE", 0x80046706},
+{"sunwindow/win_ioctl.h", "WINSETUSERFLAGS", 0x8004670f},
+{"sunwindow/win_ioctl.h", "WINSETOWNER", 0x80046711},
+{"sunwindow/win_ioctl.h", "WINDONEDAMAGED", 0x80046721},
+{"sunwindow/win_ioctl.h", "WINSETBUTTONORDER", 0x80046725},
+{"sunwindow/win_ioctl.h", "WINSETNEXTINPUT", 0x80046738},
+{"sunwindow/win_ioctl.h", "WINSETKBDFOCUS", 0x8004673d},
+{"sunwindow/win_ioctl.h", "WINSETPLANEGROUP", 0x8004673f},
+{"sunwindow/win_ioctl.h", "WINSETNOTIFYALL", 0x80046752},
+{"sunwindow/win_ioctl.h", "WINSETRECQUE", 0x800467c8},
+{"sunwindow/win_ioctl.h", "WINSETRECORD", 0x800467c9},
+{"sunwindow/win_ioctl.h", "WINSETPLAYBACK", 0x800467cb},
+{"sys/sockio.h", "SIOCSPROMISC", 0x80046930},
+{"sundev/kbio.h", "KIOCTRANS", 0x80046b00},
+{"sundev/kbio.h", "KIOCTRANSABLE", 0x80046b06},
+{"sundev/kbio.h", "KIOCCMD", 0x80046b08},
+{"sundev/kbio.h", "KIOCSDIRECT", 0x80046b0a},
+{"sundev/kbio.h", "KIOCSCOMPAT", 0x80046b10},
+{"sun/ndio.h", "NDIOCSAT", 0x80046e04},
+{"sun/ndio.h", "NDIOCVER", 0x80046e07},
+{"net/nit_if.h", "NIOCSFLAGS", 0x80047004},
+{"net/nit_if.h", "NIOCSSNAP", 0x80047006},
+{"net/nit_buf.h", "NIOCSCHUNK", 0x80047009},
+{"sun/sqz.h", "SQZSET", 0x80047101},
+{"sys/sockio.h", "SIOCSHIWAT", 0x80047300},
+{"sys/sockio.h", "SIOCSLOWAT", 0x80047302},
+{"sys/sockio.h", "SIOCSPGRP", 0x80047308},
+{"sys/ttold.h", "TIOCSETD", 0x80047401},
+{"sys/ttold.h", "TIOCMODS", 0x80047404},
+{"sbusdev/gtreg.h", "FB_FCSFREE", 0x80047406},
+{"sbusdev/gtreg.h", "FB_SETDIAGMODE", 0x80047408},
+{"sbusdev/gtreg.h", "FB_SETWPART", 0x80047409},
+{"sbusdev/gtreg.h", "FB_SETMONITOR", 0x8004740b},
+{"sys/ttold.h", "TIOCFLUSH", 0x80047410},
+{"sbusdev/gtreg.h", "FB_LOADKMCB", 0x80047411},
+{"sbusdev/gtreg.h", "FB_SETCLUTPART", 0x80047417},
+{"sbusdev/gtreg.h", "FB_LIGHTPENENABLE", 0x80047419},
+{"sys/ttycom.h", "TIOCTCNTL", 0x80047420},
+{"sys/ttycom.h", "TIOCSIGNAL", 0x80047421},
+{"sys/ttold.h", "TIOCSETX", 0x80047422},
+{"sys/ttycom.h", "TIOCSSOFTCAR", 0x80047465},
+{"sys/ttycom.h", "TIOCUCNTL", 0x80047466},
+{"sys/ttycom.h", "TIOCREMOTE", 0x80047469},
+{"sys/ttycom.h", "TIOCMBIC", 0x8004746b},
+{"sys/ttycom.h", "TIOCMBIS", 0x8004746c},
+{"sys/ttycom.h", "TIOCMSET", 0x8004746d},
+{"sys/ttycom.h", "TIOCPKT", 0x80047470},
+{"sys/ttycom.h", "TIOCSPGRP", 0x80047476},
+{"sys/ttold.h", "TIOCLSET", 0x8004747d},
+{"sys/ttold.h", "TIOCLBIC", 0x8004747e},
+{"sys/ttold.h", "TIOCLBIS", 0x8004747f},
+{"sys/ttycom.h", "TIOCSETPGRP", 0x80047482},
+{"sundev/vuid_event.h", "VUIDSFORMAT", 0x80047601},
+{"sys/vcmd.h", "VSETSTATE", 0x80047601},
+{"sundev/vuid_event.h", "VUIDSADDR", 0x80047603},
+{"scsi/targets/srdef.h", "CDROMPLAYMSF", 0x8006630c},
+{"sundev/srreg.h", "CDROMPLAYMSF", 0x8006630c},
+{"sun/dkio.h", "DKIOCSTYPE", 0x8006647d},
+{"sys/ttold.h", "TIOCSETP", 0x80067409},
+{"sys/ttold.h", "TIOCSETN", 0x8006740a},
+{"sys/ttold.h", "TIOCSETC", 0x80067411},
+{"sys/ttold.h", "TIOCSLTC", 0x80067475},
+{"sun/isdnio.h", "ISDN_SET_LOOPBACK", 0x8008410e},
+{"sun/isdnio.h", "ISDN_RESET_LOOPBACK", 0x8008410f},
+{"sundev/lightpenreg.h", "LIGHTPEN_CALIBRATE", 0x80084c01},
+{"sun/tvio.h", "TVIOSPOS", 0x8008581c},
+{"sun/dkio.h", "DKIOCSPART", 0x80086405},
+{"sun/dkio.h", "FDKSETSEARCH", 0x8008646b},
+{"sunwindow/win_ioctl.h", "WINSETLINK", 0x80086701},
+{"sunwindow/win_ioctl.h", "WINSETRECT", 0x8008670b},
+{"sunwindow/win_ioctl.h", "WINSETSAVEDRECT", 0x8008670c},
+{"sunwindow/win_ioctl.h", "WINPARTIALREPAIR", 0x8008672b},
+{"sunwindow/win_ioctl.h", "WINSETEVENTTIMEOUT", 0x8008673b},
+{"sunwindow/win_ioctl.h", "WINDBLSET", 0x8008674b},
+{"sunwindow/win_ioctl.h", "WINSETPLAYINTR", 0x800867cc},
+{"sys/mtio.h", "MTIOCTOP", 0x80086d01},
+{"net/nit_buf.h", "NIOCSTIME", 0x80087006},
+{"sbusdev/gtreg.h", "FB_VMBACK", 0x80087415},
+{"sbusdev/gtreg.h", "FB_VMUNBACK", 0x80087416},
+{"sbusdev/gtreg.h", "FB_SETLIGHTPENPARAM", 0x8008741a},
+{"sbusdev/gtreg.h", "FB_SETGAMMA", 0x8008741f},
+{"sys/ttycom.h", "TIOCSSIZE", 0x80087425},
+{"sys/ttold.h", "_O_TIOCSSIZE", 0x80087467},
+{"sys/ttycom.h", "TIOCSWINSZ", 0x80087467},
+{"sun/isdnio.h", "ISDN_SET_PARAM", 0x800c4110},
+{"sun/fbio.h", "FBIO_WID_FREE", 0x800c461f},
+{"sun/fbio.h", "FBIO_WID_PUT", 0x800c4620},
+{"sun/fbio.h", "FBIO_WID_GET", 0x800c4621},
+{"sundev/lightpenreg.h", "LIGHTPEN_FILTER", 0x800c4c02},
+{"sundev/fdreg.h", "V_FORMAT", 0x800c5605},
+{"sundev/srreg.h", "CDROMREADMODE2", 0x800c636e},
+{"sundev/srreg.h", "CDROMREADMODE1", 0x800c636f},
+{"sunwindow/win_ioctl.h", "WINSETCURSOR", 0x800c6707},
+{"sunwindow/win_ioctl.h", "WINSETFOCUSEVENT", 0x800c6746},
+{"sunwindow/win_ioctl.h", "WINSETSWALLOWEVENT", 0x800c6748},
+{"sundev/msio.h", "MSIOSETPARMS", 0x800c6d03},
+{"sbusdev/gtreg.h", "FB_CLUTFREE", 0x800c7402},
+{"sbusdev/gtreg.h", "FB_VMCTL", 0x800c741e},
+{"pixrect/cg8var.h", "PIPIO_S_EMULATION_MODE", 0x800e5804},
+{"sunwindow/win_ioctl.h", "WINSCREENPOSITIONS", 0x8010672b},
+{"sundev/kbio.h", "KIOCSETKEY", 0x80106b01},
+{"sun/ndio.h", "NDIOCETHER", 0x80106e08},
+{"sys/termio.h", "TCSETA", 0x80125402},
+{"termio.h", "TCSETA", 0x80125402},
+{"sys/termio.h", "TCSETAW", 0x80125403},
+{"termio.h", "TCSETAW", 0x80125403},
+{"sys/termio.h", "TCSETAF", 0x80125404},
+{"termio.h", "TCSETAF", 0x80125404},
+{"sun/fbio.h", "FBIOPUTCMAP", 0x80144603},
+{"sun/fbio.h", "FBIOGETCMAP", 0x80144604},
+{"sunwindow/win_ioctl.h", "WINSETAVAILPLANEGROUPS", 0x80146741},
+{"sunwindow/win_ioctl.h", "WINSETSYNCPT", 0x801467cd},
+{"sundev/kbio.h", "KIOCSKEY", 0x80146b0c},
+{"sun/fbio.h", "FBIODBLSINFO", 0x80184613},
+{"sun/gpio.h", "GP1IO_PUT_INFO", 0x80184700},
+{"sun/dkio.h", "DKIOCSCMD", 0x80186477},
+{"sunwindow/win_ioctl.h", "WINSETINPUTDEV", 0x80186732},
+{"sun/ndio.h", "NDIOCUSER", 0x80186e03},
+{"sun/fbio.h", "FBIOPUTCMAPI", 0x801c4629},
+{"sun/fbio.h", "FBIOGETCMAPI", 0x801c462a},
+{"sun/dkio.h", "FDKIOSCHAR", 0x801c6471},
+{"sbusdev/gtreg.h", "FB_CLUTPOST", 0x801c7404},
+{"sbusdev/bpp_io.h", "BPPIOC_SETPARMS", 0x80206201},
+{"sys/sockio.h", "SIOCSIFADDR", 0x8020690c},
+{"sys/sockio.h", "SIOCSIFDSTADDR", 0x8020690e},
+{"sys/sockio.h", "SIOCSIFFLAGS", 0x80206910},
+{"sys/sockio.h", "SIOCSIFMEM", 0x80206912},
+{"sys/sockio.h", "SIOCSIFMTU", 0x80206915},
+{"sys/sockio.h", "SIOCSIFBRDADDR", 0x80206918},
+{"sys/sockio.h", "SIOCSIFNETMASK", 0x8020691a},
+{"sys/sockio.h", "SIOCSIFMETRIC", 0x8020691c},
+{"sys/sockio.h", "SIOCUPPER", 0x80206928},
+{"sys/sockio.h", "SIOCLOWER", 0x80206929},
+{"sys/sockio.h", "SIOCSETSYNC", 0x8020692c},
+{"sys/sockio.h", "SIOCADDMULTI", 0x80206931},
+{"sys/sockio.h", "SIOCDELMULTI", 0x80206932},
+{"sys/sockio.h", "SIOCFDRESET", 0x80206933},
+{"sys/sockio.h", "SIOCFDSLEEP", 0x80206934},
+{"sys/sockio.h", "SIOCLDNSTRTFW", 0x80206936},
+{"sys/sockio.h", "SIOCGETFDSTAT", 0x80206937},
+{"sys/sockio.h", "SIOCFDNMIINT", 0x80206938},
+{"sys/sockio.h", "SIOCFDEXUSER", 0x80206939},
+{"sys/sockio.h", "SIOCFDGNETMAP", 0x8020693a},
+{"sys/sockio.h", "SIOCFDGIOCTL", 0x8020693b},
+{"net/nit_if.h", "NIOCBIND", 0x80207003},
+{"sbusdev/gtreg.h", "FB_GT_SETVERSION", 0x80207428},
+{"sys/stropts.h", "I_FDINSERT", 0x80245310},
+{"stropts.h", "I_FDINSERT", 0x80245310},
+{"termios.h", "TCSETS", 0x80245409},
+{"sys/termios.h", "TCSETS", 0x80245409},
+{"termios.h", "TCSETSW", 0x8024540a},
+{"sys/termios.h", "TCSETSW", 0x8024540a},
+{"termios.h", "TCSETSF", 0x8024540b},
+{"sys/termios.h", "TCSETSF", 0x8024540b},
+{"sys/sockio.h", "SIOCSARP", 0x8024691e},
+{"sys/sockio.h", "SIOCDARP", 0x80246920},
+{"sys/sockio.h", "SIOCSNIT", 0x80247000},
+{"sun/dkio.h", "DKIOCSGEOM", 0x80266403},
+{"sun/fbio.h", "FBIOSATTR", 0x80284605},
+{"sun/fbio.h", "FBIOSCURSOR", 0x802c4618},
+{"sunwindow/win_ioctl.h", "WINSETLOCATOR", 0x80306730},
+{"sunwindow/win_ioctl.h", "WINSETCPCURSOR", 0x80306796},
+{"sbusdev/audio_79C30.h", "AUDIOSETREG", 0x80306902},
+{"sys/sockio.h", "SIOCADDRT", 0x8030720a},
+{"sys/sockio.h", "SIOCDELRT", 0x8030720b},
+{"sunwindow/win_ioctl.h", "WINSETKBDMASK", 0x80346736},
+{"sunwindow/win_ioctl.h", "WINSETPICKMASK", 0x80346737},
+{"sun/dkio.h", "FDKSETDRIVECHAR", 0x8038646d},
+{"sun/tvio.h", "TVIOSVIDEOCAL", 0x80405832},
+{"sun/tvio.h", "TVIONVWRITE", 0x80405834},
+{"sun/dkio.h", "DKIOCSAPART", 0x8040647b},
+{"sunwindow/win_ioctl.h", "WINSETSCALING", 0x80406727},
+{"net/nit_pf.h", "NIOCSETF", 0x80527002},
+{"pixrect/gp1var.h", "GP1IO_SATTR", 0x80584765},
+{"sunwindow/win_ioctl.h", "WINSETINPUTMASK", 0x806c6714},
+{"sunwindow/win_ioctl.h", "WINSCREENNEW", 0x80706728},
+{"sunwindow/win_ioctl.h", "WINSETKBD", 0x8070672e},
+{"sunwindow/win_ioctl.h", "WINSETMS", 0x8070672f},
diff --git a/sunos4/ioctlent.sh b/sunos4/ioctlent.sh
new file mode 100644
index 000000000..6ae029424
--- /dev/null
+++ b/sunos4/ioctlent.sh
@@ -0,0 +1,124 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+if [ $# -ne 1 ]
+then
+ echo "usage: $0 include-directory" >&2
+ exit 1
+fi
+
+bad_defines='WINGETVALIDVALUES'
+(
+ cd $1
+ find . -name '*.h' -print | sed 's/^\.\///' |
+ xargs egrep '^[ ]*#[ ]*define[ ][ ]*[A-Z_][A-Za-z0-9_]*[ ][ ]*_IO[RW]?\(' /dev/null |
+ sed 's/\(.*\):#[ ]*define[ ]*\([A-Z_][A-Za-z0-9_]*\)[ ]*\(_IO[^)]*)\)[ ]*\(.*\)/ { "\1", "\2", \2 }, \4/' |
+ sort -u
+) >ioctlent.tmp
+echo "\
+#include <sys/types.h>
+#define KERNEL
+#include <stdio.h>
+#include <strings.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/des.h>
+#include <sys/mtio.h>
+#include <sys/stropts.h>
+#include <sys/stream.h>
+#include <sys/vcmd.h>
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/route.h>
+#include <net/nit.h>
+#include <net/nit_if.h>
+#include <net/nit_pf.h>
+#include <net/nit_buf.h>
+#include <net/packetfilt.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/in_var.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/if_ether.h>
+
+#include <scsi/impl/uscsi.h>
+#define sprintf scsi_sprintf
+#include <scsi/scsi.h>
+#undef sprintf
+#include <scsi/targets/srdef.h>
+#include <scsi/targets/stdef.h>
+#if 0
+#include <scsi/targets/sddef.h>
+#endif
+
+#include <sun/audioio.h>
+#include <sun/fbio.h>
+#include <sun/gpio.h>
+#include <sun/ndio.h>
+#include <sun/tvio.h>
+#include <sun/mem.h>
+#include <sun/sqz.h>
+#include <sun/vddrv.h>
+#include <sun/isdnio.h>
+
+#include <machine/reg.h>
+
+#include <sundev/kbio.h>
+#include <sundev/msio.h>
+#include <sundev/fdreg.h>
+#include <sundev/ppreg.h>
+#include <sundev/openpromio.h>
+#include <sundev/lightpenreg.h>
+
+#include <sunwindow/window_hs.h>
+#include <sunwindow/win_enum.h>
+#include <sunwindow/win_ioctl.h>
+
+#include <sbusdev/audiovar.h>
+#define AMD_CHIP
+#include <sbusdev/audio_79C30.h>
+#include <sbusdev/bpp_io.h>
+#include <sbusdev/gtreg.h>
+
+#include <sys/termio.h>
+"
+echo "struct ioctlent ioctlent[] = {"
+egrep -v "$bad_defines" ioctlent.tmp | awk '
+{
+ print "#ifdef " $4
+ print
+ print "#endif"
+}
+'
+echo "};"
+rm -f ioctlent.tmp
diff --git a/sunos4/signalent.h b/sunos4/signalent.h
new file mode 100644
index 000000000..e059b5d01
--- /dev/null
+++ b/sunos4/signalent.h
@@ -0,0 +1,32 @@
+ "SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGURG", /* 16 */
+ "SIGSTOP", /* 17 */
+ "SIGTSTP", /* 18 */
+ "SIGCONT", /* 19 */
+ "SIGCHLD", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGIO", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGLOST", /* 29 */
+ "SIGUSR1", /* 30 */
+ "SIGUSR2", /* 31 */
diff --git a/sunos4/syscall.h b/sunos4/syscall.h
new file mode 100644
index 000000000..57e877af1
--- /dev/null
+++ b/sunos4/syscall.h
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+#include "dummy.h"
+
+int sys_nosys();
+int sys_nullsys();
+int sys_errsys();
+
+/* 1.1 processes and protection */
+int sys_gethostid(),sys_sethostname(),sys_gethostname(),sys_getpid();
+int sys_setdomainname(),sys_getdomainname();
+int sys_fork(),sys_exit(),sys_execv(),sys_execve(),sys_wait4();
+int sys_getuid(),sys_setreuid(),sys_getgid(),sys_getgroups(),sys_setregid(),sys_setgroups();
+int sys_getpgrp(),sys_setpgrp();
+int sys_sys_setsid(), sys_setpgid();
+int sys_uname();
+
+/* 1.2 memory management */
+int sys_brk(),sys_sbrk(),sys_sstk();
+int sys_getpagesize(),sys_mmap(),sys_mctl(),sys_munmap(),sys_mprotect(),sys_mincore();
+int sys_omsync(),sys_omadvise();
+
+/* 1.3 signals */
+int sys_sigvec(),sys_sigblock(),sys_sigsetmask(),sys_sigpause(),sys_sigstack(),sys_sigcleanup();
+int sys_kill(), sys_killpg(), sys_sigpending();
+
+/* 1.4 timing and statistics */
+int sys_gettimeofday(),sys_settimeofday();
+int sys_adjtime();
+int sys_getitimer(),sys_setitimer();
+
+/* 1.5 descriptors */
+int sys_getdtablesize(),sys_dup(),sys_dup2(),sys_close();
+int sys_select(),sys_getdopt(),sys_setdopt(),sys_fcntl(),sys_flock();
+
+/* 1.6 resource controls */
+int sys_getpriority(),sys_setpriority(),sys_getrusage(),sys_getrlimit(),sys_setrlimit();
+int sys_oldquota(), sys_quotactl();
+int sys_rtschedule();
+
+/* 1.7 system operation support */
+int sys_mount(),sys_unmount(),sys_swapon();
+int sys_sync(),sys_reboot();
+int sys_sysacct();
+int sys_auditsys();
+
+/* 2.1 generic operations */
+int sys_read(),sys_write(),sys_readv(),sys_writev(),sys_ioctl();
+
+/* 2.1.1 asynch operations */
+int sys_aioread(), sys_aiowrite(), sys_aiowait(), sys_aiocancel();
+
+/* 2.2 file system */
+int sys_chdir(),sys_chroot();
+int sys_fchdir(),sys_fchroot();
+int sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents();
+int sys_creat(),sys_open(),sys_mknod(),sys_unlink(),sys_stat(),sys_fstat(),sys_lstat();
+int sys_chown(),sys_fchown(),sys_chmod(),sys_fchmod(),sys_utimes();
+int sys_link(),sys_symlink(),sys_readlink(),sys_rename();
+int sys_lseek(),sys_truncate(),sys_ftruncate(),sys_access(),sys_fsync();
+int sys_statfs(),sys_fstatfs();
+
+/* 2.3 communications */
+int sys_socket(),sys_bind(),sys_listen(),sys_accept(),sys_connect();
+int sys_socketpair(),sys_sendto(),sys_send(),sys_recvfrom(),sys_recv();
+int sys_sendmsg(),sys_recvmsg(),sys_shutdown(),sys_setsockopt(),sys_getsockopt();
+int sys_getsockname(),sys_getpeername(),sys_pipe();
+
+int sys_umask(); /* XXX */
+
+/* 2.3.1 SystemV-compatible IPC */
+int sys_semsys(), sys_semctl(), sys_semget();
+#define SYS_semsys_subcall 200
+#define SYS_semsys_nsubcalls 3
+#define SYS_semctl (SYS_semsys_subcall + 0)
+#define SYS_semget (SYS_semsys_subcall + 1)
+#define SYS_semop (SYS_semsys_subcall + 2)
+int sys_msgsys(), sys_msgget(), sys_msgctl(), sys_msgrcv(), sys_msgsnd();
+#define SYS_msgsys_subcall 203
+#define SYS_msgsys_nsubcalls 4
+#define SYS_msgget (SYS_msgsys_subcall + 0)
+#define SYS_msgctl (SYS_msgsys_subcall + 1)
+#define SYS_msgrcv (SYS_msgsys_subcall + 2)
+#define SYS_msgsnd (SYS_msgsys_subcall + 3)
+int sys_shmsys(), sys_shmat(), sys_shmctl(), sys_shmdt(), sys_shmget();
+#define SYS_shmsys_subcall 207
+#define SYS_shmsys_nsubcalls 4
+#define SYS_shmat (SYS_shmsys_subcall + 0)
+#define SYS_shmctl (SYS_shmsys_subcall + 1)
+#define SYS_shmdt (SYS_shmsys_subcall + 2)
+#define SYS_shmget (SYS_shmsys_subcall + 3)
+
+/* 2.4 processes */
+int sys_ptrace();
+
+/* 2.5 terminals */
+
+/* emulations for backwards compatibility */
+int sys_otime(); /* now use gettimeofday */
+int sys_ostime(); /* now use settimeofday */
+int sys_oalarm(); /* now use setitimer */
+int sys_outime(); /* now use utimes */
+int sys_opause(); /* now use sigpause */
+int sys_onice(); /* now use setpriority,getpriority */
+int sys_oftime(); /* now use gettimeofday */
+int sys_osetpgrp(); /* ??? */
+int sys_otimes(); /* now use getrusage */
+int sys_ossig(); /* now use sigvec, etc */
+int sys_ovlimit(); /* now use setrlimit,getrlimit */
+int sys_ovtimes(); /* now use getrusage */
+int sys_osetuid(); /* now use setreuid */
+int sys_osetgid(); /* now use setregid */
+int sys_ostat(); /* now use stat */
+int sys_ofstat(); /* now use fstat */
+
+/* BEGIN JUNK */
+int sys_profil(); /* 'cuz sys calls are interruptible */
+int sys_vhangup(); /* should just do in sys_exit() */
+int sys_vfork(); /* XXX - was awaiting fork w/ copy on write */
+int sys_ovadvise(); /* awaiting new madvise */
+int sys_indir(); /* indirect system call */
+int sys_ustat(); /* System V compatibility */
+int sys_owait(); /* should use wait4 interface */
+int sys_owait3(); /* should use wait4 interface */
+int sys_umount(); /* still more Sys V (and 4.2?) compatibility */
+int sys_pathconf(); /* posix */
+int sys_fpathconf(); /* posix */
+int sys_sysconf(); /* posix */
+
+int sys_debug();
+/* END JUNK */
+
+int sys_vtrace(); /* kernel event tracing */
+
+/* nfs */
+int sys_async_daemon(); /* client async daemon */
+int sys_nfs_svc(); /* run nfs server */
+int sys_nfs_getfh(); /* get file handle */
+int sys_exportfs(); /* export file systems */
+
+int sys_rfssys(); /* RFS-related calls */
+
+int sys_getmsg();
+int sys_putmsg();
+int sys_poll();
+
+int sys_vpixsys(); /* VP/ix system calls */
+
diff --git a/sunos4/syscallent.h b/sunos4/syscallent.h
new file mode 100644
index 000000000..f0873d270
--- /dev/null
+++ b/sunos4/syscallent.h
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+ { 1, 0, sys_indir, "indir" }, /* 0 */
+ { 1, TP, sys_exit, "_exit" }, /* 1 */
+ { 0, TP, sys_fork, "fork" }, /* 2 */
+ { 3, 0, sys_read, "read" }, /* 3 */
+ { 3, 0, sys_write, "write" }, /* 4 */
+ { 3, TF, sys_open, "open" }, /* 5 */
+ { 1, 0, sys_close, "close" }, /* 6 */
+ { 4, TP, sys_wait4, "wait4" }, /* 7 */
+ { 2, TF, sys_creat, "creat" }, /* 8 */
+ { 2, TF, sys_link, "link" }, /* 9 */
+ { 1, TF, sys_unlink, "unlink" }, /* 10 */
+ { 2, TF|TP, sys_execv, "execv" }, /* 11 */
+ { 1, TF, sys_chdir, "chdir" }, /* 12 */
+ { 0, 0, sys_otime, "otime" }, /* 13 */
+ { 3, TF, sys_mknod, "mknod" }, /* 14 */
+ { 2, TF, sys_chmod, "chmod" }, /* 15 */
+ { 3, TF, sys_chown, "chown" }, /* 16 */
+ { 1, 0, sys_brk, "brk" }, /* 17 */
+ { 2, TF, sys_stat, "stat" }, /* 18 */
+ { 3, 0, sys_lseek, "lseek" }, /* 19 */
+ { 0, 0, sys_getpid, "getpid" }, /* 20 */
+ { 0, 0, sys_nosys, "nosys" }, /* 21 */
+ { 1, TF, sys_umount, "umount" }, /* 22 */
+ { 1, 0, sys_osetuid, "osetuid" }, /* 23 */
+ { 0, 0, sys_getuid, "getuid" }, /* 24 */
+ { 1, 0, sys_ostime, "ostime" }, /* 25 */
+ { 5, 0, sys_ptrace, "ptrace" }, /* 26 */
+ { 1, 0, sys_oalarm, "oalarm" }, /* 27 */
+ { 2, 0, sys_ofstat, "ofstat" }, /* 28 */
+ { 0, 0, sys_opause, "opause" }, /* 29 */
+ { 2, TF, sys_outime, "outime" }, /* 30 */
+ { 0, 0, sys_nosys, "nosys" }, /* 31 */
+ { 0, 0, sys_nosys, "nosys" }, /* 32 */
+ { 2, TF, sys_access, "access" }, /* 33 */
+ { 1, 0, sys_onice, "onice" }, /* 34 */
+ { 1, 0, sys_oftime, "oftime" }, /* 35 */
+ { 0, 0, sys_sync, "sync" }, /* 36 */
+ { 2, TS, sys_kill, "kill" }, /* 37 */
+ { 2, TF, sys_stat, "stat" }, /* 38 */
+ { 2, 0, sys_osetpgrp, "osetpgrp" }, /* 39 */
+ { 2, TF, sys_lstat, "lstat" }, /* 40 */
+ { 2, 0, sys_dup, "dup" }, /* 41 */
+ { 0, 0, sys_pipe, "pipe" }, /* 42 */
+ { 1, 0, sys_otimes, "otimes" }, /* 43 */
+ { 4, 0, sys_profil, "profil" }, /* 44 */
+ { 0, 0, sys_nosys, "nosys" }, /* 45 */
+ { 1, 0, sys_osetgid, "osetgid" }, /* 46 */
+ { 0, 0, sys_getgid, "getgid" }, /* 47 */
+ { 2, 0, sys_ossig, "ossig" }, /* 48 */
+ { 0, 0, sys_nosys, "nosys" }, /* 49 */
+ { 0, 0, sys_nosys, "nosys" }, /* 50 */
+ { 1, 0, sys_sysacct, "sysacct" }, /* 51 */
+ { 0, 0, sys_nosys, "nosys" }, /* 52 */
+ { 4, 0, sys_mctl, "mctl" }, /* 53 */
+ { 3, 0, sys_ioctl, "ioctl" }, /* 54 */
+ { 2, 0, sys_reboot, "reboot" }, /* 55 */
+ { 3, TP, sys_owait3, "owait3" }, /* 56 */
+ { 2, TF, sys_symlink, "symlink" }, /* 57 */
+ { 3, TF, sys_readlink, "readlink" }, /* 58 */
+ { 3, TF|TP, sys_execve, "execve" }, /* 59 */
+ { 1, 0, sys_umask, "umask" }, /* 60 */
+ { 1, TF, sys_chroot, "chroot" }, /* 61 */
+ { 2, 0, sys_fstat, "fstat" }, /* 62 */
+ { 0, 0, sys_nosys, "nosys" }, /* 63 */
+ { 1, 0, sys_getpagesize, "getpagesize" }, /* 64 */
+ { 3, 0, sys_omsync, "omsync" }, /* 65 */
+ { 0, TP, sys_vfork, "vfork" }, /* 66 */
+ { 0, 0, sys_read, "read" }, /* 67 */
+ { 0, 0, sys_write, "write" }, /* 68 */
+ { 1, 0, sys_sbrk, "sbrk" }, /* 69 */
+ { 1, 0, sys_sstk, "sstk" }, /* 70 */
+ { 6, 0, sys_mmap, "mmap" }, /* 71 */
+ { 1, 0, sys_ovadvise, "ovadvise" }, /* 72 */
+ { 2, 0, sys_munmap, "munmap" }, /* 73 */
+ { 3, 0, sys_mprotect, "mprotect" }, /* 74 */
+ { 3, 0, sys_omadvise, "omadvise" }, /* 75 */
+ { 1, 0, sys_vhangup, "vhangup" }, /* 76 */
+ { 2, 0, sys_ovlimit, "ovlimit" }, /* 77 */
+ { 3, 0, sys_mincore, "mincore" }, /* 78 */
+ { 2, 0, sys_getgroups, "getgroups" }, /* 79 */
+ { 2, 0, sys_setgroups, "setgroups" }, /* 80 */
+ { 1, 0, sys_getpgrp, "getpgrp" }, /* 81 */
+ { 2, 0, sys_setpgrp, "setpgrp" }, /* 82 */
+ { 3, 0, sys_setitimer, "setitimer" }, /* 83 */
+ { 0, TP, sys_owait, "owait" }, /* 84 */
+ { 1, TF, sys_swapon, "swapon" }, /* 85 */
+ { 2, 0, sys_getitimer, "getitimer" }, /* 86 */
+ { 2, 0, sys_gethostname, "gethostname" }, /* 87 */
+ { 2, 0, sys_sethostname, "sethostname" }, /* 88 */
+ { 0, 0, sys_getdtablesize, "getdtablesize" }, /* 89 */
+ { 2, 0, sys_dup2, "dup2" }, /* 90 */
+ { 2, 0, sys_getdopt, "getdopt" }, /* 91 */
+ { 3, 0, sys_fcntl, "fcntl" }, /* 92 */
+ { 5, 0, sys_select, "select" }, /* 93 */
+ { 2, 0, sys_setdopt, "setdopt" }, /* 94 */
+ { 1, 0, sys_fsync, "fsync" }, /* 95 */
+ { 3, 0, sys_setpriority, "setpriority" }, /* 96 */
+ { 3, TN, sys_socket, "socket" }, /* 97 */
+ { 3, TN, sys_connect, "connect" }, /* 98 */
+ { 3, TN, sys_accept, "accept" }, /* 99 */
+ { 2, 0, sys_getpriority, "getpriority" }, /* 100 */
+ { 4, TN, sys_send, "send" }, /* 101 */
+ { 4, TN, sys_recv, "recv" }, /* 102 */
+ { 0, 0, sys_nosys, "nosys" }, /* 103 */
+ { 3, TN, sys_bind, "bind" }, /* 104 */
+ { 5, TN, sys_setsockopt, "setsockopt" }, /* 105 */
+ { 2, TN, sys_listen, "listen" }, /* 106 */
+ { 2, 0, sys_ovtimes, "ovtimes" }, /* 107 */
+ { 3, TS, sys_sigvec, "sigvec" }, /* 108 */
+ { 1, TS, sys_sigblock, "sigblock" }, /* 109 */
+ { 1, TS, sys_sigsetmask, "sigsetmask" }, /* 110 */
+ { 1, TS, sys_sigpause, "sigpause" }, /* 111 */
+ { 2, TS, sys_sigstack, "sigstack" }, /* 112 */
+ { 3, TN, sys_recvmsg, "recvmsg" }, /* 113 */
+ { 3, TN, sys_sendmsg, "sendmsg" }, /* 114 */
+ { 3, 0, sys_vtrace, "vtrace" }, /* 115 */
+ { 2, 0, sys_gettimeofday, "gettimeofday" }, /* 116 */
+ { 2, 0, sys_getrusage, "getrusage" }, /* 117 */
+ { 5, TN, sys_getsockopt, "getsockopt" }, /* 118 */
+ { 0, 0, sys_nosys, "nosys" }, /* 119 */
+ { 3, 0, sys_readv, "readv" }, /* 120 */
+ { 3, 0, sys_writev, "writev" }, /* 121 */
+ { 2, 0, sys_settimeofday, "settimeofday" }, /* 122 */
+ { 3, 0, sys_fchown, "fchown" }, /* 123 */
+ { 2, 0, sys_fchmod, "fchmod" }, /* 124 */
+ { 6, TN, sys_recvfrom, "recvfrom" }, /* 125 */
+ { 2, 0, sys_setreuid, "setreuid" }, /* 126 */
+ { 2, 0, sys_setregid, "setregid" }, /* 127 */
+ { 2, TF, sys_rename, "rename" }, /* 128 */
+ { 2, TF, sys_truncate, "truncate" }, /* 129 */
+ { 2, 0, sys_ftruncate, "ftruncate" }, /* 130 */
+ { 2, 0, sys_flock, "flock" }, /* 131 */
+ { 0, 0, sys_nosys, "nosys" }, /* 132 */
+ { 6, TN, sys_sendto, "sendto" }, /* 133 */
+ { 2, TN, sys_shutdown, "shutdown" }, /* 134 */
+ { 5, TN, sys_socketpair, "socketpair" }, /* 135 */
+ { 2, TF, sys_mkdir, "mkdir" }, /* 136 */
+ { 1, TF, sys_rmdir, "rmdir" }, /* 137 */
+ { 2, TF, sys_utimes, "utimes" }, /* 138 */
+ { 0, TS, sys_sigcleanup, "sigcleanup" }, /* 139 */
+ { 2, 0, sys_adjtime, "adjtime" }, /* 140 */
+ { 3, TN, sys_getpeername, "getpeername" }, /* 141 */
+ { 2, 0, sys_gethostid, "gethostid" }, /* 142 */
+ { 0, 0, sys_nosys, "nosys" }, /* 143 */
+ { 2, 0, sys_getrlimit, "getrlimit" }, /* 144 */
+ { 2, 0, sys_setrlimit, "setrlimit" }, /* 145 */
+ { 2, TS, sys_killpg, "killpg" }, /* 146 */
+ { 0, 0, sys_nosys, "nosys" }, /* 147 */
+ { 0, 0, sys_oldquota, "oldquota" }, /* 148 */
+ { 0, 0, sys_oldquota, "oldquota" }, /* 149 */
+ { 3, TN, sys_getsockname, "getsockname" }, /* 150 */
+ { 4, TN, sys_getmsg, "getmsg" }, /* 151 */
+ { 4, TN, sys_putmsg, "putmsg" }, /* 152 */
+ { 3, TN, sys_poll, "poll" }, /* 153 */
+ { 0, 0, sys_nosys, "nosys" }, /* 154 */
+ { 1, 0, sys_nfs_svc, "nfs_svc" }, /* 155 */
+ { 4, 0, sys_getdirentries, "getdirentries" }, /* 156 */
+ { 2, TF, sys_statfs, "statfs" }, /* 157 */
+ { 2, 0, sys_fstatfs, "fstatfs" }, /* 158 */
+ { 1, TF, sys_unmount, "unmount" }, /* 159 */
+ { 0, 0, sys_async_daemon, "async_daemon" }, /* 160 */
+ { 2, 0, sys_nfs_getfh, "nfs_getfh" }, /* 161 */
+ { 2, 0, sys_getdomainname, "getdomainname" }, /* 162 */
+ { 2, 0, sys_setdomainname, "setdomainname" }, /* 163 */
+ { 5, 0, sys_rtschedule, "rtschedule" }, /* 164 */
+ { 4, 0, sys_quotactl, "quotactl" }, /* 165 */
+ { 2, 0, sys_exportfs, "exportfs" }, /* 166 */
+ { 4, TF, sys_mount, "mount" }, /* 167 */
+ { 2, 0, sys_ustat, "ustat" }, /* 168 */
+ { 5, TI, sys_semsys, "semsys" }, /* 169 */
+ { 6, TI, sys_msgsys, "msgsys" }, /* 170 */
+ { 4, TI, sys_shmsys, "shmsys" }, /* 171 */
+ { 4, 0, sys_auditsys, "auditsys" }, /* 172 */
+ { 5, 0, sys_rfssys, "rfssys" }, /* 173 */
+ { 3, 0, sys_getdents, "getdents" }, /* 174 */
+ { 1, 0, sys_sys_setsid, "sys_setsid" }, /* 175 */
+ { 1, 0, sys_fchdir, "fchdir" }, /* 176 */
+ { 1, 0, sys_fchroot, "fchroot" }, /* 177 */
+ { 2, 0, sys_vpixsys, "vpixsys" }, /* 178 */
+ { 6, 0, sys_aioread, "aioread" }, /* 179 */
+ { 6, 0, sys_aiowrite, "aiowrite" }, /* 180 */
+ { 1, 0, sys_aiowait, "aiowait" }, /* 181 */
+ { 1, 0, sys_aiocancel, "aiocancel" }, /* 182 */
+ { 1, TS, sys_sigpending, "sigpending" }, /* 183 */
+ { 0, 0, sys_errsys, "errsys" }, /* 184 */
+ { 2, 0, sys_setpgid, "setpgid" }, /* 185 */
+ { 2, TF, sys_pathconf, "pathconf" }, /* 186 */
+ { 2, 0, sys_fpathconf, "fpathconf" }, /* 187 */
+ { 1, 0, sys_sysconf, "sysconf" }, /* 188 */
+ { 1, 0, sys_uname, "uname" }, /* 189 */
+ { 0, 0, sys_nosys, "nosys" }, /* 190 */
+ { 0, 0, sys_nosys, "nosys" }, /* 191 */
+ { 0, 0, sys_nosys, "nosys" }, /* 192 */
+ { 0, 0, sys_nosys, "nosys" }, /* 193 */
+ { 0, 0, sys_nosys, "nosys" }, /* 194 */
+ { 0, 0, sys_nosys, "nosys" }, /* 195 */
+ { 0, 0, sys_nosys, "nosys" }, /* 196 */
+ { 0, 0, sys_nosys, "nosys" }, /* 197 */
+ { 0, 0, sys_nosys, "nosys" }, /* 198 */
+ { 0, 0, sys_nosys, "nosys" }, /* 199 */
+ { 4, TI, sys_semctl, "semctl" }, /* 200 */
+ { 4, TI, sys_semget, "semget" }, /* 201 */
+ { 4, TI, sys_semop, "semop" }, /* 202 */
+ { 5, TI, sys_msgget, "msgget" }, /* 203 */
+ { 5, TI, sys_msgctl, "msgctl" }, /* 204 */
+ { 5, TI, sys_msgrcv, "msgrcv" }, /* 205 */
+ { 5, TI, sys_msgsnd, "msgsnd" }, /* 206 */
+ { 3, TI, sys_shmat, "shmat" }, /* 207 */
+ { 3, TI, sys_shmctl, "shmctl" }, /* 208 */
+ { 3, TI, sys_shmdt, "shmdt" }, /* 209 */
+ { 3, TI, sys_shmget, "shmget" }, /* 210 */
diff --git a/svr4/Makefile.in b/svr4/Makefile.in
new file mode 100644
index 000000000..e9627fe91
--- /dev/null
+++ b/svr4/Makefile.in
@@ -0,0 +1,58 @@
+#
+# $Id$
+#
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+CC = @CC@
+CPP = @CPP@
+SHELL = /bin/sh
+
+DEFS = @DEFS@
+LDLIBS = @LIBS@
+
+CFLAGS = -g
+LDFLAGS = -g
+WARNFLAGS = @WARNFLAGS@
+
+CPPFLAGS =
+INCLUDES = -I. -I.. -I$(srcdir)
+
+includedir = @includedir@
+
+all: ioctlent.h errnoent.h signalent.h syscallent.h
+
+ioctlent.c: ioctlent.sh
+ $(SHELL) $(srcdir)/ioctlent.sh $(includedir) >$@
+
+ioctlent.raw: ioctlent.c
+ $(CPP) ioctlent.c | sed 1,/xyzzy/d >$@
+
+ioctlent.h: ioctlent.raw ioctlsort
+ ./ioctlsort >$@
+
+ioctlsort: ioctlsort.o
+ $(CC) $(LDFLAGS) ioctlsort.o -o ioctlsort
+
+ioctlsort.o: ../ioctlsort.c ioctlent.raw
+ $(CC) $(WARNFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS) -c $(srcdir)/../ioctlsort.c
+
+errnoent.h: ../errnoent.sh $(includedir)/sys/errno.h
+ $(SHELL) $(srcdir)/../errnoent.sh $(includedir)/sys/errno.h >$@
+
+signalent.h: ../signalent.sh $(includedir)/sys/signal.h
+ $(SHELL) $(srcdir)/../signalent.sh $(includedir)/sys/signal.h >$@
+
+#syscallent.h: ../syscallent.sh $(includedir)/sys/syscall.h
+syscallent.h:
+ $(SHELL) $(srcdir)/../syscallent.sh $(includedir)/sys/syscall.h >$@
+
+clean:
+ rm -f ioctlent.c *.raw *.tmp *.o ioctlsort
+
+distclean: clean
+ rm -f Makefile
+
+maintainer-clean: distclean
+ rm -f ioctlent.h errnoent.h signalent.h
diff --git a/svr4/dummy.h b/svr4/dummy.h
new file mode 100644
index 000000000..96e7d25a0
--- /dev/null
+++ b/svr4/dummy.h
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+/* still unfinished */
+
+#define sys_sysmp printargs
+#define sys_sginap printargs
+#define sys_sgikopt printargs
+#define sys_sysmips printargs
+#define sys_sigreturn printargs
+#define sys_recvmsg printargs
+#define sys_sendmsg printargs
+#define sys_nfssvc printargs
+#define sys_getfh printargs
+#define sys_async_daemon printargs
+#define sys_exportfs printargs
+#define sys_BSD_getime printargs
+#define sys_sproc printargs
+#define sys_procblk printargs
+#define sys_sprocsp printargs
+#define sys_msync printargs
+#define sys_madvise printargs
+#define sys_pagelock printargs
+#define sys_quotactl printargs
+#define sys_cacheflush printargs
+#define sys_cachectl printargs
+#define sys_nuname printargs
+#define sys_sigpoll printargs
+#define sys_swapctl printargs
+#define sys_sigstack printargs
+#define sys_sigsendset printargs
+#define sys_priocntl printargs
+#define sys_ksigqueue printargs
+#define sys_lwp_sema_wait printargs
+#define sys_memcntl printargs
+#define sys_syscall printargs
+#define sys_clocal printargs
+#define sys_syssun printargs
+#define sys_sysi86 printargs
+#define sys_sysmachine printargs
+#define sys_plock printargs
+#define sys_pathconf printargs
+#define sys_sigtimedwait printargs
+#define sys_ulimit printargs
+#define sys_ptrace printargs
+#define sys_stty printargs
+#define sys_lwp_info printargs
+#define sys_priocntlsys printargs
+#define sys_hrtsys printargs
+#define sys_xenix printargs
+#define sys_statfs printargs
+#define sys_fstatfs printargs
+#define sys_statvfs printargs
+#define sys_fstatvfs printargs
+#define sys_fork1 printargs
+#define sys_sigsendsys printargs
+#define sys_gtty printargs
+#define sys_vtrace printargs
+#define sys_fpathconf printargs
+#define sys_evsys printargs
+#define sys_acct printargs
+#define sys_exec printargs
+#define sys_lwp_sema_post printargs
+#define sys_nfssys printargs
+#define sys_sigaltstack printargs
+#define sys_uadmin printargs
+#define sys_umount printargs
+#define sys_modctl printargs
+#define sys_acancel printargs
+#define sys_async printargs
+#define sys_evtrapret printargs
+#define sys_lwp_create printargs
+#define sys_lwp_exit printargs
+#define sys_lwp_suspend printargs
+#define sys_lwp_continue printargs
+#define sys_lwp_kill printargs
+#define sys_lwp_self printargs
+#define sys_lwp_setprivate printargs
+#define sys_lwp_getprivate printargs
+#define sys_lwp_wait printargs
+#define sys_lwp_mutex_unlock printargs
+#define sys_lwp_mutex_lock printargs
+#define sys_lwp_cond_wait printargs
+#define sys_lwp_cond_signal printargs
+#define sys_lwp_cond_broadcast printargs
+#define sys_llseek printargs
+#define sys_inst_sync printargs
+#define sys_auditsys printargs
+#define sys_processor_bind printargs
+#define sys_processor_info printargs
+#define sys_p_online printargs
+#define sys_sigqueue printargs
+#define sys_clock_gettime printargs
+#define sys_clock_settime printargs
+#define sys_clock_getres printargs
+#define sys_nanosleep printargs
+#define sys_timer_create printargs
+#define sys_timer_delete printargs
+#define sys_timer_settime printargs
+#define sys_timer_gettime printargs
+#define sys_timer_getoverrun printargs
+#define sys_signal printargs
+#define sys_sigset printargs
+#define sys_sighold printargs
+#define sys_sigrelse printargs
+#define sys_sigignore printargs
+#define sys_sigpause printargs
+#define sys_msgctl printargs
+#define sys_msgget printargs
+#define sys_msgrcv printargs
+#define sys_msgsnd printargs
+#define sys_shmat printargs
+#define sys_shmctl printargs
+#define sys_shmdt printargs
+#define sys_shmget printargs
+#define sys_semctl printargs
+#define sys_semget printargs
+#define sys_semop printargs
+#define sys_olduname printargs
+#define sys_ustat printargs
+#define sys_fusers printargs
+#define sys_sysfs1 printargs
+#define sys_sysfs2 printargs
+#define sys_sysfs3 printargs
+
+/* like another call */
+#define sys_lchown sys_chown
+#define sys_setuid sys_close
+#define sys_seteuid sys_close
+#define sys_setgid sys_close
+#define sys_setegid sys_close
+#define sys_vhangup sys_close
+#define sys_fdsync sys_close
+#define sys_sigfillset sys_sigpending
+#define sys_vfork sys_fork
+#define sys_ksigaction sys_sigaction
+#define sys_BSDgetpgrp sys_getpgrp
+#define sys_BSDsetpgrp sys_setpgrp
+#define sys_waitsys sys_waitid
+
+/* printargs does the right thing */
+#define sys_sync printargs
+#define sys_profil printargs
+#define sys_yield printargs
+#define sys_pause printargs
+#define sys_sethostid printargs
+
+/* subfunction entry points */
+#define sys_pgrpsys printargs
+#define sys_sigcall printargs
+#define sys_msgsys printargs
+#define sys_shmsys printargs
+#define sys_semsys printargs
+#define sys_utssys printargs
+#define sys_sysfs printargs
+#define sys_spcall printargs
+#define sys_context printargs
+
+#if DONE
+#define sys_mount printargs
+#define sys_sysinfo printargs
+#define sys_sysconfig printargs
+#define sys_getpmsg printargs
+#define sys_putpmsg printargs
+#define sys_pread printargs
+#define sys_pwrite printargs
+#define sys_readv printargs
+#define sys_writev printargs
+#define sys_wait printargs
+#define sys_waitid printargs
+#define sys_sigsuspend printargs
+#define sys_getpgrp printargs
+#define sys_setpgrp printargs
+#define sys_getsid printargs
+#define sys_setsid printargs
+#define sys_getpgid printargs
+#define sys_setpgid printargs
+#define sys_getcontext printargs
+#define sys_setcontext printargs
+#define sys_stime printargs
+#define sys_time printargs
+#define sys_nice printargs
+#define sys_times printargs
+#define sys_alarm printargs
+#define sys_xstat printargs
+#define sys_fxstat printargs
+#define sys_lxstat printargs
+#define sys_xmknod printargs
+#define sys_exit printargs
+#define sys_fork printargs
+#define sys_read printargs
+#define sys_write printargs
+#define sys_open printargs
+#define sys_close printargs
+#define sys_creat printargs
+#define sys_link printargs
+#define sys_unlink printargs
+#define sys_chdir printargs
+#define sys_mknod printargs
+#define sys_chmod printargs
+#define sys_chown printargs
+#define sys_brk printargs
+#define sys_stat printargs
+#define sys_lseek printargs
+#define sys_getpid printargs
+#define sys_getuid printargs
+#define sys_fstat printargs
+#define sys_utime printargs
+#define sys_access printargs
+#define sys_kill printargs
+#define sys_dup printargs
+#define sys_pipe printargs
+#define sys_getgid printargs
+#define sys_ioctl printargs
+#define sys_umask printargs
+#define sys_chroot printargs
+#define sys_fcntl printargs
+#define sys_rmdir printargs
+#define sys_mkdir printargs
+#define sys_getdents printargs
+#define sys_getmsg printargs
+#define sys_putmsg printargs
+#define sys_poll printargs
+#define sys_lstat printargs
+#define sys_symlink printargs
+#define sys_readlink printargs
+#define sys_setgroups printargs
+#define sys_getgroups printargs
+#define sys_fchmod printargs
+#define sys_fchown printargs
+#define sys_sigprocmask printargs
+#define sys_sigaction printargs
+#define sys_sigpending printargs
+#define sys_mincore printargs
+#define sys_mmap printargs
+#define sys_mprotect printargs
+#define sys_munmap printargs
+#define sys_vfork printargs
+#define sys_fchdir printargs
+#define sys_setrlimit printargs
+#define sys_getrlimit printargs
+#define sys_rename printargs
+#define sys_uname printargs
+#define sys_adjtime printargs
+#define sys_fchroot printargs
+#define sys_utimes printargs
+#define sys_gettimeofday printargs
+#define sys_getitimer printargs
+#define sys_setitimer printargs
+#endif
diff --git a/svr4/errnoent.h b/svr4/errnoent.h
new file mode 100644
index 000000000..418e2db9c
--- /dev/null
+++ b/svr4/errnoent.h
@@ -0,0 +1,152 @@
+ "ERRNO_0", /* 0 */
+ "EPERM", /* 1 */
+ "ENOENT", /* 2 */
+ "ESRCH", /* 3 */
+ "EINTR", /* 4 */
+ "EIO", /* 5 */
+ "ENXIO", /* 6 */
+ "E2BIG", /* 7 */
+ "ENOEXEC", /* 8 */
+ "EBADF", /* 9 */
+ "ECHILD", /* 10 */
+ "EAGAIN", /* 11 */
+ "ENOMEM", /* 12 */
+ "EACCES", /* 13 */
+ "EFAULT", /* 14 */
+ "ENOTBLK", /* 15 */
+ "EBUSY", /* 16 */
+ "EEXIST", /* 17 */
+ "EXDEV", /* 18 */
+ "ENODEV", /* 19 */
+ "ENOTDIR", /* 20 */
+ "EISDIR", /* 21 */
+ "EINVAL", /* 22 */
+ "ENFILE", /* 23 */
+ "EMFILE", /* 24 */
+ "ENOTTY", /* 25 */
+ "ETXTBSY", /* 26 */
+ "EFBIG", /* 27 */
+ "ENOSPC", /* 28 */
+ "ESPIPE", /* 29 */
+ "EROFS", /* 30 */
+ "EMLINK", /* 31 */
+ "EPIPE", /* 32 */
+ "EDOM", /* 33 */
+ "ERANGE", /* 34 */
+ "ENOMSG", /* 35 */
+ "EIDRM", /* 36 */
+ "ECHRNG", /* 37 */
+ "EL2NSYNC", /* 38 */
+ "EL3HLT", /* 39 */
+ "EL3RST", /* 40 */
+ "ELNRNG", /* 41 */
+ "EUNATCH", /* 42 */
+ "ENOCSI", /* 43 */
+ "EL2HLT", /* 44 */
+ "EDEADLK", /* 45 */
+ "ENOLCK", /* 46 */
+ "ECANCELED", /* 47 */
+ "ENOTSUP", /* 48 */
+ "ERRNO_49", /* 49 */
+ "EBADE", /* 50 */
+ "EBADR", /* 51 */
+ "EXFULL", /* 52 */
+ "ENOANO", /* 53 */
+ "EBADRQC", /* 54 */
+ "EBADSLT", /* 55 */
+ "EDEADLOCK", /* 56 */
+ "EBFONT", /* 57 */
+ "ERRNO_58", /* 58 */
+ "ERRNO_59", /* 59 */
+ "ENOSTR", /* 60 */
+ "ENODATA", /* 61 */
+ "ETIME", /* 62 */
+ "ENOSR", /* 63 */
+ "ENONET", /* 64 */
+ "ENOPKG", /* 65 */
+ "EREMOTE", /* 66 */
+ "ENOLINK", /* 67 */
+ "EADV", /* 68 */
+ "ESRMNT", /* 69 */
+ "ECOMM", /* 70 */
+ "EPROTO", /* 71 */
+ "ERRNO_72", /* 72 */
+ "ERRNO_73", /* 73 */
+ "EMULTIHOP", /* 74 */
+ "ERRNO_75", /* 75 */
+ "ERRNO_76", /* 76 */
+ "EBADMSG", /* 77 */
+ "ENAMETOOLONG", /* 78 */
+ "EOVERFLOW", /* 79 */
+ "ENOTUNIQ", /* 80 */
+ "EBADFD", /* 81 */
+ "EREMCHG", /* 82 */
+ "ELIBACC", /* 83 */
+ "ELIBBAD", /* 84 */
+ "ELIBSCN", /* 85 */
+ "ELIBMAX", /* 86 */
+ "ELIBEXEC", /* 87 */
+ "EILSEQ", /* 88 */
+ "ENOSYS", /* 89 */
+ "ELOOP", /* 90 */
+ "ERESTART", /* 91 */
+ "ESTRPIPE", /* 92 */
+ "ENOTEMPTY", /* 93 */
+ "EUSERS", /* 94 */
+ "ENOTSOCK", /* 95 */
+ "EDESTADDRREQ", /* 96 */
+ "EMSGSIZE", /* 97 */
+ "EPROTOTYPE", /* 98 */
+ "ENOPROTOOPT", /* 99 */
+ "ERRNO_100", /* 100 */
+ "ERRNO_101", /* 101 */
+ "ERRNO_102", /* 102 */
+ "ERRNO_103", /* 103 */
+ "ERRNO_104", /* 104 */
+ "ERRNO_105", /* 105 */
+ "ERRNO_106", /* 106 */
+ "ERRNO_107", /* 107 */
+ "ERRNO_108", /* 108 */
+ "ERRNO_109", /* 109 */
+ "ERRNO_110", /* 110 */
+ "ERRNO_111", /* 111 */
+ "ERRNO_112", /* 112 */
+ "ERRNO_113", /* 113 */
+ "ERRNO_114", /* 114 */
+ "ERRNO_115", /* 115 */
+ "ERRNO_116", /* 116 */
+ "ERRNO_117", /* 117 */
+ "ERRNO_118", /* 118 */
+ "ERRNO_119", /* 119 */
+ "EPROTONOSUPPORT", /* 120 */
+ "ESOCKTNOSUPPORT", /* 121 */
+ "EOPNOTSUPP", /* 122 */
+ "EPFNOSUPPORT", /* 123 */
+ "EAFNOSUPPORT", /* 124 */
+ "EADDRINUSE", /* 125 */
+ "EADDRNOTAVAIL", /* 126 */
+ "ENETDOWN", /* 127 */
+ "ENETUNREACH", /* 128 */
+ "ENETRESET", /* 129 */
+ "ECONNABORTED", /* 130 */
+ "ECONNRESET", /* 131 */
+ "ENOBUFS", /* 132 */
+ "EISCONN", /* 133 */
+ "ENOTCONN", /* 134 */
+ "ERRNO_135", /* 135 */
+ "ERRNO_136", /* 136 */
+ "ERRNO_137", /* 137 */
+ "ERRNO_138", /* 138 */
+ "ERRNO_139", /* 139 */
+ "ERRNO_140", /* 140 */
+ "ERRNO_141", /* 141 */
+ "ERRNO_142", /* 142 */
+ "ESHUTDOWN", /* 143 */
+ "ETOOMANYREFS", /* 144 */
+ "ETIMEDOUT", /* 145 */
+ "ECONNREFUSED", /* 146 */
+ "EHOSTDOWN", /* 147 */
+ "EHOSTUNREACH", /* 148 */
+ "EALREADY", /* 149 */
+ "EINPROGRESS", /* 150 */
+ "ESTALE", /* 151 */
diff --git a/svr4/ioctlent.h b/svr4/ioctlent.h
new file mode 100644
index 000000000..7119c870a
--- /dev/null
+++ b/svr4/ioctlent.h
@@ -0,0 +1,429 @@
+{"sys/dkio.h", "DKIOCGGEOM", 0x401},
+{"sys/dkio.h", "DKIOCSGEOM", 0x402},
+{"sys/dkio.h", "DKIOCINFO", 0x403},
+{"sys/dkio.h", "DKIOCSAPART", 0x404},
+{"sys/dkio.h", "DKIOCGAPART", 0x405},
+{"sys/dkio.h", "DKIOCEJECT", 0x406},
+{"sys/dkio.h", "DKIOCLOCK", 0x407},
+{"sys/dkio.h", "DKIOCUNLOCK", 0x408},
+{"sys/dkio.h", "DKIOCGVTOC", 0x40b},
+{"sys/dkio.h", "DKIOCSVTOC", 0x40c},
+{"sys/dkio.h", "DKIOCSTATE", 0x40d},
+{"sys/fdio.h", "FDIOGCHAR", 0x433},
+{"sys/fdio.h", "FDIOSCHAR", 0x434},
+{"sys/fdio.h", "FDEJECT", 0x435},
+{"sys/fdio.h", "FDGETCHANGE", 0x436},
+{"sys/fdio.h", "FDGETDRIVECHAR", 0x437},
+{"sys/fdio.h", "FDSETDRIVECHAR", 0x438},
+{"sys/fdio.h", "FDGETSEARCH", 0x439},
+{"sys/fdio.h", "FDSETSEARCH", 0x43a},
+{"sys/fdio.h", "FDIOCMD", 0x43b},
+{"sys/fdio.h", "FDRAW", 0x446},
+{"sys/fdio.h", "FDDEFGEOCHAR", 0x456},
+{"sys/hdio.h", "HDKIOCSTYPE", 0x465},
+{"sys/hdio.h", "HDKIOCGTYPE", 0x466},
+{"sys/hdio.h", "HDKIOCSBAD", 0x467},
+{"sys/hdio.h", "HDKIOCGBAD", 0x468},
+{"sys/hdio.h", "HDKIOCSCMD", 0x469},
+{"sys/hdio.h", "HDKIOCGDIAG", 0x46a},
+{"sys/cdio.h", "CDROMPAUSE", 0x497},
+{"sys/cdio.h", "CDROMRESUME", 0x498},
+{"sys/cdio.h", "CDROMPLAYMSF", 0x499},
+{"sys/cdio.h", "CDROMPLAYTRKIND", 0x49a},
+{"sys/cdio.h", "CDROMREADTOCHDR", 0x49b},
+{"sys/cdio.h", "CDROMREADTOCENTRY", 0x49c},
+{"sys/cdio.h", "CDROMSTOP", 0x49d},
+{"sys/cdio.h", "CDROMSTART", 0x49e},
+{"sys/cdio.h", "CDROMEJECT", 0x49f},
+{"sys/cdio.h", "CDROMVOLCTRL", 0x4a0},
+{"sys/cdio.h", "CDROMSUBCHNL", 0x4a1},
+{"sys/cdio.h", "CDROMREADMODE2", 0x4a2},
+{"sys/cdio.h", "CDROMREADMODE1", 0x4a3},
+{"sys/cdio.h", "CDROMREADOFFSET", 0x4a4},
+{"sys/cdio.h", "CDROMGBLKMODE", 0x4a5},
+{"sys/cdio.h", "CDROMSBLKMODE", 0x4a6},
+{"sys/cdio.h", "CDROMCDDA", 0x4a7},
+{"sys/cdio.h", "CDROMCDXA", 0x4a8},
+{"sys/cdio.h", "CDROMSUBCODE", 0x4a9},
+{"sys/cdio.h", "CDROMGDRVSPEED", 0x4aa},
+{"sys/cdio.h", "CDROMSDRVSPEED", 0x4ab},
+{"sys/scsi/impl/uscsi.h", "USCSICMD", 0x4c9},
+{"sys/bufmod.h", "SBIOCSTIME", 0x4201},
+{"sys/bufmod.h", "SBIOCGTIME", 0x4202},
+{"sys/bufmod.h", "SBIOCCTIME", 0x4203},
+{"sys/bufmod.h", "SBIOCSCHUNK", 0x4204},
+{"sys/bufmod.h", "SBIOCGCHUNK", 0x4205},
+{"sys/bufmod.h", "SBIOCSSNAP", 0x4206},
+{"sys/bufmod.h", "SBIOCGSNAP", 0x4207},
+{"sys/bufmod.h", "SBIOCSFLAGS", 0x4208},
+{"sys/bufmod.h", "SBIOCGFLAGS", 0x4209},
+{"sys/termios.h", "LDOPEN", 0x4400},
+{"sys/termios.h", "LDCLOSE", 0x4401},
+{"sys/dlpi.h", "DLIOCRAW", 0x4401},
+{"sys/sad.h", "SAD_SAP", 0x4401},
+{"sys/termios.h", "LDCHG", 0x4402},
+{"sys/sad.h", "SAD_GAP", 0x4402},
+{"sys/sad.h", "SAD_VML", 0x4403},
+{"sys/termios.h", "LDGETT", 0x4408},
+{"sys/termios.h", "LDSETT", 0x4409},
+{"sys/dlpi.h", "DL_IOC_HDR_INFO", 0x440a},
+{"sys/termios.h", "LDSMAP", 0x446e},
+{"sys/termios.h", "LDGMAP", 0x446f},
+{"sys/termios.h", "LDNMAP", 0x4470},
+{"sys/termios.h", "LDEMAP", 0x4471},
+{"sys/termios.h", "LDDMAP", 0x4472},
+{"sys/fbio.h", "FBIOGTYPE", 0x4600},
+{"sys/fbio.h", "FBIOGINFO", 0x4602},
+{"sys/fbio.h", "FBIOPUTCMAP", 0x4603},
+{"sys/fbio.h", "FBIOGETCMAP", 0x4604},
+{"sys/fbio.h", "FBIOSATTR", 0x4605},
+{"sys/fbio.h", "FBIOGATTR", 0x4606},
+{"sys/fbio.h", "FBIOSVIDEO", 0x4607},
+{"sys/fbio.h", "FBIOGVIDEO", 0x4608},
+{"sys/fbio.h", "FBIOVERTICAL", 0x4609},
+{"sys/fbio.h", "GRABPAGEALLOC", 0x460a},
+{"sys/fbio.h", "GRABPAGEFREE", 0x460b},
+{"sys/fbio.h", "GRABATTACH", 0x460c},
+{"sys/fbio.h", "FBIOGPLNGRP", 0x460d},
+{"sys/fbio.h", "FBIOGCMSIZE", 0x460e},
+{"sys/fbio.h", "FBIOSCMSIZE", 0x460f},
+{"sys/fbio.h", "FBIOSCMS", 0x4610},
+{"sys/fbio.h", "FBIOAVAILPLNGRP", 0x4611},
+{"sys/fbio.h", "FBIODBLGINFO", 0x4612},
+{"sys/fbio.h", "FBIODBLSINFO", 0x4613},
+{"sys/fbio.h", "FBIOSWINFD", 0x4614},
+{"sys/fbio.h", "FBIOSAVWINFD", 0x4615},
+{"sys/fbio.h", "FBIORESWINFD", 0x4616},
+{"sys/fbio.h", "FBIOSRWINFD", 0x4617},
+{"sys/visual_io.h", "VIS_SETCURSOR", 0x4618},
+{"sys/fbio.h", "FBIOSCURSOR", 0x4618},
+{"sys/fbio.h", "FBIOGCURSOR", 0x4619},
+{"sys/visual_io.h", "VIS_GETCURSOR", 0x4619},
+{"sys/fbio.h", "FBIOSCURPOS", 0x461a},
+{"sys/visual_io.h", "VIS_MOVECURSOR", 0x461a},
+{"sys/fbio.h", "FBIOGCURPOS", 0x461b},
+{"sys/visual_io.h", "VIS_GETCURSORPOS", 0x461b},
+{"sys/fbio.h", "FBIOGCURMAX", 0x461c},
+{"sys/fbio.h", "GRABLOCKINFO", 0x461d},
+{"sys/fbio.h", "FBIO_WID_ALLOC", 0x461e},
+{"sys/fbio.h", "FBIO_WID_FREE", 0x461f},
+{"sys/fbio.h", "FBIO_WID_PUT", 0x4620},
+{"sys/fbio.h", "FBIO_WID_GET", 0x4621},
+{"sys/fbio.h", "FBIO_DEVID", 0x4622},
+{"sys/fbio.h", "FBIO_U_RST", 0x4623},
+{"sys/fbio.h", "FBIO_FULLSCREEN_ELIMINATION_GROUPS", 0x4624},
+{"sys/fbio.h", "FBIO_WID_DBL_SET", 0x4625},
+{"sys/fbio.h", "FBIOVRTOFFSET", 0x4626},
+{"sys/fbio.h", "FBIOGXINFO", 0x4627},
+{"sys/fbio.h", "FBIOMONINFO", 0x4628},
+{"sys/fbio.h", "FBIOPUTCMAPI", 0x4629},
+{"sys/fbio.h", "FBIOGETCMAPI", 0x462a},
+{"sys/fbio.h", "FBIO_ASSIGNWID", 0x462b},
+{"sys/fbio.h", "FBIO_STEREO", 0x462c},
+{"sys/gpio.h", "GP1IO_PUT_INFO", 0x4700},
+{"sys/gpio.h", "GP1IO_GET_STATIC_BLOCK", 0x4701},
+{"sys/gpio.h", "GP1IO_FREE_STATIC_BLOCK", 0x4702},
+{"sys/gpio.h", "GP1IO_GET_GBUFFER_STATE", 0x4703},
+{"sys/gpio.h", "GP1IO_CHK_GP", 0x4704},
+{"sys/gpio.h", "GP1IO_GET_RESTART_COUNT", 0x4705},
+{"sys/gpio.h", "GP1IO_REDIRECT_DEVFB", 0x4706},
+{"sys/gpio.h", "GP1IO_GET_REQDEV", 0x4707},
+{"sys/gpio.h", "GP1IO_GET_TRUMINORDEV", 0x4708},
+{"sys/gpio.h", "GP1IO_CHK_FOR_GBUFFER", 0x4709},
+{"sys/gpio.h", "GP1IO_SET_USING_GBUFFER", 0x470a},
+{"sys/gpio.h", "GP1IO_INFO_STATIC_BLOCK", 0x470b},
+{"sys/sockmod.h", "O_SI_GETUDATA", 0x4965},
+{"sys/sockmod.h", "SI_SHUTDOWN", 0x4966},
+{"sys/sockmod.h", "SI_LISTEN", 0x4967},
+{"sys/sockmod.h", "SI_SETMYNAME", 0x4968},
+{"sys/sockmod.h", "SI_SETPEERNAME", 0x4969},
+{"sys/sockmod.h", "SI_GETINTRANSIT", 0x496a},
+{"sys/sockmod.h", "SI_SOCKPARAMS", 0x496d},
+{"sys/sockmod.h", "SI_GETUDATA", 0x496e},
+{"sys/strlog.h", "I_TRCLOG", 0x4c01},
+{"sys/strlog.h", "I_ERRLOG", 0x4c02},
+{"sys/strlog.h", "I_CONSLOG", 0x4c03},
+{"sys/cg14io.h", "MDI_RESET", 0x4d01},
+{"sys/cg14io.h", "MDI_GET_CFGINFO", 0x4d02},
+{"sys/cg14io.h", "MDI_SET_PIXELMODE", 0x4d03},
+{"sys/cg14io.h", "MDI_SET_COUNTERS", 0x4d04},
+{"sys/cg14io.h", "MDI_SET_PPR", 0x4d05},
+{"sys/cg14io.h", "MDI_VRT_CNTL", 0x4d06},
+{"sys/cg14io.h", "MDI_SET_CLUT", 0x4d07},
+{"sys/cg14io.h", "MDI_GET_CLUT", 0x4d08},
+{"sys/cg14io.h", "MDI_SET_XLUT", 0x4d09},
+{"sys/cg14io.h", "MDI_GET_XLUT", 0x4d0a},
+{"sys/cg14io.h", "MDI_GAMMA_CORRECT", 0x4d0b},
+{"sys/cg14io.h", "MDI_SET_GAMMALUT", 0x4d0c},
+{"sys/cg14io.h", "MDI_GET_GAMMALUT", 0x4d0d},
+{"sys/cg14io.h", "MDI_SET_DEGAMMALUT", 0x4d0e},
+{"sys/cg14io.h", "MDI_GET_DEGAMMALUT", 0x4d0f},
+{"sys/cg14io.h", "MDI_GET_BUFFER_INFO", 0x4d10},
+{"sys/cg14io.h", "MDI_SET_CURSOR", 0x4d11},
+{"sys/cg14io.h", "MDI_GET_DIAGINFO", 0x4d12},
+{"sys/cg14io.h", "MDI_SET_RESOLUTION", 0x4d13},
+{"sys/cg14io.h", "SET_MONITOR_POWER", 0x4d14},
+{"sys/openpromio.h", "OPROMGETBOOTARGS", 0x4f0c},
+{"sys/pfmod.h", "PFIOCSETF", 0x5001},
+{"sys/stropts.h", "I_NREAD", 0x5301},
+{"sys/stropts.h", "I_PUSH", 0x5302},
+{"sys/stropts.h", "I_POP", 0x5303},
+{"sys/stropts.h", "I_LOOK", 0x5304},
+{"sys/stropts.h", "I_FLUSH", 0x5305},
+{"sys/stropts.h", "I_SRDOPT", 0x5306},
+{"sys/stropts.h", "I_GRDOPT", 0x5307},
+{"sys/stropts.h", "I_STR", 0x5308},
+{"sys/stropts.h", "I_SETSIG", 0x5309},
+{"sys/stropts.h", "I_GETSIG", 0x530a},
+{"sys/stropts.h", "I_FIND", 0x530b},
+{"sys/stropts.h", "I_LINK", 0x530c},
+{"sys/stropts.h", "I_UNLINK", 0x530d},
+{"sys/stropts.h", "I_RECVFD", 0x530e},
+{"sys/stropts.h", "I_PEEK", 0x530f},
+{"sys/stropts.h", "I_FDINSERT", 0x5310},
+{"sys/stropts.h", "I_SENDFD", 0x5311},
+{"sys/stropts.h", "I_SWROPT", 0x5313},
+{"sys/stropts.h", "I_GWROPT", 0x5314},
+{"sys/stropts.h", "I_LIST", 0x5315},
+{"sys/stropts.h", "I_PLINK", 0x5316},
+{"sys/stropts.h", "I_PUNLINK", 0x5317},
+{"sys/stropts.h", "I_SETEV", 0x5318},
+{"sys/stropts.h", "I_GETEV", 0x5319},
+{"sys/stropts.h", "I_STREV", 0x531a},
+{"sys/stropts.h", "I_UNSTREV", 0x531b},
+{"sys/stropts.h", "I_FLUSHBAND", 0x531c},
+{"sys/stropts.h", "I_CKBAND", 0x531d},
+{"sys/stropts.h", "I_GETBAND", 0x531e},
+{"sys/stropts.h", "I_ATMARK", 0x531f},
+{"sys/stropts.h", "I_SETCLTIME", 0x5320},
+{"sys/stropts.h", "I_GETCLTIME", 0x5321},
+{"sys/stropts.h", "I_CANPUT", 0x5322},
+{"sys/termios.h", "TCGETA", 0x5401},
+{"sys/termios.h", "TCSETA", 0x5402},
+{"sys/termios.h", "TCSETAW", 0x5403},
+{"sys/termios.h", "TCSETAF", 0x5404},
+{"sys/termios.h", "TCSBRK", 0x5405},
+{"sys/termios.h", "TCXONC", 0x5406},
+{"sys/termios.h", "TCFLSH", 0x5407},
+{"sys/termios.h", "TIOCKBON", 0x5408},
+{"sys/termios.h", "TIOCKBOF", 0x5409},
+{"sys/termios.h", "KBENABLED", 0x540a},
+{"sys/termios.h", "TCGETS", 0x540d},
+{"sys/termios.h", "TCSETS", 0x540e},
+{"sys/termios.h", "TCSANOW", 0x540e},
+{"sys/termios.h", "TCSADRAIN", 0x540f},
+{"sys/termios.h", "TCSETSW", 0x540f},
+{"sys/termios.h", "TCSAFLUSH", 0x5410},
+{"sys/termios.h", "TCSETSF", 0x5410},
+{"sys/termio.h", "TCDSET", 0x5420},
+{"sys/termios.h", "TCDSET", 0x5420},
+{"sys/termios.h", "RTS_TOG", 0x5421},
+{"sys/ttold.h", "TIOCSWINSZ", 0x5467},
+{"sys/termios.h", "TIOCSWINSZ", 0x5467},
+{"sys/ttold.h", "TIOCGWINSZ", 0x5468},
+{"sys/termios.h", "TIOCGWINSZ", 0x5468},
+{"sys/termios.h", "TIOCGSOFTCAR", 0x5469},
+{"sys/termios.h", "TIOCSSOFTCAR", 0x546a},
+{"sys/timod.h", "TI_GETINFO", 0x548c},
+{"sys/timod.h", "TI_OPTMGMT", 0x548d},
+{"sys/timod.h", "TI_BIND", 0x548e},
+{"sys/timod.h", "TI_UNBIND", 0x548f},
+{"sys/timod.h", "TI_GETMYNAME", 0x5490},
+{"sys/timod.h", "TI_GETPEERNAME", 0x5491},
+{"sys/timod.h", "TI_SETMYNAME", 0x5492},
+{"sys/timod.h", "TI_SETPEERNAME", 0x5493},
+{"sys/termiox.h", "TCGETX", 0x5801},
+{"sys/termiox.h", "TCSETX", 0x5802},
+{"sys/termiox.h", "TCSETXW", 0x5803},
+{"sys/termiox.h", "TCSETXF", 0x5804},
+{"sys/ioctl.h", "DIOCGETC", 0x6401},
+{"sys/ioctl.h", "DIOCGETB", 0x6402},
+{"sys/ioctl.h", "DIOCSETE", 0x6403},
+{"sys/termios.h", "DIOCGETP", 0x6408},
+{"sys/termios.h", "DIOCSETP", 0x6409},
+{"sys/jioctl.h", "JBOOT", 0x6a01},
+{"sys/jioctl.h", "JTERM", 0x6a02},
+{"sys/jioctl.h", "JMPX", 0x6a03},
+{"sys/jioctl.h", "JWINSIZE", 0x6a05},
+{"sys/jioctl.h", "JZOMBOOT", 0x6a07},
+{"sys/jioctl.h", "JAGENT", 0x6a09},
+{"sys/jioctl.h", "JTRUN", 0x6a0a},
+{"sys/jioctl.h", "JXTPROTO", 0x6a0b},
+{"sys/kbio.h", "KIOCTRANS", 0x6b00},
+{"sys/kbio.h", "KIOCSETKEY", 0x6b01},
+{"sys/kbio.h", "KIOCGETKEY", 0x6b02},
+{"sys/kbio.h", "KIOCGTRANS", 0x6b05},
+{"sys/kbio.h", "KIOCTRANSABLE", 0x6b06},
+{"sys/kbio.h", "KIOCGTRANSABLE", 0x6b07},
+{"sys/kbio.h", "KIOCCMD", 0x6b08},
+{"sys/kbio.h", "KIOCTYPE", 0x6b09},
+{"sys/kbio.h", "KIOCSDIRECT", 0x6b0a},
+{"sys/kbio.h", "KIOCGDIRECT", 0x6b0b},
+{"sys/kbio.h", "KIOCSKEY", 0x6b0c},
+{"sys/kbio.h", "KIOCGKEY", 0x6b0d},
+{"sys/kbio.h", "KIOCSLED", 0x6b0e},
+{"sys/kbio.h", "KIOCGLED", 0x6b0f},
+{"sys/kbio.h", "KIOCSCOMPAT", 0x6b10},
+{"sys/kbio.h", "KIOCGCOMPAT", 0x6b11},
+{"sys/kbio.h", "KIOCLAYOUT", 0x6b14},
+{"sys/ioctl.h", "LIOCGETP", 0x6c01},
+{"sys/ioctl.h", "LIOCSETP", 0x6c02},
+{"sys/ioctl.h", "LIOCGETS", 0x6c05},
+{"sys/ioctl.h", "LIOCSETS", 0x6c06},
+{"sys/mtio.h", "MTIOCTOP", 0x6d01},
+{"sys/msio.h", "MSIOGETPARMS", 0x6d01},
+{"sys/msio.h", "MSIOSETPARMS", 0x6d02},
+{"sys/mtio.h", "MTIOCGET", 0x6d02},
+{"sys/mtio.h", "MTIOCGETDRIVETYPE", 0x6d03},
+{"sys/procfs.h", "PIOCSTATUS", 0x7101},
+{"sys/procfs.h", "PIOCSTOP", 0x7102},
+{"sys/procfs.h", "PIOCWSTOP", 0x7103},
+{"sys/procfs.h", "PIOCRUN", 0x7104},
+{"sys/procfs.h", "PIOCGTRACE", 0x7105},
+{"sys/procfs.h", "PIOCSTRACE", 0x7106},
+{"sys/procfs.h", "PIOCSSIG", 0x7107},
+{"sys/procfs.h", "PIOCKILL", 0x7108},
+{"sys/procfs.h", "PIOCUNKILL", 0x7109},
+{"sys/procfs.h", "PIOCGHOLD", 0x710a},
+{"sys/procfs.h", "PIOCSHOLD", 0x710b},
+{"sys/procfs.h", "PIOCMAXSIG", 0x710c},
+{"sys/procfs.h", "PIOCACTION", 0x710d},
+{"sys/procfs.h", "PIOCGFAULT", 0x710e},
+{"sys/procfs.h", "PIOCSFAULT", 0x710f},
+{"sys/procfs.h", "PIOCCFAULT", 0x7110},
+{"sys/procfs.h", "PIOCGENTRY", 0x7111},
+{"sys/procfs.h", "PIOCSENTRY", 0x7112},
+{"sys/procfs.h", "PIOCGEXIT", 0x7113},
+{"sys/procfs.h", "PIOCSEXIT", 0x7114},
+{"sys/procfs.h", "PIOCSFORK", 0x7115},
+{"sys/procfs.h", "PIOCRFORK", 0x7116},
+{"sys/procfs.h", "PIOCSRLC", 0x7117},
+{"sys/procfs.h", "PIOCRRLC", 0x7118},
+{"sys/procfs.h", "PIOCGREG", 0x7119},
+{"sys/procfs.h", "PIOCSREG", 0x711a},
+{"sys/procfs.h", "PIOCGFPREG", 0x711b},
+{"sys/procfs.h", "PIOCSFPREG", 0x711c},
+{"sys/procfs.h", "PIOCNICE", 0x711d},
+{"sys/procfs.h", "PIOCPSINFO", 0x711e},
+{"sys/procfs.h", "PIOCNMAP", 0x711f},
+{"sys/procfs.h", "PIOCMAP", 0x7120},
+{"sys/procfs.h", "PIOCOPENM", 0x7121},
+{"sys/procfs.h", "PIOCCRED", 0x7122},
+{"sys/procfs.h", "PIOCGROUPS", 0x7123},
+{"sys/procfs.h", "PIOCGETPR", 0x7124},
+{"sys/procfs.h", "PIOCGETU", 0x7125},
+{"sys/procfs.h", "PIOCSET", 0x7126},
+{"sys/procfs.h", "PIOCRESET", 0x7127},
+{"sys/procfs.h", "PIOCNWATCH", 0x7128},
+{"sys/procfs.h", "PIOCGWATCH", 0x7129},
+{"sys/procfs.h", "PIOCSWATCH", 0x712a},
+{"sys/procfs.h", "PIOCUSAGE", 0x712b},
+{"sys/procfs.h", "PIOCOPENPD", 0x712c},
+{"sys/procfs.h", "PIOCLWPIDS", 0x712d},
+{"sys/procfs.h", "PIOCOPENLWP", 0x712e},
+{"sys/procfs.h", "PIOCLSTATUS", 0x712f},
+{"sys/procfs.h", "PIOCLUSAGE", 0x7130},
+{"sys/procfs.h", "PIOCNAUXV", 0x7131},
+{"sys/procfs.h", "PIOCAUXV", 0x7132},
+{"sys/procfs.h", "PIOCGWIN", 0x7165},
+{"sys/ttold.h", "TIOCGETD", 0x7400},
+{"sys/termios.h", "TIOCGETD", 0x7400},
+{"sys/termios.h", "TIOCSETD", 0x7401},
+{"sys/ttold.h", "TIOCSETD", 0x7401},
+{"sys/termios.h", "TIOCHPCL", 0x7402},
+{"sys/ttold.h", "TIOCHPCL", 0x7402},
+{"sys/ttold.h", "TIOCGETP", 0x7408},
+{"sys/termios.h", "TIOCGETP", 0x7408},
+{"sys/termios.h", "TIOCSETP", 0x7409},
+{"sys/ttold.h", "TIOCSETP", 0x7409},
+{"sys/ttold.h", "TIOCSETN", 0x740a},
+{"sys/termios.h", "TIOCSETN", 0x740a},
+{"sys/ttold.h", "TIOCEXCL", 0x740d},
+{"sys/termios.h", "TIOCEXCL", 0x740d},
+{"sys/ttold.h", "TIOCNXCL", 0x740e},
+{"sys/termios.h", "TIOCNXCL", 0x740e},
+{"sys/termios.h", "TIOCFLUSH", 0x7410},
+{"sys/ttold.h", "TIOCFLUSH", 0x7410},
+{"sys/termios.h", "TIOCSETC", 0x7411},
+{"sys/ttold.h", "TIOCSETC", 0x7411},
+{"sys/termios.h", "TIOCGETC", 0x7412},
+{"sys/ttold.h", "TIOCGETC", 0x7412},
+{"sys/termios.h", "TIOCGPGRP", 0x7414},
+{"sys/termios.h", "TIOCSPGRP", 0x7415},
+{"sys/termios.h", "TIOCGSID", 0x7416},
+{"sys/termios.h", "TIOCSTI", 0x7417},
+{"sys/termios.h", "TIOCSSID", 0x7418},
+{"sys/termios.h", "TIOCMSET", 0x741a},
+{"sys/termios.h", "TIOCMBIS", 0x741b},
+{"sys/termios.h", "TIOCMBIC", 0x741c},
+{"sys/termios.h", "TIOCMGET", 0x741d},
+{"sys/termios.h", "TIOCREMOTE", 0x741e},
+{"sys/ttold.h", "TIOCREMOTE", 0x741e},
+{"sys/termios.h", "TIOCSIGNAL", 0x741f},
+{"sys/termios.h", "TIOCSTART", 0x746e},
+{"sys/ttold.h", "TIOCSTART", 0x746e},
+{"sys/termios.h", "TIOCSTOP", 0x746f},
+{"sys/ttold.h", "TIOCSTOP", 0x746f},
+{"sys/ttold.h", "TIOCNOTTY", 0x7471},
+{"sys/termios.h", "TIOCNOTTY", 0x7471},
+{"sys/termios.h", "TIOCOUTQ", 0x7473},
+{"sys/ttold.h", "TIOCOUTQ", 0x7473},
+{"sys/termios.h", "TIOCGLTC", 0x7474},
+{"sys/ttold.h", "TIOCGLTC", 0x7474},
+{"sys/termios.h", "TIOCSLTC", 0x7475},
+{"sys/ttold.h", "TIOCSLTC", 0x7475},
+{"sys/termios.h", "TIOCCDTR", 0x7478},
+{"sys/ttold.h", "TIOCCDTR", 0x7478},
+{"sys/ttold.h", "TIOCSDTR", 0x7479},
+{"sys/termios.h", "TIOCSDTR", 0x7479},
+{"sys/termios.h", "TIOCCBRK", 0x747a},
+{"sys/ttold.h", "TIOCCBRK", 0x747a},
+{"sys/termios.h", "TIOCSBRK", 0x747b},
+{"sys/ttold.h", "TIOCSBRK", 0x747b},
+{"sys/termios.h", "TIOCLGET", 0x747c},
+{"sys/ttold.h", "TIOCLGET", 0x747c},
+{"sys/termios.h", "TIOCLSET", 0x747d},
+{"sys/ttold.h", "TIOCLSET", 0x747d},
+{"sys/ttold.h", "TIOCLBIC", 0x747e},
+{"sys/termios.h", "TIOCLBIC", 0x747e},
+{"sys/ttold.h", "TIOCLBIS", 0x747f},
+{"sys/termios.h", "TIOCLBIS", 0x747f},
+{"sys/vol.h", "VOLIOCMAP", 0x7601},
+{"sys/vuid_event.h", "VUIDSFORMAT", 0x7601},
+{"sys/vuid_event.h", "VUIDSFORMAT", 0x7601},
+{"sys/vuid_event.h", "VUIDGFORMAT", 0x7602},
+{"sys/vuid_event.h", "VUIDGFORMAT", 0x7602},
+{"sys/vol.h", "VOLIOCUNMAP", 0x7602},
+{"sys/vol.h", "VOLIOCEVENT", 0x7603},
+{"sys/vuid_event.h", "VUIDSADDR", 0x7603},
+{"sys/vuid_event.h", "VUIDSADDR", 0x7603},
+{"sys/vuid_event.h", "VUIDGADDR", 0x7604},
+{"sys/vuid_event.h", "VUIDGADDR", 0x7604},
+{"sys/vol.h", "VOLIOCEJECT", 0x7604},
+{"sys/vol.h", "VOLIOCCHECK", 0x7605},
+{"sys/vol.h", "VOLIOCINUSE", 0x7606},
+{"sys/vol.h", "VOLIOCDGATTR", 0x7607},
+{"sys/vol.h", "VOLIOCDSATTR", 0x7608},
+{"sys/vol.h", "VOLIOCDCHECK", 0x7609},
+{"sys/vol.h", "VOLIOCCANCEL", 0x760a},
+{"sys/vol.h", "VOLIOCINFO", 0x760b},
+{"sys/vol.h", "VOLIOCSATTR", 0x760c},
+{"sys/vol.h", "VOLIOCGATTR", 0x760d},
+{"sys/vol.h", "VOLIOCDINUSE", 0x760e},
+{"sys/vol.h", "VOLIOCDAEMON", 0x760f},
+{"sys/vol.h", "VOLIOCFLAGS", 0x7610},
+{"sys/vol.h", "VOLIOCEXTRA4", 0x7611},
+{"sys/vol.h", "VOLIOCEXTRA5", 0x7612},
+{"sys/vol.h", "VOLIOCEXTRA6", 0x7613},
+{"sys/vol.h", "VOLIOCEXTRA7", 0x7614},
+{"sys/ser_sync.h", "S_IOCGETMODE", 0x7a01},
+{"sys/ser_sync.h", "S_IOCSETMODE", 0x7a02},
+{"sys/ser_sync.h", "S_IOCGETSTATS", 0x7a03},
+{"sys/ser_sync.h", "S_IOCCLRSTATS", 0x7a04},
+{"sys/ser_sync.h", "S_IOCGETSPEED", 0x7a05},
+{"sys/ser_sync.h", "S_IOCGETMRU", 0x7a06},
+{"sys/ser_sync.h", "S_IOCSETMRU", 0x7a07},
+{"sys/ser_sync.h", "S_IOCGETMTU", 0x7a08},
+{"sys/ser_sync.h", "S_IOCSETMTU", 0x7a09},
+{"sys/ser_sync.h", "S_IOCGETMCTL", 0x7a0a},
+{"sys/tl.h", "TL_IOC_CREDOPT", 0x544c01},
diff --git a/svr4/ioctlent.sh b/svr4/ioctlent.sh
new file mode 100644
index 000000000..2ee7ad0ba
--- /dev/null
+++ b/svr4/ioctlent.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+if [ $# -ne 1 ]
+then
+ echo "usage: $0 include-directory" >&2
+ exit 1
+fi
+
+bad_includes='cg[48]var\.h'
+bad_defines='cg[48]var\.h|READSLICE|I_E_RECVFD|FBIOGPIXRECT|JTIMO|TTYTYPE|TIOCCONS|TCL_LINK|TCL_UNLINK'
+
+(
+ cd $1 || exit
+ find sys -name '*.h' -print |
+ xargs grep '^[ ]*#[ ]*define[ ][ ]*[A-Z_][A-Za-z0-9_]*[ ][ ]*([A-Za-z_][A-Za-z0-9_]*|[0-9][0-9]*)' /dev/null |
+ sed 's/\(.*\):#[ ]*define[ ]*\([A-Z_][A-Za-z0-9_]*\)[ ]*\(([^)]*)\)[ ]*\(.*\)/ { "\1", "\2", \2 }, \4/'
+) >ioctlent.tmp
+cat ioctlent.tmp |
+ awk '{ print "#include <" substr($2, 2, length($2) - 3) ">" }' |
+ sort -u |
+ egrep -v "$bad_includes"
+echo xyzzy
+echo "struct ioctlent ioctlent[] = {"
+egrep -v "$bad_defines" ioctlent.tmp
+echo "};"
+rm -f ioctlent.tmp
diff --git a/svr4/signalent.h b/svr4/signalent.h
new file mode 100644
index 000000000..58869a519
--- /dev/null
+++ b/svr4/signalent.h
@@ -0,0 +1,36 @@
+ "SIG_0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGUSR1", /* 16 */
+ "SIGUSR2", /* 17 */
+ "SIGCHLD", /* 18 */
+ "SIGPWR", /* 19 */
+ "SIGWINCH", /* 20 */
+ "SIGURG", /* 21 */
+ "SIGPOLL", /* 22 */
+ "SIGSTOP", /* 23 */
+ "SIGTSTP", /* 24 */
+ "SIGCONT", /* 25 */
+ "SIGTTIN", /* 26 */
+ "SIGTTOU", /* 27 */
+ "SIGVTALRM", /* 28 */
+ "SIGPROF", /* 29 */
+ "SIGXCPU", /* 30 */
+ "SIGXFSZ", /* 31 */
+ "SIGWAITING", /* 32 */
+ "SIGLWP", /* 33 */
+ "SIGFREEZE", /* 34 */
+ "SIGTHAW", /* 35 */
diff --git a/svr4/syscall.h b/svr4/syscall.h
new file mode 100644
index 000000000..4036eef0d
--- /dev/null
+++ b/svr4/syscall.h
@@ -0,0 +1,430 @@
+/*
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "dummy.h"
+
+extern int sys_syscall();
+extern int sys_exit();
+extern int sys_fork();
+extern int sys_read();
+extern int sys_write();
+extern int sys_open();
+extern int sys_close();
+extern int sys_wait();
+extern int sys_creat();
+extern int sys_link();
+extern int sys_unlink();
+extern int sys_exec();
+extern int sys_chdir();
+extern int sys_time();
+extern int sys_mknod();
+extern int sys_chmod();
+extern int sys_chown();
+extern int sys_brk();
+extern int sys_stat();
+extern int sys_lseek();
+extern int sys_getpid();
+extern int sys_mount();
+extern int sys_umount();
+extern int sys_setuid();
+extern int sys_getuid();
+extern int sys_stime();
+extern int sys_ptrace();
+extern int sys_alarm();
+extern int sys_fstat();
+extern int sys_pause();
+extern int sys_utime();
+extern int sys_stty();
+extern int sys_gtty();
+extern int sys_access();
+extern int sys_nice();
+extern int sys_statfs();
+extern int sys_sync();
+extern int sys_kill();
+extern int sys_fstatfs();
+extern int sys_pgrpsys();
+extern int sys_setpgrp();
+extern int sys_xenix();
+extern int sys_syssgi();
+extern int sys_dup();
+extern int sys_pipe();
+extern int sys_times();
+extern int sys_profil();
+extern int sys_plock();
+extern int sys_setgid();
+extern int sys_getgid();
+extern int sys_sigcall();
+extern int sys_msgsys();
+extern int sys_syssun();
+extern int sys_sysi86();
+extern int sys_sysmips();
+extern int sys_sysmachine();
+extern int sys_acct();
+extern int sys_shmsys();
+extern int sys_semsys();
+extern int sys_ioctl();
+extern int sys_uadmin();
+extern int sys_utssys();
+extern int sys_fdsync();
+extern int sys_execve();
+extern int sys_umask();
+extern int sys_chroot();
+extern int sys_fcntl();
+extern int sys_ulimit();
+extern int sys_rmdir();
+extern int sys_mkdir();
+extern int sys_getdents();
+extern int sys_sysfs();
+extern int sys_getmsg();
+extern int sys_putmsg();
+extern int sys_poll();
+#ifdef MIPS
+extern int sys_sigreturn();
+extern int sys_accept();
+extern int sys_bind();
+extern int sys_connect();
+extern int sys_gethostid();
+extern int sys_getpeername();
+extern int sys_getsockname();
+extern int sys_getsockopt();
+extern int sys_listen();
+extern int sys_recv();
+extern int sys_recvfrom();
+extern int sys_recvmsg();
+extern int sys_select();
+extern int sys_send();
+extern int sys_sendmsg();
+extern int sys_sendto();
+extern int sys_sethostid();
+extern int sys_setsockopt();
+extern int sys_shutdown();
+extern int sys_socket();
+extern int sys_gethostname();
+extern int sys_sethostname();
+extern int sys_getdomainname();
+extern int sys_setdomainname();
+extern int sys_truncate();
+extern int sys_ftruncate();
+extern int sys_rename();
+extern int sys_symlink();
+extern int sys_readlink();
+extern int sys_nfssvc();
+extern int sys_getfh();
+extern int sys_async_daemon();
+extern int sys_exportfs();
+extern int sys_setregid();
+extern int sys_setreuid();
+extern int sys_getitimer();
+extern int sys_setitimer();
+extern int sys_adjtime();
+extern int sys_BSD_getime();
+extern int sys_sproc();
+extern int sys_prctl();
+extern int sys_procblk();
+extern int sys_sprocsp();
+extern int sys_mmap();
+extern int sys_munmap();
+extern int sys_mprotect();
+extern int sys_msync();
+extern int sys_madvise();
+extern int sys_pagelock();
+extern int sys_getpagesize();
+extern int sys_quotactl();
+extern int sys_BSDgetpgrp();
+extern int sys_BSDsetpgrp();
+extern int sys_vhangup();
+extern int sys_fsync();
+extern int sys_fchdir();
+extern int sys_getrlimit();
+extern int sys_setrlimit();
+extern int sys_cacheflush();
+extern int sys_cachectl();
+extern int sys_fchown();
+extern int sys_fchmod();
+extern int sys_socketpair();
+extern int sys_sysinfo();
+extern int sys_nuname();
+extern int sys_xstat();
+extern int sys_lxstat();
+extern int sys_fxstat();
+extern int sys_xmknod();
+extern int sys_ksigaction();
+extern int sys_sigpending();
+extern int sys_sigprocmask();
+extern int sys_sigsuspend();
+extern int sys_sigpoll();
+extern int sys_swapctl();
+extern int sys_getcontext();
+extern int sys_setcontext();
+extern int sys_waitsys();
+extern int sys_sigstack();
+extern int sys_sigaltstack();
+extern int sys_sigsendset();
+extern int sys_statvfs();
+extern int sys_fstatvfs();
+extern int sys_getpmsg();
+extern int sys_putpmsg();
+extern int sys_lchown();
+extern int sys_priocntl();
+extern int sys_ksigqueue();
+#else /* !MIPS */
+extern int sys_lstat();
+extern int sys_symlink();
+extern int sys_readlink();
+extern int sys_setgroups();
+extern int sys_getgroups();
+extern int sys_fchmod();
+extern int sys_fchown();
+extern int sys_sigprocmask();
+extern int sys_sigsuspend();
+extern int sys_sigaltstack();
+extern int sys_sigaction();
+extern int sys_spcall();
+extern int sys_context();
+extern int sys_evsys();
+extern int sys_evtrapret();
+extern int sys_statvfs();
+extern int sys_fstatvfs();
+extern int sys_nfssys();
+extern int sys_waitid();
+extern int sys_sigsendsys();
+extern int sys_hrtsys();
+extern int sys_acancel();
+extern int sys_async();
+extern int sys_priocntlsys();
+extern int sys_pathconf();
+extern int sys_mincore();
+extern int sys_mmap();
+extern int sys_mprotect();
+extern int sys_munmap();
+extern int sys_fpathconf();
+extern int sys_vfork();
+extern int sys_fchdir();
+extern int sys_readv();
+extern int sys_writev();
+extern int sys_xstat();
+extern int sys_lxstat();
+extern int sys_fxstat();
+extern int sys_xmknod();
+extern int sys_clocal();
+extern int sys_setrlimit();
+extern int sys_getrlimit();
+extern int sys_lchown();
+extern int sys_memcntl();
+extern int sys_getpmsg();
+extern int sys_putpmsg();
+extern int sys_rename();
+extern int sys_uname();
+extern int sys_setegid();
+extern int sys_sysconfig();
+extern int sys_adjtime();
+extern int sys_sysinfo();
+extern int sys_seteuid();
+extern int sys_vtrace();
+extern int sys_fork1();
+extern int sys_sigtimedwait();
+extern int sys_lwp_info();
+extern int sys_yield();
+extern int sys_lwp_sema_wait();
+extern int sys_lwp_sema_post();
+extern int sys_modctl();
+extern int sys_fchroot();
+extern int sys_utimes();
+extern int sys_vhangup();
+extern int sys_gettimeofday();
+extern int sys_getitimer();
+extern int sys_setitimer();
+extern int sys_lwp_create();
+extern int sys_lwp_exit();
+extern int sys_lwp_suspend();
+extern int sys_lwp_continue();
+extern int sys_lwp_kill();
+extern int sys_lwp_self();
+extern int sys_lwp_setprivate();
+extern int sys_lwp_getprivate();
+extern int sys_lwp_wait();
+extern int sys_lwp_mutex_unlock();
+extern int sys_lwp_mutex_lock();
+extern int sys_lwp_cond_wait();
+extern int sys_lwp_cond_signal();
+extern int sys_lwp_cond_broadcast();
+extern int sys_pread();
+extern int sys_pwrite();
+extern int sys_llseek();
+extern int sys_inst_sync();
+extern int sys_auditsys();
+extern int sys_processor_bind();
+extern int sys_processor_info();
+extern int sys_p_online();
+extern int sys_sigqueue();
+extern int sys_clock_gettime();
+extern int sys_clock_settime();
+extern int sys_clock_getres();
+extern int sys_timer_create();
+extern int sys_timer_delete();
+extern int sys_timer_settime();
+extern int sys_timer_gettime();
+extern int sys_timer_getoverrun();
+extern int sys_nanosleep();
+#endif /* !MIPS */
+
+#ifdef MIPS
+#define SGI_KLUDGE 1
+#else
+#define SGI_KLUDGE 0
+#endif
+
+/* sys_pgrpsys subcalls */
+
+extern int sys_getpgrp(), sys_setpgrp(), sys_getsid();
+extern int sys_setsid(), sys_getpgid(), sys_setpgid();
+
+#ifndef MIPS
+
+#define SYS_pgrpsys_subcall 300 + SGI_KLUDGE
+#define SYS_getpgrp (SYS_pgrpsys_subcall + 0)
+#define SYS_setpgrp (SYS_pgrpsys_subcall + 1)
+#define SYS_getsid (SYS_pgrpsys_subcall + 2)
+#define SYS_setsid (SYS_pgrpsys_subcall + 3)
+#define SYS_getpgid (SYS_pgrpsys_subcall + 4)
+#define SYS_setpgid (SYS_pgrpsys_subcall + 5)
+
+#define SYS_pgrpsys_nsubcalls 6
+
+#endif /* !MIPS */
+
+/* sys_sigcall subcalls */
+
+#undef SYS_signal
+#define SYS_sigcall 48
+
+extern int sys_signal(), sys_sigset(), sys_sighold();
+extern int sys_sigrelse(), sys_sigignore(), sys_sigpause();
+
+#ifndef MIPS
+
+#define SYS_sigcall_subcall 310 + SGI_KLUDGE
+#define SYS_signal (SYS_sigcall_subcall + 0)
+#define SYS_sigset (SYS_sigcall_subcall + 1)
+#define SYS_sighold (SYS_sigcall_subcall + 2)
+#define SYS_sigrelse (SYS_sigcall_subcall + 3)
+#define SYS_sigignore (SYS_sigcall_subcall + 4)
+#define SYS_sigpause (SYS_sigcall_subcall + 5)
+
+#define SYS_sigcall_nsubcalls 6
+
+#endif /* !MIPS */
+
+/* msgsys subcalls */
+
+extern int sys_msgget(), sys_msgctl(), sys_msgrcv(), sys_msgsnd();
+
+#define SYS_msgsys_subcall 320 + SGI_KLUDGE
+#define SYS_msgget (SYS_msgsys_subcall + 0)
+#define SYS_msgctl (SYS_msgsys_subcall + 1)
+#define SYS_msgrcv (SYS_msgsys_subcall + 2)
+#define SYS_msgsnd (SYS_msgsys_subcall + 3)
+
+#define SYS_msgsys_nsubcalls 4
+
+/* shmsys subcalls */
+
+extern int sys_shmat(), sys_shmctl(), sys_shmdt(), sys_shmget();
+
+#define SYS_shmsys_subcall 330 + SGI_KLUDGE
+#define SYS_shmat (SYS_shmsys_subcall + 0)
+#define SYS_shmctl (SYS_shmsys_subcall + 1)
+#define SYS_shmdt (SYS_shmsys_subcall + 2)
+#define SYS_shmget (SYS_shmsys_subcall + 3)
+
+#define SYS_shmsys_nsubcalls 4
+
+/* semsys subcalls */
+
+extern int sys_semctl(), sys_semget(), sys_semop();
+
+#define SYS_semsys_subcall 340 + SGI_KLUDGE
+#define SYS_semctl (SYS_semsys_subcall + 0)
+#define SYS_semget (SYS_semsys_subcall + 1)
+#define SYS_semop (SYS_semsys_subcall + 2)
+
+#define SYS_semsys_nsubcalls 3
+
+/* utssys subcalls */
+
+extern int sys_olduname(), sys_ustat(), sys_fusers();
+
+#define SYS_utssys_subcall 350 + SGI_KLUDGE
+
+#define SYS_olduname (SYS_utssys_subcall + 0)
+ /* 1 is unused */
+#define SYS_ustat (SYS_utssys_subcall + 2)
+#define SYS_fusers (SYS_utssys_subcall + 3)
+
+#define SYS_utssys_nsubcalls 4
+
+/* sysfs subcalls */
+
+extern int sys_sysfs1(), sys_sysfs2(), sys_sysfs3();
+
+#define SYS_sysfs_subcall 360 + SGI_KLUDGE
+ /* 0 is unused */
+#define SYS_sysfs1 (SYS_sysfs_subcall + 1)
+#define SYS_sysfs2 (SYS_sysfs_subcall + 2)
+#define SYS_sysfs3 (SYS_sysfs_subcall + 3)
+
+#define SYS_sysfs_nsubcalls 4
+
+/* sys_spcall subcalls */
+
+#undef SYS_sigpending
+#define SYS_spcall 99
+
+extern int sys_sigpending(), sys_sigfillset();
+
+#define SYS_spcall_subcall 370 + SGI_KLUDGE
+ /* 0 is unused */
+#define SYS_sigpending (SYS_spcall_subcall + 1)
+#define SYS_sigfillset (SYS_spcall_subcall + 2)
+
+#define SYS_spcall_nsubcalls 3
+
+/* sys_context subcalls */
+
+extern int sys_getcontext(), sys_setcontext();
+
+#ifndef MIPS
+
+#define SYS_context_subcall 380 + SGI_KLUDGE
+#define SYS_getcontext (SYS_context_subcall + 0)
+#define SYS_setcontext (SYS_context_subcall + 1)
+
+#define SYS_context_nsubcalls 2
+
+#endif /* !MIPS */
diff --git a/svr4/syscallent.h b/svr4/syscallent.h
new file mode 100644
index 000000000..cff7c4490
--- /dev/null
+++ b/svr4/syscallent.h
@@ -0,0 +1,628 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#ifdef MIPS
+ { -1, 0, printargs, "SYS_-1" }, /* -1 */
+#endif /* MIPS */
+ { -1, 0, sys_syscall, "syscall" }, /* 0 */
+ { -1, TP, sys_exit, "_exit" }, /* 1 */
+ { -1, TP, sys_fork, "fork" }, /* 2 */
+ { -1, 0, sys_read, "read" }, /* 3 */
+ { -1, 0, sys_write, "write" }, /* 4 */
+ { -1, TF, sys_open, "open" }, /* 5 */
+ { -1, 0, sys_close, "close" }, /* 6 */
+ { -1, TP, sys_wait, "wait" }, /* 7 */
+ { -1, TF, sys_creat, "creat" }, /* 8 */
+ { -1, TF, sys_link, "link" }, /* 9 */
+ { -1, TF, sys_unlink, "unlink" }, /* 10 */
+ { -1, TF|TP, sys_exec, "exec" }, /* 11 */
+ { -1, TF, sys_chdir, "chdir" }, /* 12 */
+ { -1, 0, sys_time, "time" }, /* 13 */
+ { -1, TF, sys_mknod, "mknod" }, /* 14 */
+ { -1, TF, sys_chmod, "chmod" }, /* 15 */
+ { -1, TF, sys_chown, "chown" }, /* 16 */
+ { -1, 0, sys_brk, "brk" }, /* 17 */
+ { -1, TF, sys_stat, "stat" }, /* 18 */
+ { -1, 0, sys_lseek, "lseek" }, /* 19 */
+ { -1, 0, sys_getpid, "getpid" }, /* 20 */
+ { -1, TF, sys_mount, "mount" }, /* 21 */
+ { -1, TF, sys_umount, "umount" }, /* 22 */
+ { -1, 0, sys_setuid, "setuid" }, /* 23 */
+ { -1, 0, sys_getuid, "getuid" }, /* 24 */
+ { -1, 0, sys_stime, "stime" }, /* 25 */
+ { -1, 0, sys_ptrace, "ptrace" }, /* 26 */
+ { -1, 0, sys_alarm, "alarm" }, /* 27 */
+ { -1, 0, sys_fstat, "fstat" }, /* 28 */
+ { -1, TS, sys_pause, "pause" }, /* 29 */
+ { -1, TF, sys_utime, "utime" }, /* 30 */
+ { -1, 0, sys_stty, "stty" }, /* 31 */
+ { -1, 0, sys_gtty, "gtty" }, /* 32 */
+ { -1, TF, sys_access, "access" }, /* 33 */
+ { -1, 0, sys_nice, "nice" }, /* 34 */
+ { -1, TF, sys_statfs, "statfs" }, /* 35 */
+ { -1, 0, sys_sync, "sync" }, /* 36 */
+ { -1, TS, sys_kill, "kill" }, /* 37 */
+ { -1, 0, sys_fstatfs, "fstatfs" }, /* 38 */
+#ifdef MIPS
+ { -1, 0, sys_setpgrp, "setpgrp" }, /* 39 */
+#else /* !MIPS */
+ { -1, 0, sys_pgrpsys, "pgrpsys" }, /* 39 */
+#endif /* !MIPS */
+#ifdef MIPS
+ { -1, 0, sys_syssgi, "syssgi" }, /* 40 */
+#else /* !MIPS */
+ { -1, 0, sys_xenix, "xenix" }, /* 40 */
+#endif /* !MIPS */
+ { -1, 0, sys_dup, "dup" }, /* 41 */
+ { -1, 0, sys_pipe, "pipe" }, /* 42 */
+ { -1, 0, sys_times, "times" }, /* 43 */
+ { -1, 0, sys_profil, "profil" }, /* 44 */
+ { -1, 0, sys_plock, "plock" }, /* 45 */
+ { -1, 0, sys_setgid, "setgid" }, /* 46 */
+ { -1, 0, sys_getgid, "getgid" }, /* 47 */
+ { -1, 0, sys_sigcall, "sigcall" }, /* 48 */
+ { -1, TI, sys_msgsys, "msgsys" }, /* 49 */
+#ifdef SPARC
+ { -1, 0, sys_syssun, "syssun" }, /* 50 */
+#else /* !SPARC */
+#ifdef I386
+ { -1, 0, sys_sysi86, "sysi86" }, /* 50 */
+#else /* !I386 */
+#ifdef MIPS
+ { -1, 0, sys_sysmips, "sysmips" }, /* 50 */
+#else /* !MIPS */
+ { -1, 0, sys_sysmachine, "sysmachine" }, /* 50 */
+#endif /* !MIPS */
+#endif /* !I386 */
+#endif /* !SPARC */
+ { -1, TF, sys_acct, "acct" }, /* 51 */
+ { -1, TI, sys_shmsys, "shmsys" }, /* 52 */
+ { -1, TI, sys_semsys, "semsys" }, /* 53 */
+ { -1, 0, sys_ioctl, "ioctl" }, /* 54 */
+ { -1, 0, sys_uadmin, "uadmin" }, /* 55 */
+ { -1, 0, sys_sysmp, "sysmp" }, /* 56 */
+ { -1, 0, sys_utssys, "utssys" }, /* 57 */
+ { -1, 0, sys_fdsync, "fdsync" }, /* 58 */
+ { -1, TF|TP, sys_execve, "execve" }, /* 59 */
+ { -1, 0, sys_umask, "umask" }, /* 60 */
+ { -1, TF, sys_chroot, "chroot" }, /* 61 */
+ { -1, 0, sys_fcntl, "fcntl" }, /* 62 */
+ { -1, 0, sys_ulimit, "ulimit" }, /* 63 */
+ { -1, 0, printargs, "SYS_64" }, /* 64 */
+ { -1, 0, printargs, "SYS_65" }, /* 65 */
+ { -1, 0, printargs, "SYS_66" }, /* 66 */
+ { -1, 0, printargs, "SYS_67" }, /* 67 */
+ { -1, 0, printargs, "SYS_68" }, /* 68 */
+ { -1, 0, printargs, "SYS_69" }, /* 69 */
+ { -1, 0, printargs, "SYS_70" }, /* 70 */
+ { -1, 0, printargs, "SYS_71" }, /* 71 */
+ { -1, 0, printargs, "SYS_72" }, /* 72 */
+ { -1, 0, printargs, "SYS_73" }, /* 73 */
+ { -1, 0, printargs, "SYS_74" }, /* 74 */
+ { -1, 0, printargs, "SYS_75" }, /* 75 */
+ { -1, 0, printargs, "SYS_76" }, /* 76 */
+ { -1, 0, printargs, "SYS_77" }, /* 77 */
+ { -1, 0, printargs, "SYS_78" }, /* 78 */
+ { -1, TF, sys_rmdir, "rmdir" }, /* 79 */
+ { -1, TF, sys_mkdir, "mkdir" }, /* 80 */
+ { -1, 0, sys_getdents, "getdents" }, /* 81 */
+ { -1, 0, sys_sginap, "sginap" }, /* 82 */
+ { -1, 0, sys_sgikopt, "sgikopt" }, /* 83 */
+ { -1, 0, sys_sysfs, "sysfs" }, /* 84 */
+ { -1, TN, sys_getmsg, "getmsg" }, /* 85 */
+ { -1, TN, sys_putmsg, "putmsg" }, /* 86 */
+ { -1, TN, sys_poll, "poll" }, /* 87 */
+#ifdef MIPS
+ { -1, TS, sys_sigreturn, "sigreturn" }, /* 88 */
+ { -1, TN, sys_accept, "accept" }, /* 89 */
+ { -1, TN, sys_bind, "bind" }, /* 90 */
+ { -1, TN, sys_connect, "connect" }, /* 91 */
+ { -1, 0, sys_gethostid, "gethostid" }, /* 92 */
+ { -1, TN, sys_getpeername, "getpeername" }, /* 93 */
+ { -1, TN, sys_getsockname, "getsockname" }, /* 94 */
+ { -1, TN, sys_getsockopt, "getsockopt" }, /* 95 */
+ { -1, TN, sys_listen, "listen" }, /* 96 */
+ { -1, TN, sys_recv, "recv" }, /* 97 */
+ { -1, TN, sys_recvfrom, "recvfrom" }, /* 98 */
+ { -1, TN, sys_recvmsg, "recvmsg" }, /* 99 */
+ { -1, 0, sys_select, "select" }, /* 100 */
+ { -1, TN, sys_send, "send" }, /* 101 */
+ { -1, TN, sys_sendmsg, "sendmsg" }, /* 102 */
+ { -1, TN, sys_sendto, "sendto" }, /* 103 */
+ { -1, 0, sys_sethostid, "sethostid" }, /* 104 */
+ { -1, TN, sys_setsockopt, "setsockopt" }, /* 105 */
+ { -1, TN, sys_shutdown, "shutdown" }, /* 106 */
+ { -1, TN, sys_socket, "socket" }, /* 107 */
+ { -1, 0, sys_gethostname, "gethostname" }, /* 108 */
+ { -1, 0, sys_sethostname, "sethostname" }, /* 109 */
+ { -1, 0, sys_getdomainname, "getdomainname" }, /* 110 */
+ { -1, 0, sys_setdomainname, "setdomainname" }, /* 111 */
+ { -1, TF, sys_truncate, "truncate" }, /* 112 */
+ { -1, 0, sys_ftruncate, "ftruncate" }, /* 113 */
+ { -1, TF, sys_rename, "rename" }, /* 114 */
+ { -1, TF, sys_symlink, "symlink" }, /* 115 */
+ { -1, TF, sys_readlink, "readlink" }, /* 116 */
+ { -1, 0, printargs, "SYS_117" }, /* 117 */
+ { -1, 0, printargs, "SYS_118" }, /* 118 */
+ { -1, 0, sys_nfssvc, "nfssvc" }, /* 119 */
+ { -1, 0, sys_getfh, "getfh" }, /* 120 */
+ { -1, 0, sys_async_daemon, "async_daemon" }, /* 121 */
+ { -1, 0, sys_exportfs, "exportfs" }, /* 122 */
+ { -1, 0, sys_setregid, "setregid" }, /* 123 */
+ { -1, 0, sys_setreuid, "setreuid" }, /* 124 */
+ { -1, 0, sys_getitimer, "getitimer" }, /* 125 */
+ { -1, 0, sys_setitimer, "setitimer" }, /* 126 */
+ { -1, 0, sys_adjtime, "adjtime" }, /* 127 */
+ { -1, 0, sys_BSD_getime, "BSD_getime" }, /* 128 */
+ { -1, 0, sys_sproc, "sproc" }, /* 129 */
+ { -1, 0, sys_prctl, "prctl" }, /* 130 */
+ { -1, 0, sys_procblk, "procblk" }, /* 131 */
+ { -1, 0, sys_sprocsp, "sprocsp" }, /* 132 */
+ { -1, 0, printargs, "SYS_133" }, /* 133 */
+ { -1, 0, sys_mmap, "mmap" }, /* 134 */
+ { -1, 0, sys_munmap, "munmap" }, /* 135 */
+ { -1, 0, sys_mprotect, "mprotect" }, /* 136 */
+ { -1, 0, sys_msync, "msync" }, /* 137 */
+ { -1, 0, sys_madvise, "madvise" }, /* 138 */
+ { -1, 0, sys_pagelock, "pagelock" }, /* 139 */
+ { -1, 0, sys_getpagesize, "getpagesize" }, /* 140 */
+ { -1, 0, sys_quotactl, "quotactl" }, /* 141 */
+ { -1, 0, printargs, "SYS_142" }, /* 142 */
+ { -1, 0, sys_BSDgetpgrp, "BSDgetpgrp" }, /* 143 */
+ { -1, 0, sys_BSDsetpgrp, "BSDsetpgrp" }, /* 144 */
+ { -1, 0, sys_vhangup, "vhangup" }, /* 145 */
+ { -1, 0, sys_fsync, "fsync" }, /* 146 */
+ { -1, 0, sys_fchdir, "fchdir" }, /* 147 */
+ { -1, 0, sys_getrlimit, "getrlimit" }, /* 148 */
+ { -1, 0, sys_setrlimit, "setrlimit" }, /* 149 */
+ { -1, 0, sys_cacheflush, "cacheflush" }, /* 150 */
+ { -1, 0, sys_cachectl, "cachectl" }, /* 151 */
+ { -1, 0, sys_fchown, "fchown" }, /* 152 */
+ { -1, 0, sys_fchmod, "fchmod" }, /* 153 */
+ { -1, 0, printargs, "SYS_154" }, /* 154 */
+ { -1, TN, sys_socketpair, "socketpair" }, /* 155 */
+ { -1, 0, sys_sysinfo, "sysinfo" }, /* 156 */
+ { -1, 0, sys_nuname, "nuname" }, /* 157 */
+ { -1, TF, sys_xstat, "xstat" }, /* 158 */
+ { -1, TF, sys_lxstat, "lxstat" }, /* 159 */
+ { -1, 0, sys_fxstat, "fxstat" }, /* 160 */
+ { -1, TF, sys_xmknod, "xmknod" }, /* 161 */
+ { -1, TS, sys_ksigaction, "sigaction" }, /* 162 */
+ { -1, TS, sys_sigpending, "sigpending" }, /* 163 */
+ { -1, TS, sys_sigprocmask, "sigprocmask" }, /* 164 */
+ { -1, TS, sys_sigsuspend, "sigsuspend" }, /* 165 */
+ { -1, TS, sys_sigpoll, "sigpoll" }, /* 166 */
+ { -1, 0, sys_swapctl, "swapctl" }, /* 167 */
+ { -1, 0, sys_getcontext, "getcontext" }, /* 168 */
+ { -1, 0, sys_setcontext, "setcontext" }, /* 169 */
+ { -1, TP, sys_waitsys, "waitid" }, /* 170 */
+ { -1, TS, sys_sigstack, "sigstack" }, /* 171 */
+ { -1, TS, sys_sigaltstack, "sigaltstack" }, /* 172 */
+ { -1, TS, sys_sigsendset, "sigsendset" }, /* 173 */
+ { -1, TF, sys_statvfs, "statvfs" }, /* 174 */
+ { -1, 0, sys_fstatvfs, "fstatvfs" }, /* 175 */
+ { -1, TN, sys_getpmsg, "getpmsg" }, /* 176 */
+ { -1, TN, sys_putpmsg, "putpmsg" }, /* 177 */
+ { -1, TF, sys_lchown, "lchown" }, /* 178 */
+ { -1, 0, sys_priocntl, "priocntl" }, /* 179 */
+ { -1, TS, sys_ksigqueue, "ksigqueue" }, /* 180 */
+ { -1, 0, printargs, "SYS_181" }, /* 181 */
+ { -1, 0, printargs, "SYS_182" }, /* 182 */
+ { -1, 0, printargs, "SYS_183" }, /* 183 */
+ { -1, 0, printargs, "SYS_184" }, /* 184 */
+ { -1, 0, printargs, "SYS_185" }, /* 185 */
+ { -1, 0, printargs, "SYS_186" }, /* 186 */
+ { -1, 0, printargs, "SYS_187" }, /* 187 */
+ { -1, 0, printargs, "SYS_188" }, /* 188 */
+ { -1, 0, printargs, "SYS_189" }, /* 189 */
+ { -1, 0, printargs, "SYS_190" }, /* 190 */
+ { -1, 0, printargs, "SYS_191" }, /* 191 */
+ { -1, 0, printargs, "SYS_192" }, /* 192 */
+ { -1, 0, printargs, "SYS_193" }, /* 193 */
+ { -1, 0, printargs, "SYS_194" }, /* 194 */
+ { -1, 0, printargs, "SYS_195" }, /* 195 */
+ { -1, 0, printargs, "SYS_196" }, /* 196 */
+ { -1, 0, printargs, "SYS_197" }, /* 197 */
+ { -1, 0, printargs, "SYS_198" }, /* 198 */
+ { -1, 0, printargs, "SYS_199" }, /* 199 */
+ { -1, 0, printargs, "SYS_200" }, /* 200 */
+ { -1, 0, printargs, "SYS_201" }, /* 201 */
+ { -1, 0, printargs, "SYS_202" }, /* 202 */
+ { -1, 0, printargs, "SYS_203" }, /* 203 */
+ { -1, 0, printargs, "SYS_204" }, /* 204 */
+ { -1, 0, printargs, "SYS_205" }, /* 205 */
+ { -1, 0, printargs, "SYS_206" }, /* 206 */
+ { -1, 0, printargs, "SYS_207" }, /* 207 */
+ { -1, 0, printargs, "SYS_208" }, /* 208 */
+ { -1, 0, printargs, "SYS_209" }, /* 209 */
+ { -1, 0, printargs, "SYS_210" }, /* 210 */
+ { -1, 0, printargs, "SYS_211" }, /* 211 */
+ { -1, 0, printargs, "SYS_212" }, /* 212 */
+ { -1, 0, printargs, "SYS_213" }, /* 213 */
+ { -1, 0, printargs, "SYS_214" }, /* 214 */
+ { -1, 0, printargs, "SYS_215" }, /* 215 */
+ { -1, 0, printargs, "SYS_216" }, /* 216 */
+ { -1, 0, printargs, "SYS_217" }, /* 217 */
+ { -1, 0, printargs, "SYS_218" }, /* 218 */
+ { -1, 0, printargs, "SYS_219" }, /* 219 */
+ { -1, 0, printargs, "SYS_220" }, /* 220 */
+ { -1, 0, printargs, "SYS_221" }, /* 221 */
+ { -1, 0, printargs, "SYS_222" }, /* 222 */
+ { -1, 0, printargs, "SYS_223" }, /* 223 */
+ { -1, 0, printargs, "SYS_224" }, /* 224 */
+ { -1, 0, printargs, "SYS_225" }, /* 225 */
+ { -1, 0, printargs, "SYS_226" }, /* 226 */
+ { -1, 0, printargs, "SYS_227" }, /* 227 */
+ { -1, 0, printargs, "SYS_228" }, /* 228 */
+ { -1, 0, printargs, "SYS_229" }, /* 229 */
+ { -1, 0, printargs, "SYS_230" }, /* 230 */
+ { -1, 0, printargs, "SYS_231" }, /* 231 */
+ { -1, 0, printargs, "SYS_232" }, /* 232 */
+ { -1, 0, printargs, "SYS_233" }, /* 233 */
+ { -1, 0, printargs, "SYS_234" }, /* 234 */
+ { -1, 0, printargs, "SYS_235" }, /* 235 */
+ { -1, 0, printargs, "SYS_236" }, /* 236 */
+ { -1, 0, printargs, "SYS_237" }, /* 237 */
+ { -1, 0, printargs, "SYS_238" }, /* 238 */
+ { -1, 0, printargs, "SYS_239" }, /* 239 */
+ { -1, 0, printargs, "SYS_240" }, /* 240 */
+ { -1, 0, printargs, "SYS_241" }, /* 241 */
+ { -1, 0, printargs, "SYS_242" }, /* 242 */
+ { -1, 0, printargs, "SYS_243" }, /* 243 */
+ { -1, 0, printargs, "SYS_244" }, /* 244 */
+ { -1, 0, printargs, "SYS_245" }, /* 245 */
+ { -1, 0, printargs, "SYS_246" }, /* 246 */
+ { -1, 0, printargs, "SYS_247" }, /* 247 */
+ { -1, 0, printargs, "SYS_248" }, /* 248 */
+ { -1, 0, printargs, "SYS_249" }, /* 249 */
+ { -1, 0, printargs, "SYS_250" }, /* 250 */
+#else /* !MIPS */
+ { -1, TF, sys_lstat, "lstat" }, /* 88 */
+ { -1, TF, sys_symlink, "symlink" }, /* 89 */
+ { -1, TF, sys_readlink, "readlink" }, /* 90 */
+ { -1, 0, sys_setgroups, "setgroups" }, /* 91 */
+ { -1, 0, sys_getgroups, "getgroups" }, /* 92 */
+ { -1, 0, sys_fchmod, "fchmod" }, /* 93 */
+ { -1, 0, sys_fchown, "fchown" }, /* 94 */
+ { -1, TS, sys_sigprocmask, "sigprocmask" }, /* 95 */
+ { -1, TS, sys_sigsuspend, "sigsuspend" }, /* 96 */
+ { -1, TS, sys_sigaltstack, "sigaltstack" }, /* 97 */
+ { -1, TS, sys_sigaction, "sigaction" }, /* 98 */
+ { -1, 0, sys_spcall, "spcall" }, /* 99 */
+ { -1, 0, sys_context, "context" }, /* 100 */
+ { -1, 0, sys_evsys, "evsys" }, /* 101 */
+ { -1, 0, sys_evtrapret, "evtrapret" }, /* 102 */
+ { -1, TF, sys_statvfs, "statvfs" }, /* 103 */
+ { -1, 0, sys_fstatvfs, "fstatvfs" }, /* 104 */
+ { -1, 0, printargs, "SYS_105" }, /* 105 */
+ { -1, 0, sys_nfssys, "nfssys" }, /* 106 */
+ { -1, TP, sys_waitid, "waitid" }, /* 107 */
+ { -1, 0, sys_sigsendsys, "sigsendsys" }, /* 108 */
+ { -1, 0, sys_hrtsys, "hrtsys" }, /* 109 */
+ { -1, 0, sys_acancel, "acancel" }, /* 110 */
+ { -1, 0, sys_async, "async" }, /* 111 */
+ { -1, 0, sys_priocntlsys, "priocntlsys" }, /* 112 */
+ { -1, TF, sys_pathconf, "pathconf" }, /* 113 */
+ { -1, 0, sys_mincore, "mincore" }, /* 114 */
+ { -1, 0, sys_mmap, "mmap" }, /* 115 */
+ { -1, 0, sys_mprotect, "mprotect" }, /* 116 */
+ { -1, 0, sys_munmap, "munmap" }, /* 117 */
+ { -1, 0, sys_fpathconf, "fpathconf" }, /* 118 */
+ { -1, TP, sys_vfork, "vfork" }, /* 119 */
+ { -1, 0, sys_fchdir, "fchdir" }, /* 120 */
+ { -1, 0, sys_readv, "readv" }, /* 121 */
+ { -1, 0, sys_writev, "writev" }, /* 122 */
+ { -1, TF, sys_xstat, "xstat" }, /* 123 */
+ { -1, TF, sys_lxstat, "lxstat" }, /* 124 */
+ { -1, 0, sys_fxstat, "fxstat" }, /* 125 */
+ { -1, TF, sys_xmknod, "xmknod" }, /* 126 */
+ { -1, 0, sys_clocal, "clocal" }, /* 127 */
+ { -1, 0, sys_setrlimit, "setrlimit" }, /* 128 */
+ { -1, 0, sys_getrlimit, "getrlimit" }, /* 129 */
+ { -1, TF, sys_lchown, "lchown" }, /* 130 */
+ { -1, 0, sys_memcntl, "memcntl" }, /* 131 */
+ { -1, TN, sys_getpmsg, "getpmsg" }, /* 132 */
+ { -1, TN, sys_putpmsg, "putpmsg" }, /* 133 */
+ { -1, TF, sys_rename, "rename" }, /* 134 */
+ { -1, 0, sys_uname, "uname" }, /* 135 */
+ { -1, 0, sys_setegid, "setegid" }, /* 136 */
+ { -1, 0, sys_sysconfig, "sysconfig" }, /* 137 */
+ { -1, 0, sys_adjtime, "adjtime" }, /* 138 */
+ { -1, 0, sys_sysinfo, "sysinfo" }, /* 139 */
+ { -1, 0, printargs, "SYS_140" }, /* 140 */
+ { -1, 0, sys_seteuid, "seteuid" }, /* 141 */
+ { -1, 0, sys_vtrace, "vtrace" }, /* 142 */
+ { -1, TP, sys_fork1, "fork1" }, /* 143 */
+ { -1, TS, sys_sigtimedwait, "sigtimedwait" }, /* 144 */
+ { -1, 0, sys_lwp_info, "lwp_info" }, /* 145 */
+ { -1, 0, sys_yield, "yield" }, /* 146 */
+ { -1, 0, sys_lwp_sema_wait, "lwp_sema_wait" }, /* 147 */
+ { -1, 0, sys_lwp_sema_post, "lwp_sema_post" }, /* 148 */
+ { -1, 0, printargs, "SYS_149" }, /* 149 */
+ { -1, 0, printargs, "SYS_150" }, /* 150 */
+ { -1, 0, printargs, "SYS_151" }, /* 151 */
+ { -1, 0, sys_modctl, "modctl" }, /* 152 */
+ { -1, 0, sys_fchroot, "fchroot" }, /* 153 */
+ { -1, TF, sys_utimes, "utimes" }, /* 154 */
+ { -1, 0, sys_vhangup, "vhangup" }, /* 155 */
+ { -1, 0, sys_gettimeofday, "gettimeofday" }, /* 156 */
+ { -1, 0, sys_getitimer, "getitimer" }, /* 157 */
+ { -1, 0, sys_setitimer, "setitimer" }, /* 158 */
+ { -1, 0, sys_lwp_create, "lwp_create" }, /* 159 */
+ { -1, 0, sys_lwp_exit, "lwp_exit" }, /* 160 */
+ { -1, 0, sys_lwp_suspend, "lwp_suspend" }, /* 161 */
+ { -1, 0, sys_lwp_continue, "lwp_continue" }, /* 162 */
+ { -1, 0, sys_lwp_kill, "lwp_kill" }, /* 163 */
+ { -1, 0, sys_lwp_self, "lwp_self" }, /* 164 */
+ { -1, 0, sys_lwp_setprivate, "lwp_setprivate"}, /* 165 */
+ { -1, 0, sys_lwp_getprivate, "lwp_getprivate"}, /* 166 */
+ { -1, 0, sys_lwp_wait, "lwp_wait" }, /* 167 */
+ { -1, 0, sys_lwp_mutex_unlock, "lwp_mutex_unlock"}, /* 168 */
+ { -1, 0, sys_lwp_mutex_lock, "lwp_mutex_lock"}, /* 169 */
+ { -1, 0, sys_lwp_cond_wait, "lwp_cond_wait"}, /* 170 */
+ { -1, 0, sys_lwp_cond_signal, "lwp_cond_signal"}, /* 171 */
+ { -1, 0, sys_lwp_cond_broadcast, "lwp_cond_broadcast"}, /* 172 */
+ { -1, 0, sys_pread, "pread" }, /* 173 */
+ { -1, 0, sys_pwrite, "pwrite" }, /* 174 */
+ { -1, 0, sys_llseek, "llseek" }, /* 175 */
+ { -1, 0, sys_inst_sync, "inst_sync" }, /* 176 */
+ { -1, 0, printargs, "SYS_177" }, /* 177 */
+ { -1, 0, printargs, "SYS_178" }, /* 178 */
+ { -1, 0, printargs, "SYS_179" }, /* 179 */
+ { -1, 0, printargs, "SYS_180" }, /* 180 */
+ { -1, 0, printargs, "SYS_181" }, /* 181 */
+ { -1, 0, printargs, "SYS_182" }, /* 182 */
+ { -1, 0, printargs, "SYS_183" }, /* 183 */
+ { -1, 0, printargs, "SYS_184" }, /* 184 */
+ { -1, 0, printargs, "SYS_185" }, /* 185 */
+ { -1, 0, sys_auditsys, "auditsys" }, /* 186 */
+ { -1, 0, sys_processor_bind, "processor_bind"}, /* 187 */
+ { -1, 0, sys_processor_info, "processor_info"}, /* 188 */
+ { -1, 0, sys_p_online, "p_online" }, /* 189 */
+ { -1, 0, sys_sigqueue, "sigqueue" }, /* 190 */
+ { -1, 0, sys_clock_gettime, "clock_gettime" }, /* 191 */
+ { -1, 0, sys_clock_settime, "clock_settime" }, /* 192 */
+ { -1, 0, sys_clock_getres, "clock_getres" }, /* 193 */
+ { -1, 0, sys_timer_create, "timer_create" }, /* 194 */
+ { -1, 0, sys_timer_delete, "timer_delete" }, /* 195 */
+ { -1, 0, sys_timer_settime, "timer_settime" }, /* 196 */
+ { -1, 0, sys_timer_gettime, "timer_gettime" }, /* 197 */
+ { -1, 0, sys_timer_getoverrun, "timer_getoverrun"}, /* 198 */
+ { -1, 0, sys_nanosleep, "nanosleep" }, /* 199 */
+ { -1, 0, printargs, "SYS_200" }, /* 200 */
+ { -1, 0, printargs, "SYS_201" }, /* 201 */
+ { -1, 0, printargs, "SYS_202" }, /* 202 */
+ { -1, 0, printargs, "SYS_203" }, /* 203 */
+ { -1, 0, printargs, "SYS_204" }, /* 204 */
+ { -1, 0, printargs, "SYS_205" }, /* 205 */
+ { -1, 0, printargs, "SYS_206" }, /* 206 */
+ { -1, 0, printargs, "SYS_207" }, /* 207 */
+ { -1, 0, printargs, "SYS_208" }, /* 208 */
+ { -1, 0, printargs, "SYS_209" }, /* 209 */
+ { -1, 0, printargs, "SYS_210" }, /* 210 */
+ { -1, 0, printargs, "SYS_211" }, /* 211 */
+ { -1, 0, printargs, "SYS_212" }, /* 212 */
+ { -1, 0, printargs, "SYS_213" }, /* 213 */
+ { -1, 0, printargs, "SYS_214" }, /* 214 */
+ { -1, 0, printargs, "SYS_215" }, /* 215 */
+ { -1, 0, printargs, "SYS_216" }, /* 216 */
+ { -1, 0, printargs, "SYS_217" }, /* 217 */
+ { -1, 0, printargs, "SYS_218" }, /* 218 */
+ { -1, 0, printargs, "SYS_219" }, /* 219 */
+ { -1, 0, printargs, "SYS_220" }, /* 220 */
+ { -1, 0, printargs, "SYS_221" }, /* 221 */
+ { -1, 0, printargs, "SYS_222" }, /* 222 */
+ { -1, 0, printargs, "SYS_223" }, /* 223 */
+ { -1, 0, printargs, "SYS_224" }, /* 224 */
+ { -1, 0, printargs, "SYS_225" }, /* 225 */
+ { -1, 0, printargs, "SYS_226" }, /* 226 */
+ { -1, 0, printargs, "SYS_227" }, /* 227 */
+ { -1, 0, printargs, "SYS_228" }, /* 228 */
+ { -1, 0, printargs, "SYS_229" }, /* 229 */
+ { -1, 0, printargs, "SYS_230" }, /* 230 */
+ { -1, 0, printargs, "SYS_231" }, /* 231 */
+ { -1, 0, printargs, "SYS_232" }, /* 232 */
+ { -1, 0, printargs, "SYS_233" }, /* 233 */
+ { -1, 0, printargs, "SYS_234" }, /* 234 */
+ { -1, 0, printargs, "SYS_235" }, /* 235 */
+ { -1, 0, printargs, "SYS_236" }, /* 236 */
+ { -1, 0, printargs, "SYS_237" }, /* 237 */
+ { -1, 0, printargs, "SYS_238" }, /* 238 */
+ { -1, 0, printargs, "SYS_239" }, /* 239 */
+ { -1, 0, printargs, "SYS_240" }, /* 240 */
+ { -1, 0, printargs, "SYS_241" }, /* 241 */
+ { -1, 0, printargs, "SYS_242" }, /* 242 */
+ { -1, 0, printargs, "SYS_243" }, /* 243 */
+ { -1, 0, printargs, "SYS_244" }, /* 244 */
+ { -1, 0, printargs, "SYS_245" }, /* 245 */
+ { -1, 0, printargs, "SYS_246" }, /* 246 */
+ { -1, 0, printargs, "SYS_247" }, /* 247 */
+ { -1, 0, printargs, "SYS_248" }, /* 248 */
+ { -1, 0, printargs, "SYS_249" }, /* 249 */
+ { -1, 0, printargs, "SYS_250" }, /* 250 */
+#endif /* !MIPS */
+ { -1, 0, printargs, "SYS_251" }, /* 251 */
+ { -1, 0, printargs, "SYS_252" }, /* 252 */
+ { -1, 0, printargs, "SYS_253" }, /* 253 */
+ { -1, 0, printargs, "SYS_254" }, /* 254 */
+ { -1, 0, printargs, "SYS_255" }, /* 255 */
+ { -1, 0, printargs, "SYS_256" }, /* 256 */
+ { -1, 0, printargs, "SYS_257" }, /* 257 */
+ { -1, 0, printargs, "SYS_258" }, /* 258 */
+ { -1, 0, printargs, "SYS_259" }, /* 259 */
+ { -1, 0, printargs, "SYS_260" }, /* 260 */
+ { -1, 0, printargs, "SYS_261" }, /* 261 */
+ { -1, 0, printargs, "SYS_262" }, /* 262 */
+ { -1, 0, printargs, "SYS_263" }, /* 263 */
+ { -1, 0, printargs, "SYS_264" }, /* 264 */
+ { -1, 0, printargs, "SYS_265" }, /* 265 */
+ { -1, 0, printargs, "SYS_266" }, /* 266 */
+ { -1, 0, printargs, "SYS_267" }, /* 267 */
+ { -1, 0, printargs, "SYS_268" }, /* 268 */
+ { -1, 0, printargs, "SYS_269" }, /* 269 */
+ { -1, 0, printargs, "SYS_270" }, /* 270 */
+ { -1, 0, printargs, "SYS_271" }, /* 271 */
+ { -1, 0, printargs, "SYS_272" }, /* 272 */
+ { -1, 0, printargs, "SYS_273" }, /* 273 */
+ { -1, 0, printargs, "SYS_274" }, /* 274 */
+ { -1, 0, printargs, "SYS_275" }, /* 275 */
+ { -1, 0, printargs, "SYS_276" }, /* 276 */
+ { -1, 0, printargs, "SYS_277" }, /* 277 */
+ { -1, 0, printargs, "SYS_278" }, /* 278 */
+ { -1, 0, printargs, "SYS_279" }, /* 279 */
+ { -1, 0, printargs, "SYS_280" }, /* 280 */
+ { -1, 0, printargs, "SYS_281" }, /* 281 */
+ { -1, 0, printargs, "SYS_282" }, /* 282 */
+ { -1, 0, printargs, "SYS_283" }, /* 283 */
+ { -1, 0, printargs, "SYS_284" }, /* 284 */
+ { -1, 0, printargs, "SYS_285" }, /* 285 */
+ { -1, 0, printargs, "SYS_286" }, /* 286 */
+ { -1, 0, printargs, "SYS_287" }, /* 287 */
+ { -1, 0, printargs, "SYS_288" }, /* 288 */
+ { -1, 0, printargs, "SYS_289" }, /* 289 */
+ { -1, 0, printargs, "SYS_290" }, /* 290 */
+ { -1, 0, printargs, "SYS_291" }, /* 291 */
+ { -1, 0, printargs, "SYS_292" }, /* 292 */
+ { -1, 0, printargs, "SYS_293" }, /* 293 */
+ { -1, 0, printargs, "SYS_294" }, /* 294 */
+ { -1, 0, printargs, "SYS_295" }, /* 295 */
+ { -1, 0, printargs, "SYS_296" }, /* 296 */
+ { -1, 0, printargs, "SYS_297" }, /* 297 */
+ { -1, 0, printargs, "SYS_298" }, /* 298 */
+ { -1, 0, printargs, "SYS_299" }, /* 299 */
+
+ { -1, 0, sys_getpgrp, "getpgrp" }, /* 300 */
+ { -1, 0, sys_setpgrp, "setpgrp" }, /* 301 */
+ { -1, 0, sys_getsid, "getsid" }, /* 302 */
+ { -1, 0, sys_setsid, "setsid" }, /* 303 */
+ { -1, 0, sys_getpgid, "getpgid" }, /* 304 */
+ { -1, 0, sys_setpgid, "setpgid" }, /* 305 */
+ { -1, 0, printargs, "SYS_306" }, /* 306 */
+ { -1, 0, printargs, "SYS_307" }, /* 307 */
+ { -1, 0, printargs, "SYS_308" }, /* 308 */
+ { -1, 0, printargs, "SYS_309" }, /* 309 */
+
+ { -1, TS, sys_signal, "signal" }, /* 310 */
+ { -1, TS, sys_sigset, "sigset" }, /* 311 */
+ { -1, TS, sys_sighold, "sighold" }, /* 312 */
+ { -1, TS, sys_sigrelse, "sigrelse" }, /* 313 */
+ { -1, TS, sys_sigignore, "sigignore" }, /* 314 */
+ { -1, TS, sys_sigpause, "sigpause" }, /* 315 */
+ { -1, 0, printargs, "SYS_316" }, /* 316 */
+ { -1, 0, printargs, "SYS_317" }, /* 317 */
+ { -1, 0, printargs, "SYS_318" }, /* 318 */
+ { -1, 0, printargs, "SYS_319" }, /* 319 */
+
+ { -1, TI, sys_msgget, "msgget" }, /* 320 */
+ { -1, TI, sys_msgctl, "msgctl" }, /* 321 */
+ { -1, TI, sys_msgrcv, "msgrcv" }, /* 322 */
+ { -1, TI, sys_msgsnd, "msgsnd" }, /* 323 */
+ { -1, 0, printargs, "SYS_324" }, /* 324 */
+ { -1, 0, printargs, "SYS_325" }, /* 325 */
+ { -1, 0, printargs, "SYS_326" }, /* 326 */
+ { -1, 0, printargs, "SYS_327" }, /* 327 */
+ { -1, 0, printargs, "SYS_328" }, /* 328 */
+ { -1, 0, printargs, "SYS_329" }, /* 329 */
+
+ { -1, TI, sys_shmat, "shmat" }, /* 330 */
+ { -1, TI, sys_shmctl, "shmctl" }, /* 331 */
+ { -1, TI, sys_shmdt, "shmdt" }, /* 332 */
+ { -1, TI, sys_shmget, "shmget" }, /* 333 */
+ { -1, 0, printargs, "SYS_334" }, /* 334 */
+ { -1, 0, printargs, "SYS_335" }, /* 335 */
+ { -1, 0, printargs, "SYS_336" }, /* 336 */
+ { -1, 0, printargs, "SYS_337" }, /* 337 */
+ { -1, 0, printargs, "SYS_338" }, /* 338 */
+ { -1, 0, printargs, "SYS_339" }, /* 339 */
+
+ { -1, TI, sys_semctl, "semctl" }, /* 340 */
+ { -1, TI, sys_semget, "semget" }, /* 341 */
+ { -1, TI, sys_semop, "semop" }, /* 342 */
+ { -1, 0, printargs, "SYS_343" }, /* 343 */
+ { -1, 0, printargs, "SYS_344" }, /* 344 */
+ { -1, 0, printargs, "SYS_345" }, /* 345 */
+ { -1, 0, printargs, "SYS_346" }, /* 346 */
+ { -1, 0, printargs, "SYS_347" }, /* 347 */
+ { -1, 0, printargs, "SYS_348" }, /* 348 */
+ { -1, 0, printargs, "SYS_349" }, /* 349 */
+
+ { -1, 0, sys_olduname, "olduname" }, /* 350 */
+ { -1, 0, printargs, "utssys1" }, /* 351 */
+ { -1, 0, sys_ustat, "ustat" }, /* 352 */
+ { -1, 0, sys_fusers, "fusers" }, /* 353 */
+ { -1, 0, printargs, "SYS_354" }, /* 354 */
+ { -1, 0, printargs, "SYS_355" }, /* 355 */
+ { -1, 0, printargs, "SYS_356" }, /* 356 */
+ { -1, 0, printargs, "SYS_357" }, /* 357 */
+ { -1, 0, printargs, "SYS_358" }, /* 358 */
+ { -1, 0, printargs, "SYS_359" }, /* 359 */
+
+ { -1, 0, printargs, "sysfs0" }, /* 360 */
+ { -1, 0, sys_sysfs1, "sysfs1" }, /* 361 */
+ { -1, 0, sys_sysfs2, "sysfs2" }, /* 362 */
+ { -1, 0, sys_sysfs3, "sysfs3" }, /* 363 */
+ { -1, 0, printargs, "SYS_364" }, /* 364 */
+ { -1, 0, printargs, "SYS_365" }, /* 365 */
+ { -1, 0, printargs, "SYS_366" }, /* 366 */
+ { -1, 0, printargs, "SYS_367" }, /* 367 */
+ { -1, 0, printargs, "SYS_368" }, /* 368 */
+ { -1, 0, printargs, "SYS_369" }, /* 369 */
+
+ { -1, 0, printargs, "spcall0" }, /* 370 */
+ { -1, TS, sys_sigpending, "sigpending" }, /* 371 */
+ { -1, TS, sys_sigfillset, "sigfillset" }, /* 372 */
+ { -1, 0, printargs, "SYS_373" }, /* 373 */
+ { -1, 0, printargs, "SYS_374" }, /* 374 */
+ { -1, 0, printargs, "SYS_375" }, /* 375 */
+ { -1, 0, printargs, "SYS_376" }, /* 376 */
+ { -1, 0, printargs, "SYS_377" }, /* 377 */
+ { -1, 0, printargs, "SYS_378" }, /* 378 */
+ { -1, 0, printargs, "SYS_379" }, /* 379 */
+
+ { -1, 0, sys_getcontext, "getcontext" }, /* 380 */
+ { -1, 0, sys_setcontext, "setcontext" }, /* 381 */
+ { -1, 0, printargs, "SYS_382" }, /* 382 */
+ { -1, 0, printargs, "SYS_383" }, /* 383 */
+ { -1, 0, printargs, "SYS_384" }, /* 384 */
+ { -1, 0, printargs, "SYS_385" }, /* 385 */
+ { -1, 0, printargs, "SYS_386" }, /* 386 */
+ { -1, 0, printargs, "SYS_387" }, /* 387 */
+ { -1, 0, printargs, "SYS_388" }, /* 388 */
+ { -1, 0, printargs, "SYS_389" }, /* 389 */
+
+ { -1, 0, printargs, "SYS_390" }, /* 390 */
+ { -1, 0, printargs, "SYS_391" }, /* 391 */
+ { -1, 0, printargs, "SYS_392" }, /* 392 */
+ { -1, 0, printargs, "SYS_393" }, /* 393 */
+ { -1, 0, printargs, "SYS_394" }, /* 394 */
+ { -1, 0, printargs, "SYS_395" }, /* 395 */
+ { -1, 0, printargs, "SYS_396" }, /* 396 */
+ { -1, 0, printargs, "SYS_397" }, /* 397 */
+ { -1, 0, printargs, "SYS_398" }, /* 398 */
+ { -1, 0, printargs, "SYS_399" }, /* 399 */
diff --git a/syscall.c b/syscall.c
new file mode 100644
index 000000000..91bdd8bc7
--- /dev/null
+++ b/syscall.c
@@ -0,0 +1,1431 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <signal.h>
+#include <time.h>
+#include <errno.h>
+#include <sys/user.h>
+#include <sys/syscall.h>
+#include <sys/param.h>
+#if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1
+# include <sys/reg.h>
+#endif
+
+#ifdef LINUX
+#include <linux/ptrace.h>
+#endif /* LINUX */
+
+#ifndef SYS_ERRLIST_DECLARED
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif /* SYS_ERRLIST_DECLARED */
+
+#ifdef LINUX
+#ifndef ERESTARTSYS
+#define ERESTARTSYS 512
+#endif
+#ifndef ERESTARTNOINTR
+#define ERESTARTNOINTR 513
+#endif
+#ifndef ERESTARTNOHAND
+#define ERESTARTNOHAND 514 /* restart if no handler.. */
+#endif
+#ifndef ENOIOCTLCMD
+#define ENOIOCTLCMD 515 /* No ioctl command */
+#endif
+#ifndef NSIG
+#define NSIG 32
+#endif
+#ifdef ARM
+#undef NSIG
+#define NSIG 32
+#endif
+#endif /* LINUX */
+
+#include "syscall.h"
+
+/* Define these shorthand notations to simplify the syscallent files. */
+#define TF TRACE_FILE
+#define TI TRACE_IPC
+#define TN TRACE_NETWORK
+#define TP TRACE_PROCESS
+#define TS TRACE_SIGNAL
+
+struct sysent sysent0[] = {
+#include "syscallent.h"
+};
+int nsyscalls0 = sizeof sysent0 / sizeof sysent0[0];
+
+#if SUPPORTED_PERSONALITIES >= 2
+struct sysent sysent1[] = {
+#include "syscallent1.h"
+};
+int nsyscalls1 = sizeof sysent1 / sizeof sysent1[0];
+#endif /* SUPPORTED_PERSONALITIES >= 2 */
+
+#if SUPPORTED_PERSONALITIES >= 3
+struct sysent sysent2[] = {
+#include "syscallent2.h"
+};
+int nsyscalls2 = sizeof sysent2 / sizeof sysent2[0];
+#endif /* SUPPORTED_PERSONALITIES >= 3 */
+
+struct sysent *sysent;
+int nsyscalls;
+
+/* Now undef them since short defines cause wicked namespace pollution. */
+#undef TF
+#undef TI
+#undef TN
+#undef TP
+#undef TS
+
+char *errnoent0[] = {
+#include "errnoent.h"
+};
+int nerrnos0 = sizeof errnoent0 / sizeof errnoent0[0];
+
+#if SUPPORTED_PERSONALITIES >= 2
+char *errnoent1[] = {
+#include "errnoent1.h"
+};
+int nerrnos1 = sizeof errnoent1 / sizeof errnoent1[0];
+#endif /* SUPPORTED_PERSONALITIES >= 2 */
+
+#if SUPPORTED_PERSONALITIES >= 3
+char *errnoent2[] = {
+#include "errnoent2.h"
+};
+int nerrnos2 = sizeof errnoent2 / sizeof errnoent2[0];
+#endif /* SUPPORTED_PERSONALITIES >= 3 */
+
+char **errnoent;
+int nerrnos;
+
+int current_personality;
+
+int
+set_personality(int personality)
+{
+ switch (personality) {
+ case 0:
+ errnoent = errnoent0;
+ nerrnos = nerrnos0;
+ sysent = sysent0;
+ nsyscalls = nsyscalls0;
+ ioctlent = ioctlent0;
+ nioctlents = nioctlents0;
+ signalent = signalent0;
+ nsignals = nsignals0;
+ break;
+
+#if SUPPORTED_PERSONALITIES >= 2
+ case 1:
+ errnoent = errnoent1;
+ nerrnos = nerrnos1;
+ sysent = sysent1;
+ nsyscalls = nsyscalls1;
+ ioctlent = ioctlent1;
+ nioctlents = nioctlents1;
+ signalent = signalent1;
+ nsignals = nsignals1;
+ break;
+#endif /* SUPPORTED_PERSONALITIES >= 2 */
+
+#if SUPPORTED_PERSONALITIES >= 3
+ case 2:
+ errnoent = errnoent2;
+ nerrnos = nerrnos2;
+ sysent = sysent2;
+ nsyscalls = nsyscalls2;
+ ioctlent = ioctlent2;
+ nioctlents = nioctlents2;
+ signalent = signalent2;
+ nsignals = nsignals2;
+ break;
+#endif /* SUPPORTED_PERSONALITIES >= 3 */
+
+ default:
+ return -1;
+ }
+
+ current_personality = personality;
+ return 0;
+}
+
+int qual_flags[MAX_QUALS];
+
+static int call_count[MAX_QUALS];
+static int error_count[MAX_QUALS];
+static struct timeval tv_count[MAX_QUALS];
+static int sorted_count[MAX_QUALS];
+
+static struct timeval shortest = { 1000000, 0 };
+
+static int lookup_syscall(), lookup_signal(), lookup_fault(), lookup_desc();
+
+static struct qual_options {
+ int bitflag;
+ char *option_name;
+ int (*lookup)();
+ char *argument_name;
+} qual_options[] = {
+ { QUAL_TRACE, "trace", lookup_syscall, "system call" },
+ { QUAL_TRACE, "t", lookup_syscall, "system call" },
+ { QUAL_ABBREV, "abbrev", lookup_syscall, "system call" },
+ { QUAL_ABBREV, "a", lookup_syscall, "system call" },
+ { QUAL_VERBOSE, "verbose", lookup_syscall, "system call" },
+ { QUAL_VERBOSE, "v", lookup_syscall, "system call" },
+ { QUAL_RAW, "raw", lookup_syscall, "system call" },
+ { QUAL_RAW, "x", lookup_syscall, "system call" },
+ { QUAL_SIGNAL, "signal", lookup_signal, "signal" },
+ { QUAL_SIGNAL, "signals", lookup_signal, "signal" },
+ { QUAL_SIGNAL, "s", lookup_signal, "signal" },
+ { QUAL_FAULT, "fault", lookup_fault, "fault" },
+ { QUAL_FAULT, "faults", lookup_fault, "fault" },
+ { QUAL_FAULT, "m", lookup_fault, "fault" },
+ { QUAL_READ, "read", lookup_desc, "descriptor" },
+ { QUAL_READ, "reads", lookup_desc, "descriptor" },
+ { QUAL_READ, "r", lookup_desc, "descriptor" },
+ { QUAL_WRITE, "write", lookup_desc, "descriptor" },
+ { QUAL_WRITE, "writes", lookup_desc, "descriptor" },
+ { QUAL_WRITE, "w", lookup_desc, "descriptor" },
+ { 0, NULL, NULL, NULL },
+};
+
+static int
+lookup_syscall(s)
+char *s;
+{
+ int i;
+
+ for (i = 0; i < nsyscalls; i++) {
+ if (strcmp(s, sysent[i].sys_name) == 0)
+ return i;
+ }
+ return -1;
+}
+
+static int
+lookup_signal(s)
+char *s;
+{
+ int i;
+ char buf[32];
+
+ if (s && *s && isdigit(*s))
+ return atoi(s);
+ strcpy(buf, s);
+ s = buf;
+ for (i = 0; s[i]; i++)
+ s[i] = toupper(s[i]);
+ if (strncmp(s, "SIG", 3) == 0)
+ s += 3;
+ for (i = 0; i <= NSIG; i++) {
+ if (strcmp(s, signalent[i] + 3) == 0)
+ return i;
+ }
+ return -1;
+}
+
+static int
+lookup_fault(s)
+char *s;
+{
+ return -1;
+}
+
+static int
+lookup_desc(s)
+char *s;
+{
+ if (s && *s && isdigit(*s))
+ return atoi(s);
+ return -1;
+}
+
+static int
+lookup_class(s)
+char *s;
+{
+ if (strcmp(s, "file") == 0)
+ return TRACE_FILE;
+ if (strcmp(s, "ipc") == 0)
+ return TRACE_IPC;
+ if (strcmp(s, "network") == 0)
+ return TRACE_NETWORK;
+ if (strcmp(s, "process") == 0)
+ return TRACE_PROCESS;
+ if (strcmp(s, "signal") == 0)
+ return TRACE_SIGNAL;
+ return -1;
+}
+
+void
+qualify(s)
+char *s;
+{
+ struct qual_options *opt;
+ int not;
+ char *p;
+ int i, n;
+
+ opt = &qual_options[0];
+ for (i = 0; (p = qual_options[i].option_name); i++) {
+ n = strlen(p);
+ if (strncmp(s, p, n) == 0 && s[n] == '=') {
+ opt = &qual_options[i];
+ s += n + 1;
+ break;
+ }
+ }
+ not = 0;
+ if (*s == '!') {
+ not = 1;
+ s++;
+ }
+ if (strcmp(s, "none") == 0) {
+ not = 1 - not;
+ s = "all";
+ }
+ if (strcmp(s, "all") == 0) {
+ for (i = 0; i < MAX_QUALS; i++) {
+ if (not)
+ qual_flags[i] &= ~opt->bitflag;
+ else
+ qual_flags[i] |= opt->bitflag;
+ }
+ return;
+ }
+ for (i = 0; i < MAX_QUALS; i++) {
+ if (not)
+ qual_flags[i] |= opt->bitflag;
+ else
+ qual_flags[i] &= ~opt->bitflag;
+ }
+ for (p = strtok(s, ","); p; p = strtok(NULL, ",")) {
+ if (opt->bitflag == QUAL_TRACE && (n = lookup_class(p)) > 0) {
+ for (i = 0; i < MAX_QUALS; i++) {
+ if (sysent[i].sys_flags & n) {
+ if (not)
+ qual_flags[i] &= ~opt->bitflag;
+ else
+ qual_flags[i] |= opt->bitflag;
+ }
+ }
+ continue;
+ }
+ if ((n = (*opt->lookup)(p)) < 0) {
+ fprintf(stderr, "strace: invalid %s `%s'\n",
+ opt->argument_name, p);
+ exit(1);
+ }
+ if (not)
+ qual_flags[n] &= ~opt->bitflag;
+ else
+ qual_flags[n] |= opt->bitflag;
+ }
+ return;
+}
+
+static void
+dumpio(tcp)
+struct tcb *tcp;
+{
+ if (syserror(tcp))
+ return;
+ if (tcp->u_arg[0] < 0 || tcp->u_arg[0] >= MAX_QUALS)
+ return;
+#ifdef __arm__
+ switch (tcp->scno + __NR_SYSCALL_BASE) {
+#else
+ switch (tcp->scno) {
+#endif
+ case SYS_read:
+#ifdef SYS_recv
+ case SYS_recv:
+#endif
+#ifdef SYS_recvfrom
+ case SYS_recvfrom:
+#endif
+ if (qual_flags[tcp->u_arg[0]] & QUAL_READ)
+ dumpstr(tcp, tcp->u_arg[1], tcp->u_rval);
+ break;
+ case SYS_write:
+#ifdef SYS_send
+ case SYS_send:
+#endif
+#ifdef SYS_sendto
+ case SYS_sendto:
+#endif
+ if (qual_flags[tcp->u_arg[0]] & QUAL_WRITE)
+ dumpstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ break;
+ }
+}
+
+enum subcall_style { shift_style, deref_style, mask_style };
+
+#if !(defined(LINUX) && defined(ALPHA))
+
+const int socket_map [] = {
+ /* SYS_SOCKET */ 97,
+ /* SYS_BIND */ 104,
+ /* SYS_CONNECT */ 98,
+ /* SYS_LISTEN */ 106,
+ /* SYS_ACCEPT */ 99,
+ /* SYS_GETSOCKNAME */ 150,
+ /* SYS_GETPEERNAME */ 141,
+ /* SYS_SOCKETPAIR */ 135,
+ /* SYS_SEND */ 101,
+ /* SYS_RECV */ 102,
+ /* SYS_SENDTO */ 133,
+ /* SYS_RECVFROM */ 125,
+ /* SYS_SHUTDOWN */ 134,
+ /* SYS_SETSOCKOPT */ 105,
+ /* SYS_GETSOCKOPT */ 118,
+ /* SYS_SENDMSG */ 114,
+ /* SYS_RECVMSG */ 113
+};
+
+void
+sparc_socket_decode (struct tcb *tcp)
+{
+ volatile long addr;
+ volatile int i, n;
+
+ if (tcp->u_arg [0] < 1 || tcp->u_arg [0] > sizeof(socket_map)/sizeof(int)+1){
+ return;
+ }
+ tcp->scno = socket_map [tcp->u_arg [0]-1];
+ n = tcp->u_nargs = sysent [tcp->scno].nargs;
+ addr = tcp->u_arg [1];
+ for (i = 0; i < n; i++){
+ int arg;
+ if (umoven (tcp, addr, sizeof (arg), (void *) &arg) < 0)
+ arg = 0;
+ tcp->u_arg [i] = arg;
+ addr += sizeof (arg);
+ }
+}
+
+static void
+decode_subcall(tcp, subcall, nsubcalls, style)
+struct tcb *tcp;
+int subcall;
+int nsubcalls;
+enum subcall_style style;
+{
+ int i, addr, mask, arg;
+
+ if (tcp->u_arg[0] < 0 || tcp->u_arg[0] >= nsubcalls)
+ return;
+ switch (style) {
+ case shift_style:
+ tcp->scno = subcall + tcp->u_arg[0];
+ if (sysent[tcp->scno].nargs != -1)
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ else
+ tcp->u_nargs--;
+ for (i = 0; i < tcp->u_nargs; i++)
+ tcp->u_arg[i] = tcp->u_arg[i + 1];
+ break;
+ case deref_style:
+ tcp->scno = subcall + tcp->u_arg[0];
+ addr = tcp->u_arg[1];
+ for (i = 0; i < sysent[tcp->scno].nargs; i++) {
+ if (umove(tcp, addr, &arg) < 0)
+ arg = 0;
+ tcp->u_arg[i] = arg;
+ addr += sizeof(arg);
+ }
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ break;
+ case mask_style:
+ mask = (tcp->u_arg[0] >> 8) & 0xff;
+ tcp->u_arg[0] &= 0xff;
+ for (i = 0; mask; i++)
+ mask >>= 1;
+ tcp->scno = subcall + i;
+ if (sysent[tcp->scno].nargs != -1)
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ break;
+ }
+}
+#endif
+
+struct tcb *tcp_last = NULL;
+
+static int
+internal_syscall(tcp)
+struct tcb *tcp;
+{
+ /*
+ * We must always trace a few critical system calls in order to
+ * correctly support following forks in the presence of tracing
+ * qualifiers.
+ */
+#ifdef __arm__
+ switch (tcp->scno + __NR_SYSCALL_BASE) {
+#else
+ switch (tcp->scno) {
+#endif
+#ifdef SYS_fork
+ case SYS_fork:
+#endif
+#ifdef SYS_vfork
+ case SYS_vfork:
+#endif
+#ifdef SYS_clone
+ case SYS_clone:
+#endif
+ internal_fork(tcp);
+ break;
+
+#ifdef SYS_execv
+ case SYS_execv:
+#endif
+#ifdef SYS_execve
+ case SYS_execve:
+#endif
+ internal_exec(tcp);
+ break;
+
+#ifdef SYS_wait
+ case SYS_wait:
+#endif
+#ifdef SYS_wait4
+ case SYS_wait4:
+#endif
+#ifdef SYS_waitpid
+ case SYS_waitpid:
+#endif
+#ifdef SYS_waitsys
+ case SYS_waitsys:
+#endif
+ internal_wait(tcp);
+ break;
+
+#ifdef SYS_exit
+ case SYS_exit:
+#endif
+ internal_exit(tcp);
+ break;
+ }
+ return 0;
+}
+
+int
+trace_syscall(tcp)
+struct tcb *tcp;
+{
+ int sys_res;
+ struct timeval tv;
+ long scno = 0;
+#ifdef LINUX
+#if defined (I386)
+ long eax;
+#elif defined (POWERPC)
+ long result,flags;
+#elif defined (M68K)
+ int d0;
+#elif defined (ARM)
+ int r0;
+#elif defined (ALPHA)
+ long r0;
+ long a3;
+#elif defined (SPARC)
+ struct pt_regs regs;
+ unsigned long trap;
+#endif
+#endif /* LINUX */
+
+#ifndef SVR4
+ int pid = tcp->pid;
+#endif /* !SVR4 */
+
+ /* Measure the exit time as early as possible to avoid errors. */
+ if (dtime && (tcp->flags & TCB_INSYSCALL))
+ gettimeofday(&tv, NULL);
+#ifdef LINUX
+#if defined (POWERPC)
+ if (upeek(pid, 4*PT_R0, &scno) < 0)
+ return -1;
+ if (!(tcp->flags & TCB_INSYSCALL)) {
+ /* Check if we return from execve. */
+ if (scno == 0 && (tcp->flags & TCB_WAITEXECVE)) {
+ tcp->flags &= ~TCB_WAITEXECVE;
+ return 0;
+ }
+ }
+#elif defined (I386)
+ if (upeek(pid, 4*ORIG_EAX, &scno) < 0)
+ return -1;
+#elif defined (ARM)
+ {
+ long pc;
+ upeek(pid, 4*15, &pc);
+ umoven(tcp, pc-4, 4, (char *)&scno);
+ scno &= 0x000fffff;
+ }
+#elif defined (M68K)
+ if (upeek(pid, 4*PT_ORIG_D0, &scno) < 0)
+ return -1;
+#elif defined (ALPHA)
+ if (upeek(pid, REG_A3, &a3) < 0)
+ return -1;
+
+ if (!(tcp->flags & TCB_INSYSCALL)) {
+ if (upeek(pid, REG_R0, &scno) < 0)
+ return -1;
+
+ /* Check if we return from execve. */
+ if (scno == 0 && tcp->flags & TCB_WAITEXECVE) {
+ tcp->flags &= ~TCB_WAITEXECVE;
+ return 0;
+ }
+
+ /*
+ * Do some sanity checks to figure out if it's
+ * really a syscall entry
+ */
+ if (scno < 0 || scno > nsyscalls) {
+ if (a3 == 0 || a3 == -1) {
+ if (debug)
+ fprintf (stderr, "stray syscall exit: r0 = %ld\n", scno);
+ return 0;
+ }
+ }
+ }
+ else {
+ if (upeek(pid, REG_R0, &r0) < 0)
+ return -1;
+ }
+#elif defined (SPARC)
+ /* Everything we need is in the current register set. */
+ if (ptrace(PTRACE_GETREGS,pid,(char *)&regs,0) < 0)
+ return -1;
+
+ memmove (&regs.u_regs [1], &regs.u_regs [0],
+ sizeof (regs.u_regs) - sizeof (regs.u_regs [0]));
+
+ /* If we are entering, then disassemble the syscall trap. */
+ if (!(tcp->flags & TCB_INSYSCALL)) {
+ /* Retrieve the syscall trap instruction. */
+ errno = 0;
+ trap = ptrace(PTRACE_PEEKTEXT,pid,(char *)regs.pc,0);
+ if (errno)
+ return -1;
+
+ /* Disassemble the trap to see what personality to use. */
+ switch (trap) {
+ case 0x91d02010:
+ /* Linux/SPARC syscall trap. */
+ set_personality(0);
+ break;
+ case 0x91d02000:
+ /* SunOS syscall trap. (pers 1) */
+ fprintf(stderr,"syscall: SunOS no support\n");
+ return -1;
+ case 0x91d02008:
+ /* Solaris 2.x syscall trap. (per 2) */
+ set_personality(1);
+ break;
+ case 0x91d02009:
+ /* NetBSD/FreeBSD syscall trap. */
+ fprintf(stderr,"syscall: NetBSD/FreeBSD not supported\n");
+ return -1;
+ case 0x91d02027:
+ /* Solaris 2.x gettimeofday */
+ set_personality(1);
+ break;
+ default:
+ /* Unknown syscall trap. */
+ if(tcp->flags & TCB_WAITEXECVE) {
+ tcp->flags &= ~TCB_WAITEXECVE;
+ return 0;
+ }
+ fprintf(stderr,"syscall: unknown syscall trap %08x %08x\n", trap, regs.pc);
+ return -1;
+ }
+
+ /* Extract the system call number from the registers. */
+ if (trap == 0x91d02027)
+ scno = 156;
+ else
+ scno = regs.u_regs[UREG_G1];
+ if (scno == 0) {
+ scno = regs.u_regs[UREG_I0];
+ memmove (&regs.u_regs[UREG_I0], &regs.u_regs[UREG_I1], 7*sizeof(regs.u_regs[0]));
+ }
+ }
+#endif
+#endif /* LINUX */
+#ifdef SUNOS4
+ if (upeek(pid, uoff(u_arg[7]), &scno) < 0)
+ return -1;
+#endif
+#ifdef SVR4
+#ifdef HAVE_PR_SYSCALL
+ scno = tcp->status.pr_syscall;
+#else /* !HAVE_PR_SYSCALL */
+ scno = tcp->status.pr_what;
+#endif /* !HAVE_PR_SYSCALL */
+ if (!(tcp->flags & TCB_INSYSCALL)) {
+ if (tcp->status.pr_why != PR_SYSENTRY) {
+ if (
+ scno == SYS_fork
+#ifdef SYS_vfork
+ || scno == SYS_vfork
+#endif /* SYS_vfork */
+ ) {
+ /* We are returning in the child, fake it. */
+ tcp->status.pr_why = PR_SYSENTRY;
+ trace_syscall(tcp);
+ tcp->status.pr_why = PR_SYSEXIT;
+ }
+ else {
+ fprintf(stderr, "syscall: missing entry\n");
+ tcp->flags |= TCB_INSYSCALL;
+ }
+ }
+ }
+ else {
+ if (tcp->status.pr_why != PR_SYSEXIT) {
+ fprintf(stderr, "syscall: missing exit\n");
+ tcp->flags &= ~TCB_INSYSCALL;
+ }
+ }
+#endif /* SVR4 */
+#ifdef SUNOS4
+ if (!(tcp->flags & TCB_INSYSCALL)) {
+ if (scno == 0) {
+ fprintf(stderr, "syscall: missing entry\n");
+ tcp->flags |= TCB_INSYSCALL;
+ }
+ }
+ else {
+ if (scno != 0) {
+ if (debug) {
+ /*
+ * This happens when a signal handler
+ * for a signal which interrupted a
+ * a system call makes another system call.
+ */
+ fprintf(stderr, "syscall: missing exit\n");
+ }
+ tcp->flags &= ~TCB_INSYSCALL;
+ }
+ }
+#endif /* SUNOS4 */
+#ifdef LINUX
+#if defined (I386)
+ if (upeek(pid, 4*EAX, &eax) < 0)
+ return -1;
+ if (eax != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) {
+ if (debug)
+ fprintf(stderr, "stray syscall exit: eax = %ld\n", eax);
+ return 0;
+ }
+#elif defined (POWERPC)
+# define SO_MASK 0x10000000
+ if (upeek(pid, 4*PT_CCR, &flags) < 0)
+ return -1;
+ if (upeek(pid, 4*PT_R3, &result) < 0)
+ return -1;
+ if (flags & SO_MASK)
+ result = -result;
+#elif defined (M68K)
+ if (upeek(pid, 4*PT_D0, &d0) < 0)
+ return -1;
+ if (d0 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) {
+ if (debug)
+ fprintf(stderr, "stray syscall exit: d0 = %ld\n", d0);
+ return 0;
+ }
+#elif defined (ARM)
+ if (upeek(pid, 4*0, (long *)&r0) < 0)
+ return -1;
+ if ( 0 && r0 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) {
+ if (debug)
+ fprintf(stderr, "stray syscall exit: d0 = %ld\n", r0);
+ return 0;
+ }
+#else
+#endif
+#endif /* LINUX */
+
+ if (tcp->flags & TCB_INSYSCALL) {
+ long u_error;
+
+#ifdef LINUX
+#ifdef I386
+ if (eax < 0 && -eax < nerrnos) {
+ tcp->u_rval = -1;
+ u_error = -eax;
+ }
+ else {
+ tcp->u_rval = eax;
+ u_error = 0;
+ }
+#else /* !I386 */
+#ifdef POWERPC
+ if (result && (unsigned) -result < nerrnos) {
+ tcp->u_rval = -1;
+ u_error = -result;
+ }
+ else {
+ tcp->u_rval = result;
+ u_error = 0;
+ }
+#else /* !POWERPC */
+#ifdef M68K
+ if (d0 && (unsigned) -d0 < nerrnos) {
+ tcp->u_rval = -1;
+ u_error = -d0;
+ }
+ else {
+ tcp->u_rval = d0;
+ u_error = 0;
+ }
+#else /* !M68K */
+#ifdef ARM
+ if (r0 && (unsigned) -r0 < nerrnos) {
+ tcp->u_rval = -1;
+ u_error = -r0;
+ }
+ else {
+ tcp->u_rval = r0;
+ u_error = 0;
+ }
+#else /* !ARM */
+#ifdef ALPHA
+ if (a3) {
+ tcp->u_rval = -1;
+ u_error = r0;
+ }
+ else {
+ tcp->u_rval = r0;
+ u_error = 0;
+ }
+#else /* !ALPHA */
+#ifdef SPARC
+ if (regs.psr & PSR_C) {
+ tcp->u_rval = -1;
+ u_error = regs.u_regs[UREG_I0];
+ }
+ else {
+ tcp->u_rval = regs.u_regs[UREG_I0];
+ u_error = 0;
+ }
+#endif /* SPARC */
+#endif /* ALPHA */
+#endif /* ARM */
+#endif /* M68K */
+#endif /* POWERPC */
+#endif /* I386 */
+#endif /* LINUX */
+#ifdef SUNOS4
+ /* get error code from user struct */
+ if (upeek(pid, uoff(u_error), &u_error) < 0)
+ return -1;
+ u_error >>= 24; /* u_error is a char */
+
+ /* get system call return value */
+ if (upeek(pid, uoff(u_rval1), &tcp->u_rval) < 0)
+ return -1;
+#endif /* SUNOS4 */
+#ifdef SVR4
+#ifdef SPARC
+ /* Judicious guessing goes a long way. */
+ if (tcp->status.pr_reg[R_PSR] & 0x100000) {
+ tcp->u_rval = -1;
+ u_error = tcp->status.pr_reg[R_O0];
+ }
+ else {
+ tcp->u_rval = tcp->status.pr_reg[R_O0];
+ u_error = 0;
+ }
+#endif /* SPARC */
+#ifdef I386
+ /* Wanna know how to kill an hour single-stepping? */
+ if (tcp->status.pr_reg[EFL] & 0x1) {
+ tcp->u_rval = -1;
+ u_error = tcp->status.pr_reg[EAX];
+ }
+ else {
+ tcp->u_rval = tcp->status.pr_reg[EAX];
+ u_error = 0;
+ }
+#endif /* I386 */
+#ifdef MIPS
+ if (tcp->status.pr_reg[CTX_A3]) {
+ tcp->u_rval = -1;
+ u_error = tcp->status.pr_reg[CTX_V0];
+ }
+ else {
+ tcp->u_rval = tcp->status.pr_reg[CTX_V0];
+ u_error = 0;
+ }
+#endif /* MIPS */
+#endif /* SVR4 */
+ tcp->u_error = u_error;
+
+ internal_syscall(tcp);
+ if (!(qual_flags[tcp->scno] & QUAL_TRACE)) {
+ tcp->flags &= ~TCB_INSYSCALL;
+ return 0;
+ }
+
+ if (tcp->flags & TCB_REPRINT) {
+ printleader(tcp);
+ tprintf("<... ");
+ if (tcp->scno >= nsyscalls)
+ tprintf("syscall_%lu", tcp->scno);
+ else
+ tprintf("%s", sysent[tcp->scno].sys_name);
+ tprintf(" resumed> ");
+ }
+
+ if (cflag) {
+ call_count[tcp->scno]++;
+ if (u_error)
+ error_count[tcp->scno]++;
+ tv_sub(&tv, &tv, &tcp->etime);
+#ifdef LINUX
+ if (tv_cmp(&tv, &tcp->dtime) > 0) {
+ static struct timeval one_tick =
+ { 0, 1000000 / HZ };
+
+ if (tv_nz(&tcp->dtime))
+ tv = tcp->dtime;
+ else if (tv_cmp(&tv, &one_tick) > 0) {
+ if (tv_cmp(&shortest, &one_tick) < 0)
+ tv = shortest;
+ else
+ tv = one_tick;
+ }
+ }
+#endif /* LINUX */
+ if (tv_cmp(&tv, &shortest) < 0)
+ shortest = tv;
+ tv_add(&tv_count[tcp->scno],
+ &tv_count[tcp->scno], &tv);
+ tcp->flags &= ~TCB_INSYSCALL;
+ return 0;
+ }
+
+ if (tcp->scno >= nsyscalls
+ || (qual_flags[tcp->scno] & QUAL_RAW))
+ sys_res = printargs(tcp);
+ else
+ sys_res = (*sysent[tcp->scno].sys_func)(tcp);
+ u_error = tcp->u_error;
+ tprintf(") ");
+ tabto(acolumn);
+ if (qual_flags[tcp->scno] & QUAL_RAW) {
+ if (u_error)
+ tprintf("= -1 (errno %ld)", u_error);
+ else
+ tprintf("= %#lx", tcp->u_rval);
+ }
+ else if (!(sys_res & RVAL_NONE) && u_error) {
+#ifdef LINUX
+ switch (u_error) {
+ case ERESTARTSYS:
+ tprintf("= ? ERESTARTSYS (To be restarted)");
+ break;
+ case ERESTARTNOINTR:
+ tprintf("= ? ERESTARTNOINTR (To be restarted)");
+ break;
+ case ERESTARTNOHAND:
+ tprintf("= ? ERESTARTNOHAND (To be restarted)");
+ break;
+ default:
+#endif /* LINUX */
+ tprintf("= -1 ");
+ if (u_error < nerrnos && u_error < sys_nerr)
+ tprintf("%s (%s)", errnoent[u_error],
+ sys_errlist[u_error]);
+ else if (u_error < nerrnos)
+ tprintf("%s (errno %ld)",
+ errnoent[u_error], u_error);
+ else if (u_error < sys_nerr)
+ tprintf("ERRNO_%ld (%s)", u_error,
+ sys_errlist[u_error]);
+ else
+ tprintf("E??? (errno %ld)", u_error);
+#ifdef LINUX
+ break;
+ }
+#endif /* LINUX */
+ }
+ else {
+ if (sys_res & RVAL_NONE)
+ tprintf("= ?");
+ else {
+ switch (sys_res & RVAL_MASK) {
+ case RVAL_HEX:
+ tprintf("= %#lx", tcp->u_rval);
+ break;
+ case RVAL_OCTAL:
+ tprintf("= %#lo", tcp->u_rval);
+ break;
+ case RVAL_UDECIMAL:
+ tprintf("= %lu", tcp->u_rval);
+ break;
+ case RVAL_DECIMAL:
+ tprintf("= %ld", tcp->u_rval);
+ break;
+ default:
+ fprintf(stderr,
+ "invalid rval format\n");
+ break;
+ }
+ }
+ if ((sys_res & RVAL_STR) && tcp->auxstr)
+ tprintf(" (%s)", tcp->auxstr);
+ }
+ if (dtime) {
+ tv_sub(&tv, &tv, &tcp->etime);
+ tprintf(" <%ld.%06ld>",
+ (long) tv.tv_sec, (long) tv.tv_usec);
+ }
+ printtrailer(tcp);
+
+ dumpio(tcp);
+ if (fflush(tcp->outf) == EOF)
+ return -1;
+ tcp->flags &= ~TCB_INSYSCALL;
+ return 0;
+ }
+
+ /* Entering system call */
+ tcp->scno = scno;
+#ifdef LINUX
+#if defined (ALPHA)
+ {
+ int i;
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ for (i = 0; i < tcp->u_nargs; i++) {
+ if (upeek(pid, REG_A0+i, &tcp->u_arg[i]) < 0)
+ return -1;
+ }
+ }
+#elif defined (POWERPC)
+ {
+ int i;
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ for (i = 0; i < tcp->u_nargs; i++) {
+ if (upeek(pid, (i==0) ? (4*PT_ORIG_R3) : ((i+PT_R3)*4), &tcp->u_arg[i]) < 0)
+ return -1;
+ }
+ }
+#elif defined (SPARC)
+ {
+ int i, offset;
+
+ offset = UREG_I0;
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ for (i = 0; i < tcp->u_nargs; i++)
+ tcp->u_arg[i] = regs.u_regs[offset + i];
+ }
+#else
+ {
+ int i;
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ for (i = 0; i < tcp->u_nargs; i++) {
+ if (upeek(pid, i*4, &tcp->u_arg[i]) < 0)
+ return -1;
+ }
+ }
+#endif
+#endif /* LINUX */
+#ifdef SUNOS4
+ {
+ int i;
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ for (i = 0; i < tcp->u_nargs; i++) {
+ struct user *u;
+
+ if (upeek(pid, uoff(u_arg[0]) +
+ (i*sizeof(u->u_arg[0])), &tcp->u_arg[i]) < 0)
+ return -1;
+ }
+ }
+#endif /* SUNOS4 */
+#ifdef SVR4
+#ifdef MIPS
+ /*
+ * SGI is broken: even though it has pr_sysarg, it doesn't
+ * set them on system call entry. Get a clue.
+ */
+ if (sysent[tcp->scno].nargs != -1)
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ else
+ tcp->u_nargs = tcp->status.pr_nsysarg;
+ if (tcp->u_nargs > 4) {
+ memcpy(tcp->u_arg, &tcp->status.pr_reg[CTX_A0],
+ 4*sizeof(tcp->u_arg[0]));
+ umoven(tcp, tcp->status.pr_reg[CTX_SP] + 16,
+ (tcp->u_nargs - 4)*sizeof(tcp->u_arg[0]), (char *) (tcp->u_arg + 4));
+ }
+ else {
+ memcpy(tcp->u_arg, &tcp->status.pr_reg[CTX_A0],
+ tcp->u_nargs*sizeof(tcp->u_arg[0]));
+ }
+#else /* !MIPS */
+#ifdef HAVE_PR_SYSCALL
+ if (sysent[tcp->scno].nargs != -1)
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ else
+ tcp->u_nargs = tcp->status.pr_nsysarg;
+ {
+ int i;
+ for (i = 0; i < tcp->u_nargs; i++)
+ tcp->u_arg[i] = tcp->status.pr_sysarg[i];
+ }
+#else /* !HAVE_PR_SYSCALL */
+#ifdef I386
+ if (sysent[tcp->scno].nargs != -1)
+ tcp->u_nargs = sysent[tcp->scno].nargs;
+ else
+ tcp->u_nargs = 5;
+ umoven(tcp, tcp->status.pr_reg[UESP] + 4,
+ tcp->u_nargs*sizeof(tcp->u_arg[0]), (char *) tcp->u_arg);
+#endif /* I386 */
+#endif /* !HAVE_PR_SYSCALL */
+#endif /* !MIPS */
+#endif /* SVR4 */
+#ifdef __arm__
+ switch (tcp->scno + __NR_SYSCALL_BASE) {
+#else
+ switch (tcp->scno) {
+#endif
+#ifdef LINUX
+#if !defined (ALPHA) && !defined(SPARC)
+ case SYS_socketcall:
+ decode_subcall(tcp, SYS_socket_subcall,
+ SYS_socket_nsubcalls, deref_style);
+ break;
+ case SYS_ipc:
+ decode_subcall(tcp, SYS_ipc_subcall,
+ SYS_ipc_nsubcalls, shift_style);
+ break;
+#endif /* !ALPHA && !SPARC */
+#ifdef SPARC
+ case SYS_socketcall:
+ sparc_socket_decode (tcp);
+ break;
+#endif
+#endif /* LINUX */
+#ifdef SVR4
+#ifdef SYS_pgrpsys_subcall
+ case SYS_pgrpsys:
+ decode_subcall(tcp, SYS_pgrpsys_subcall,
+ SYS_pgrpsys_nsubcalls, shift_style);
+ break;
+#endif /* SYS_pgrpsys_subcall */
+#ifdef SYS_sigcall_subcall
+ case SYS_sigcall:
+ decode_subcall(tcp, SYS_sigcall_subcall,
+ SYS_sigcall_nsubcalls, mask_style);
+ break;
+#endif /* SYS_sigcall_subcall */
+ case SYS_msgsys:
+ decode_subcall(tcp, SYS_msgsys_subcall,
+ SYS_msgsys_nsubcalls, shift_style);
+ break;
+ case SYS_shmsys:
+ decode_subcall(tcp, SYS_shmsys_subcall,
+ SYS_shmsys_nsubcalls, shift_style);
+ break;
+ case SYS_semsys:
+ decode_subcall(tcp, SYS_semsys_subcall,
+ SYS_semsys_nsubcalls, shift_style);
+ break;
+#if 0 /* broken */
+ case SYS_utssys:
+ decode_subcall(tcp, SYS_utssys_subcall,
+ SYS_utssys_nsubcalls, shift_style);
+ break;
+#endif
+ case SYS_sysfs:
+ decode_subcall(tcp, SYS_sysfs_subcall,
+ SYS_sysfs_nsubcalls, shift_style);
+ break;
+ case SYS_spcall:
+ decode_subcall(tcp, SYS_spcall_subcall,
+ SYS_spcall_nsubcalls, shift_style);
+ break;
+#ifdef SYS_context_subcall
+ case SYS_context:
+ decode_subcall(tcp, SYS_context_subcall,
+ SYS_context_nsubcalls, shift_style);
+ break;
+#endif /* SYS_context_subcall */
+#endif /* SVR4 */
+#ifdef SUNOS4
+ case SYS_semsys:
+ decode_subcall(tcp, SYS_semsys_subcall,
+ SYS_semsys_nsubcalls, shift_style);
+ break;
+ case SYS_msgsys:
+ decode_subcall(tcp, SYS_msgsys_subcall,
+ SYS_msgsys_nsubcalls, shift_style);
+ break;
+ case SYS_shmsys:
+ decode_subcall(tcp, SYS_shmsys_subcall,
+ SYS_shmsys_nsubcalls, shift_style);
+ break;
+#endif
+ }
+
+ internal_syscall(tcp);
+ if (!(qual_flags[tcp->scno] & QUAL_TRACE)) {
+ tcp->flags |= TCB_INSYSCALL;
+ return 0;
+ }
+
+ if (cflag) {
+ gettimeofday(&tcp->etime, NULL);
+ tcp->flags |= TCB_INSYSCALL;
+ return 0;
+ }
+
+ printleader(tcp);
+ tcp->flags &= ~TCB_REPRINT;
+ tcp_last = tcp;
+ if (tcp->scno >= nsyscalls)
+ tprintf("syscall_%lu(", tcp->scno);
+ else
+ tprintf("%s(", sysent[tcp->scno].sys_name);
+ if (tcp->scno >= nsyscalls ||
+ ((qual_flags[tcp->scno] & QUAL_RAW) && tcp->scno != SYS_exit))
+ sys_res = printargs(tcp);
+ else
+ sys_res = (*sysent[tcp->scno].sys_func)(tcp);
+ if (fflush(tcp->outf) == EOF)
+ return -1;
+ tcp->flags |= TCB_INSYSCALL;
+ /* Measure the entrance time as late as possible to avoid errors. */
+ if (dtime)
+ gettimeofday(&tcp->etime, NULL);
+ return sys_res;
+}
+
+int
+printargs(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ int i;
+
+ for (i = 0; i < tcp->u_nargs; i++)
+ tprintf("%s%#lx", i ? ", " : "", tcp->u_arg[i]);
+ }
+ return 0;
+}
+
+long
+getrval2(tcp)
+struct tcb *tcp;
+{
+ long val = -1;
+
+#ifdef LINUX
+#ifdef SPARC
+ struct pt_regs regs;
+ if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0)
+ return -1;
+ val = regs.u_regs[UREG_I1];
+#endif /* SPARC */
+#endif /* LINUX */
+
+#ifdef SUNOS4
+ if (upeek(tcp->pid, uoff(u_rval2), &val) < 0)
+ return -1;
+#endif /* SUNOS4 */
+
+#ifdef SVR4
+#ifdef SPARC
+ val = tcp->status.pr_reg[R_O1];
+#endif /* SPARC */
+#ifdef I386
+ val = tcp->status.pr_reg[EDX];
+#endif /* I386 */
+#ifdef MIPS
+ val = tcp->status.pr_reg[CTX_V1];
+#endif /* MIPS */
+#endif /* SVR4 */
+
+ return val;
+}
+
+/*
+ * Apparently, indirect system calls have already be converted by ptrace(2),
+ * so if you see "indir" this program has gone astray.
+ */
+int
+sys_indir(tcp)
+struct tcb *tcp;
+{
+ int i, scno, nargs;
+
+ if (entering(tcp)) {
+ if ((scno = tcp->u_arg[0]) > nsyscalls) {
+ fprintf(stderr, "Bogus syscall: %u\n", scno);
+ return 0;
+ }
+ nargs = sysent[scno].nargs;
+ tprintf("%s", sysent[scno].sys_name);
+ for (i = 0; i < nargs; i++)
+ tprintf(", %#lx", tcp->u_arg[i+1]);
+ }
+ return 0;
+}
+
+static int
+time_cmp(a, b)
+void *a;
+void *b;
+{
+ return -tv_cmp(&tv_count[*((int *) a)], &tv_count[*((int *) b)]);
+}
+
+static int
+syscall_cmp(a, b)
+void *a;
+void *b;
+{
+ return strcmp(sysent[*((int *) a)].sys_name,
+ sysent[*((int *) b)].sys_name);
+}
+
+static int
+count_cmp(a, b)
+void *a;
+void *b;
+{
+ int m = call_count[*((int *) a)], n = call_count[*((int *) b)];
+
+ return (m < n) ? 1 : (m > n) ? -1 : 0;
+}
+
+static int (*sortfun)();
+static struct timeval overhead = { -1, -1 };
+
+void
+set_sortby(sortby)
+char *sortby;
+{
+ if (strcmp(sortby, "time") == 0)
+ sortfun = time_cmp;
+ else if (strcmp(sortby, "calls") == 0)
+ sortfun = count_cmp;
+ else if (strcmp(sortby, "name") == 0)
+ sortfun = syscall_cmp;
+ else if (strcmp(sortby, "nothing") == 0)
+ sortfun = NULL;
+ else {
+ fprintf(stderr, "invalid sortby: `%s'\n", sortby);
+ exit(1);
+ }
+}
+
+void set_overhead(n)
+int n;
+{
+ overhead.tv_sec = n / 1000000;
+ overhead.tv_usec = n % 1000000;
+}
+
+void
+call_summary(outf)
+FILE *outf;
+{
+ int i, j;
+ int call_cum, error_cum;
+ struct timeval tv_cum, dtv;
+ double percent;
+ char *dashes = "-------------------------";
+ char error_str[16];
+
+ call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0;
+ if (overhead.tv_sec == -1) {
+ tv_mul(&overhead, &shortest, 8);
+ tv_div(&overhead, &overhead, 10);
+ }
+ for (i = 0; i < nsyscalls; i++) {
+ sorted_count[i] = i;
+ if (call_count[i] == 0)
+ continue;
+ tv_mul(&dtv, &overhead, call_count[i]);
+ tv_sub(&tv_count[i], &tv_count[i], &dtv);
+ call_cum += call_count[i];
+ error_cum += error_count[i];
+ tv_add(&tv_cum, &tv_cum, &tv_count[i]);
+ }
+ if (sortfun)
+ qsort((void *) sorted_count, nsyscalls, sizeof(int), sortfun);
+ fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
+ "% time", "seconds", "usecs/call",
+ "calls", "errors", "syscall");
+ fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %-16.16s\n",
+ dashes, dashes, dashes, dashes, dashes, dashes);
+ for (i = 0; i < nsyscalls; i++) {
+ j = sorted_count[i];
+ if (call_count[j] == 0)
+ continue;
+ tv_div(&dtv, &tv_count[j], call_count[j]);
+ if (error_count[j])
+ sprintf(error_str, "%d", error_count[j]);
+ else
+ error_str[0] = '\0';
+ percent = 100.0*tv_float(&tv_count[j])/tv_float(&tv_cum);
+ fprintf(outf, "%6.2f %4ld.%06ld %11ld %9d %9.9s %s\n",
+ percent, (long) tv_count[j].tv_sec,
+ (long) tv_count[j].tv_usec,
+ (long) 1000000 * dtv.tv_sec + dtv.tv_usec,
+ call_count[j], error_str, sysent[j].sys_name);
+ }
+ fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %-16.16s\n",
+ dashes, dashes, dashes, dashes, dashes, dashes);
+ if (error_cum)
+ sprintf(error_str, "%d", error_cum);
+ else
+ error_str[0] = '\0';
+ fprintf(outf, "%6.6s %4ld.%06ld %11.11s %9d %9.9s %s\n",
+ "100.00", (long) tv_cum.tv_sec, (long) tv_cum.tv_usec, "",
+ call_cum, error_str, "total");
+}
diff --git a/syscallent.sh b/syscallent.sh
new file mode 100644
index 000000000..e230bc24a
--- /dev/null
+++ b/syscallent.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+
+cat $* |
+ sed -n 's/^#[ ]*define[ ][ ]*SYS_\([^ ]*\)[ ]*[^0-9]*\([0-9]*\).*$/\1 \2/p' |
+ sort +1n |
+ awk '
+ BEGIN {
+ tabs = "\t\t\t\t\t\t\t\t"
+ call = -1;
+ }
+ {
+ while (++call < $2) {
+ f = "printargs"
+ n = "SYS_" call
+ s = "\t{ -1,\t0,\t"
+ s = s f ","
+ s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
+ s = s "\"" n "\""
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
+ s = s "}, /* " call " */"
+ print s
+ }
+ f = "sys_" $1
+ n = $1
+ s = "\t{ -1,\t0,\t"
+ s = s f ","
+ s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
+ s = s "\"" n "\""
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
+ s = s "}, /* " call " */"
+ print s
+ }
+ END {
+ limit = call + 100
+ while (++call < limit) {
+ f = "printargs"
+ n = "SYS_" call
+ s = "\t{ -1,\t0,\t"
+ s = s f ","
+ s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
+ s = s "\"" n "\""
+ s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
+ s = s "}, /* " call " */"
+ print s
+ }
+ }
+ '
diff --git a/system.c b/system.c
new file mode 100644
index 000000000..16c1648c3
--- /dev/null
+++ b/system.c
@@ -0,0 +1,886 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#ifdef LINUX
+#define _LINUX_SOCKET_H
+
+#define MS_RDONLY 1 /* Mount read-only */
+#define MS_NOSUID 2 /* Ignore suid and sgid bits */
+#define MS_NODEV 4 /* Disallow access to device special files */
+#define MS_NOEXEC 8 /* Disallow program execution */
+#define MS_SYNCHRONOUS 16 /* Writes are synced at once */
+#define MS_REMOUNT 32 /* Alter flags of a mounted FS */
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#ifdef LINUX
+/* Workaround for kernel namespace pollution. */
+#define sys_personality kernel_sys_personality
+#include <linux/personality.h>
+#undef sys_personality
+#endif /* __NR_personality */
+
+#ifdef __NR_capget
+#include <linux/capability.h>
+#endif
+
+static struct xlat mount_flags[] = {
+ { MS_RDONLY, "MS_RDONLY" },
+ { MS_NOSUID, "MS_NOSUID" },
+ { MS_NODEV, "MS_NODEV" },
+ { MS_NOEXEC, "MS_NOEXEC" },
+#ifdef MS_SYNCHRONOUS
+ { MS_SYNCHRONOUS,"MS_SYNCHRONOUS"},
+#else
+ { MS_SYNC, "MS_SYNC" },
+#endif
+ { MS_REMOUNT, "MS_REMOUNT" },
+ { 0, NULL },
+};
+
+int
+sys_mount(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[2]);
+ tprintf(", ");
+ printflags(mount_flags, tcp->u_arg[3]);
+ tprintf(", %#lx", tcp->u_arg[4]);
+ }
+ return 0;
+}
+
+static struct xlat personality_options[] = {
+#ifdef PER_LINUX
+ { PER_LINUX, "PER_LINUX" },
+#endif
+#ifdef PER_LINUX_32BIT
+ { PER_LINUX_32BIT, "PER_LINUX" },
+#endif
+#ifdef PER_SVR4
+ { PER_SVR4, "PER_SVR4" },
+#endif
+#ifdef PER_SVR3
+ { PER_SVR3, "PER_SVR3" },
+#endif
+#ifdef PER_SCOSVR3
+ { PER_SCOSVR3, "PER_SCOSVR3" },
+#endif
+#ifdef PER_WYSEV386
+ { PER_WYSEV386, "PER_WYSEV386" },
+#endif
+#ifdef PER_ISCR4
+ { PER_ISCR4, "PER_ISCR4" },
+#endif
+#ifdef PER_BSD
+ { PER_BSD, "PER_BSD" },
+#endif
+#ifdef PER_XENIX
+ { PER_XENIX, "PER_XENIX" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_personality(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ printxval(personality_options, tcp->u_arg[0], "PER_???");
+ return 0;
+}
+
+#endif /* LINUX */
+
+#ifdef SUNOS4
+
+#include <sys/reboot.h>
+#define NFSCLIENT
+#define LOFS
+#define RFS
+#define PCFS
+#include <sys/mount.h>
+#include <sys/socket.h>
+#include <nfs/export.h>
+#include <rpc/types.h>
+#include <rpc/auth.h>
+
+/*ARGSUSED*/
+int
+sys_sync(tcp)
+struct tcb *tcp;
+{
+ return 0;
+}
+
+static struct xlat bootflags[] = {
+ { RB_AUTOBOOT, "RB_AUTOBOOT" }, /* for system auto-booting itself */
+ { RB_ASKNAME, "RB_ASKNAME" }, /* ask for file name to reboot from */
+ { RB_SINGLE, "RB_SINGLE" }, /* reboot to single user only */
+ { RB_NOSYNC, "RB_NOSYNC" }, /* dont sync before reboot */
+ { RB_HALT, "RB_HALT" }, /* don't reboot, just halt */
+ { RB_INITNAME, "RB_INITNAME" }, /* name given for /etc/init */
+ { RB_NOBOOTRC, "RB_NOBOOTRC" }, /* don't run /etc/rc.boot */
+ { RB_DEBUG, "RB_DEBUG" }, /* being run under debugger */
+ { RB_DUMP, "RB_DUMP" }, /* dump system core */
+ { RB_WRITABLE, "RB_WRITABLE" }, /* mount root read/write */
+ { RB_STRING, "RB_STRING" }, /* pass boot args to prom monitor */
+ { 0, NULL },
+};
+
+int
+sys_reboot(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ if (!printflags(bootflags, tcp->u_arg[0]))
+ tprintf("RB_???");
+ if (tcp->u_arg[0] & RB_STRING) {
+ printstr(tcp, tcp->u_arg[1], -1);
+ }
+ }
+ return 0;
+}
+
+int
+sys_sysacct(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ }
+ return 0;
+}
+
+int
+sys_swapon(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ }
+ return 0;
+}
+
+int
+sys_nfs_svc(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printsock(tcp, tcp->u_arg[0]);
+ }
+ return 0;
+}
+
+static struct xlat mountflags[] = {
+ { M_RDONLY, "M_RDONLY" },
+ { M_NOSUID, "M_NOSUID" },
+ { M_NEWTYPE, "M_NEWTYPE" },
+ { M_GRPID, "M_GRPID" },
+#ifdef M_REMOUNT
+ { M_REMOUNT, "M_REMOUNT" },
+#endif
+#ifdef M_NOSUB
+ { M_NOSUB, "M_NOSUB" },
+#endif
+#ifdef M_MULTI
+ { M_MULTI, "M_MULTI" },
+#endif
+#ifdef M_SYS5
+ { M_SYS5, "M_SYS5" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat nfsflags[] = {
+ { NFSMNT_SOFT, "NFSMNT_SOFT" },
+ { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
+ { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
+ { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
+ { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
+ { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
+ { NFSMNT_INT, "NFSMNT_INT" },
+ { NFSMNT_NOAC, "NFSMNT_NOAC" },
+ { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
+ { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
+ { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
+ { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
+#ifdef NFSMNT_SECURE
+ { NFSMNT_SECURE, "NFSMNT_SECURE" },
+#endif
+#ifdef NFSMNT_NOCTO
+ { NFSMNT_NOCTO, "NFSMNT_NOCTO" },
+#endif
+#ifdef NFSMNT_POSIX
+ { NFSMNT_POSIX, "NFSMNT_POSIX" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_mount(tcp)
+struct tcb *tcp;
+{
+ char type[4];
+
+ if (entering(tcp)) {
+ if (!(tcp->u_arg[2] & M_NEWTYPE) || umovestr(tcp,
+ tcp->u_arg[0], sizeof type, type) < 0) {
+ tprintf("OLDTYPE:#%lx", tcp->u_arg[0]);
+ } else {
+ tprintf("\"%s\", ", type);
+ }
+ printstr(tcp, tcp->u_arg[1], -1);
+ tprintf(", ");
+ if (!printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE))
+ tprintf("0");
+ tprintf(", ");
+
+ if (strcmp(type, "4.2") == 0) {
+ struct ufs_args a;
+ if (umove(tcp, tcp->u_arg[3], &a) < 0)
+ return 0;
+ printstr(tcp, (int)a.fspec, -1);
+ } else if (strcmp(type, "lo") == 0) {
+ struct lo_args a;
+ if (umove(tcp, tcp->u_arg[3], &a) < 0)
+ return 0;
+ printstr(tcp, (int)a.fsdir, -1);
+ } else if (strcmp(type, "nfs") == 0) {
+ struct nfs_args a;
+ if (umove(tcp, tcp->u_arg[3], &a) < 0)
+ return 0;
+ tprintf("[");
+ printsock(tcp, (int) a.addr);
+ tprintf(", ");
+ if (!printflags(nfsflags, a.flags))
+ tprintf("NFSMNT_???");
+ tprintf(", ws:%u,rs:%u,to:%u,re:%u,",
+ a.wsize, a.rsize, a.timeo, a.retrans);
+ if (a.flags & NFSMNT_HOSTNAME && a.hostname)
+ printstr(tcp, (int)a.hostname, -1);
+ else
+ tprintf("%#lx", (unsigned long) a.hostname);
+ tprintf(",reg-min:%u,max:%u,dir-min:%u,max:%u,",
+ a.acregmin, a.acregmax, a.acdirmin, a.acdirmax);
+ if ((a.flags & NFSMNT_SECURE) && a.netname)
+ printstr(tcp, (int) a.netname, -1);
+ else
+ tprintf("%#lx", (unsigned long) a.netname);
+ tprintf("]");
+ } else if (strcmp(type, "rfs") == 0) {
+ struct rfs_args a;
+ struct token t;
+ if (umove(tcp, tcp->u_arg[3], &a) < 0)
+ return 0;
+ tprintf("[");
+ printstr(tcp, (int)a.rmtfs, -1);
+ if (umove(tcp, (int)a.token, &t) < 0)
+ return 0;
+ tprintf(", %u, %s]", t.t_id, t.t_uname);
+ } else if (strcmp(type, "pcfs") == 0) {
+ struct pc_args a;
+ if (umove(tcp, tcp->u_arg[3], &a) < 0)
+ return 0;
+ printstr(tcp, (int)a.fspec, -1);
+ }
+ }
+ return 0;
+}
+
+int
+sys_unmount(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ }
+ return 0;
+}
+
+int
+sys_umount(tcp)
+struct tcb *tcp;
+{
+ return sys_unmount(tcp);
+}
+
+int
+sys_auditsys(tcp)
+struct tcb *tcp;
+{
+ /* XXX - no information available */
+ return printargs(tcp);
+}
+
+static struct xlat ex_auth_flags[] = {
+ { AUTH_UNIX, "AUTH_UNIX" },
+ { AUTH_DES, "AUTH_DES" },
+ { 0, NULL },
+};
+
+int
+sys_exportfs(tcp)
+struct tcb *tcp;
+{
+ struct export e;
+ int i;
+
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ if (umove(tcp, tcp->u_arg[1], &e) < 0) {
+ tprintf("%#lx", tcp->u_arg[1]);
+ return 0;
+ }
+ tprintf("{fl:%u, anon:%u, ", e.ex_flags, e.ex_anon);
+ printxval(ex_auth_flags, e.ex_auth, "AUTH_???");
+ tprintf(", roots:[");
+ if (e.ex_auth == AUTH_UNIX) {
+ for (i=0; i<e.ex_u.exunix.rootaddrs.naddrs; i++) {
+ printsock(tcp,
+ (int)&e.ex_u.exunix.rootaddrs.addrvec[i]);
+ }
+ tprintf("], writers:[");
+ for (i=0; i<e.ex_writeaddrs.naddrs; i++) {
+ printsock(tcp,
+ (int)&e.ex_writeaddrs.addrvec[i]);
+ }
+ tprintf("]");
+ } else {
+ for (i=0; i<e.ex_u.exdes.nnames; i++) {
+ printsock(tcp,
+ (int)&e.ex_u.exdes.rootnames[i]);
+ tprintf(", ");
+ }
+ tprintf("], window:%u", e.ex_u.exdes.window);
+ }
+ tprintf("}");
+ }
+ return 0;
+}
+
+static struct xlat sysconflimits[] = {
+#ifdef _SC_ARG_MAX
+ { _SC_ARG_MAX, "_SC_ARG_MAX" }, /* space for argv & envp */
+#endif
+#ifdef _SC_CHILD_MAX
+ { _SC_CHILD_MAX, "_SC_CHILD_MAX" }, /* maximum children per process??? */
+#endif
+#ifdef _SC_CLK_TCK
+ { _SC_CLK_TCK, "_SC_CLK_TCK" }, /* clock ticks/sec */
+#endif
+#ifdef _SC_NGROUPS_MAX
+ { _SC_NGROUPS_MAX, "_SC_NGROUPS_MAX" }, /* number of groups if multple supp. */
+#endif
+#ifdef _SC_OPEN_MAX
+ { _SC_OPEN_MAX, "_SC_OPEN_MAX" }, /* max open files per process */
+#endif
+#ifdef _SC_JOB_CONTROL
+ { _SC_JOB_CONTROL, "_SC_JOB_CONTROL" }, /* do we have job control */
+#endif
+#ifdef _SC_SAVED_IDS
+ { _SC_SAVED_IDS, "_SC_SAVED_IDS" }, /* do we have saved uid/gids */
+#endif
+#ifdef _SC_VERSION
+ { _SC_VERSION, "_SC_VERSION" }, /* POSIX version supported */
+#endif
+ { 0, NULL },
+};
+
+static struct xlat pathconflimits[] = {
+#ifdef _PC_LINK_MAX
+ { _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
+#endif
+#ifdef _PC_MAX_CANON
+ { _PC_MAX_CANON, "_PC_MAX_CANON" }, /* max line length */
+#endif
+#ifdef _PC_MAX_INPUT
+ { _PC_MAX_INPUT, "_PC_MAX_INPUT" }, /* max "packet" to a tty device */
+#endif
+#ifdef _PC_NAME_MAX
+ { _PC_NAME_MAX, "_PC_NAME_MAX" }, /* max pathname component length */
+#endif
+#ifdef _PC_PATH_MAX
+ { _PC_PATH_MAX, "_PC_PATH_MAX" }, /* max pathname length */
+#endif
+#ifdef _PC_PIPE_BUF
+ { _PC_PIPE_BUF, "_PC_PIPE_BUF" }, /* size of a pipe */
+#endif
+#ifdef _PC_CHOWN_RESTRICTED
+ { _PC_CHOWN_RESTRICTED, "_PC_CHOWN_RESTRICTED" }, /* can we give away files */
+#endif
+#ifdef _PC_NO_TRUNC
+ { _PC_NO_TRUNC, "_PC_NO_TRUNC" }, /* trunc or error on >NAME_MAX */
+#endif
+#ifdef _PC_VDISABLE
+ { _PC_VDISABLE, "_PC_VDISABLE" }, /* best char to shut off tty c_cc */
+#endif
+ { 0, NULL },
+};
+
+int
+sys_sysconf(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(sysconflimits, tcp->u_arg[0], "_SC_???");
+ }
+ return 0;
+}
+
+int
+sys_pathconf(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printstr(tcp, tcp->u_arg[0], -1);
+ tprintf(", ");
+ printxval(pathconflimits, tcp->u_arg[1], "_SC_???");
+ }
+ return 0;
+}
+
+int
+sys_fpathconf(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ tprintf("%lu, ", tcp->u_arg[0]);
+ printxval(pathconflimits, tcp->u_arg[1], "_SC_???");
+ }
+ return 0;
+}
+
+#endif /* SUNOS4 */
+
+#ifdef SVR4
+
+#ifdef HAVE_SYS_SYSCONFIG_H
+#include <sys/sysconfig.h>
+#endif /* HAVE_SYS_SYSCONFIG_H */
+
+#include <sys/mount.h>
+#include <sys/systeminfo.h>
+#include <sys/utsname.h>
+
+static struct xlat sysconfig_options[] = {
+#ifdef _CONFIG_NGROUPS
+ { _CONFIG_NGROUPS, "_CONFIG_NGROUPS" },
+#endif
+#ifdef _CONFIG_CHILD_MAX
+ { _CONFIG_CHILD_MAX, "_CONFIG_CHILD_MAX" },
+#endif
+#ifdef _CONFIG_OPEN_FILES
+ { _CONFIG_OPEN_FILES, "_CONFIG_OPEN_FILES" },
+#endif
+#ifdef _CONFIG_POSIX_VER
+ { _CONFIG_POSIX_VER, "_CONFIG_POSIX_VER" },
+#endif
+#ifdef _CONFIG_PAGESIZE
+ { _CONFIG_PAGESIZE, "_CONFIG_PAGESIZE" },
+#endif
+#ifdef _CONFIG_CLK_TCK
+ { _CONFIG_CLK_TCK, "_CONFIG_CLK_TCK" },
+#endif
+#ifdef _CONFIG_XOPEN_VER
+ { _CONFIG_XOPEN_VER, "_CONFIG_XOPEN_VER" },
+#endif
+#ifdef _CONFIG_PROF_TCK
+ { _CONFIG_PROF_TCK, "_CONFIG_PROF_TCK" },
+#endif
+#ifdef _CONFIG_NPROC_CONF
+ { _CONFIG_NPROC_CONF, "_CONFIG_NPROC_CONF" },
+#endif
+#ifdef _CONFIG_NPROC_ONLN
+ { _CONFIG_NPROC_ONLN, "_CONFIG_NPROC_ONLN" },
+#endif
+#ifdef _CONFIG_AIO_LISTIO_MAX
+ { _CONFIG_AIO_LISTIO_MAX, "_CONFIG_AIO_LISTIO_MAX" },
+#endif
+#ifdef _CONFIG_AIO_MAX
+ { _CONFIG_AIO_MAX, "_CONFIG_AIO_MAX" },
+#endif
+#ifdef _CONFIG_AIO_PRIO_DELTA_MAX
+ { _CONFIG_AIO_PRIO_DELTA_MAX, "_CONFIG_AIO_PRIO_DELTA_MAX" },
+#endif
+#ifdef _CONFIG_CONFIG_DELAYTIMER_MAX
+ { _CONFIG_DELAYTIMER_MAX, "_CONFIG_DELAYTIMER_MAX" },
+#endif
+#ifdef _CONFIG_MQ_OPEN_MAX
+ { _CONFIG_MQ_OPEN_MAX, "_CONFIG_MQ_OPEN_MAX" },
+#endif
+#ifdef _CONFIG_MQ_PRIO_MAX
+ { _CONFIG_MQ_PRIO_MAX, "_CONFIG_MQ_PRIO_MAX" },
+#endif
+#ifdef _CONFIG_RTSIG_MAX
+ { _CONFIG_RTSIG_MAX, "_CONFIG_RTSIG_MAX" },
+#endif
+#ifdef _CONFIG_SEM_NSEMS_MAX
+ { _CONFIG_SEM_NSEMS_MAX, "_CONFIG_SEM_NSEMS_MAX" },
+#endif
+#ifdef _CONFIG_SEM_VALUE_MAX
+ { _CONFIG_SEM_VALUE_MAX, "_CONFIG_SEM_VALUE_MAX" },
+#endif
+#ifdef _CONFIG_SIGQUEUE_MAX
+ { _CONFIG_SIGQUEUE_MAX, "_CONFIG_SIGQUEUE_MAX" },
+#endif
+#ifdef _CONFIG_SIGRT_MIN
+ { _CONFIG_SIGRT_MIN, "_CONFIG_SIGRT_MIN" },
+#endif
+#ifdef _CONFIG_SIGRT_MAX
+ { _CONFIG_SIGRT_MAX, "_CONFIG_SIGRT_MAX" },
+#endif
+#ifdef _CONFIG_TIMER_MAX
+ { _CONFIG_TIMER_MAX, "_CONFIG_TIMER_MAX" },
+#endif
+#ifdef _CONFIG_CONFIG_PHYS_PAGES
+ { _CONFIG_PHYS_PAGES, "_CONFIG_PHYS_PAGES" },
+#endif
+#ifdef _CONFIG_AVPHYS_PAGES
+ { _CONFIG_AVPHYS_PAGES, "_CONFIG_AVPHYS_PAGES" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_sysconfig(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp))
+ printxval(sysconfig_options, tcp->u_arg[0], "_CONFIG_???");
+ return 0;
+}
+
+static struct xlat sysinfo_options[] = {
+ { SI_SYSNAME, "SI_SYSNAME" },
+ { SI_HOSTNAME, "SI_HOSTNAME" },
+ { SI_RELEASE, "SI_RELEASE" },
+ { SI_VERSION, "SI_VERSION" },
+ { SI_MACHINE, "SI_MACHINE" },
+ { SI_ARCHITECTURE, "SI_ARCHITECTURE" },
+ { SI_HW_SERIAL, "SI_HW_SERIAL" },
+ { SI_HW_PROVIDER, "SI_HW_PROVIDER" },
+ { SI_SRPC_DOMAIN, "SI_SRPC_DOMAIN" },
+#ifdef SI_SET_HOSTNAME
+ { SI_SET_HOSTNAME, "SI_SET_HOSTNAME" },
+#endif
+#ifdef SI_SET_SRPC_DOMAIN
+ { SI_SET_SRPC_DOMAIN, "SI_SET_SRPC_DOMAIN" },
+#endif
+#ifdef SI_SET_KERB_REALM
+ { SI_SET_KERB_REALM, "SI_SET_KERB_REALM" },
+#endif
+#ifdef SI_KERB_REALM
+ { SI_KERB_REALM, "SI_KERB_REALM" },
+#endif
+ { 0, NULL },
+};
+
+int
+sys_sysinfo(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(sysinfo_options, tcp->u_arg[0], "SI_???");
+ tprintf(", ");
+ }
+ else {
+ /* Technically some calls write values. So what. */
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", %lu", tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+#ifdef MIPS
+
+#include <sys/syssgi.h>
+
+static struct xlat syssgi_options[] = {
+ { SGI_SYSID, "SGI_SYSID" },
+ { SGI_RDUBLK, "SGI_RDUBLK" },
+ { SGI_TUNE, "SGI_TUNE" },
+ { SGI_IDBG, "SGI_IDBG" },
+ { SGI_INVENT, "SGI_INVENT" },
+ { SGI_RDNAME, "SGI_RDNAME" },
+ { SGI_SETLED, "SGI_SETLED" },
+ { SGI_SETNVRAM, "SGI_SETNVRAM" },
+ { SGI_GETNVRAM, "SGI_GETNVRAM" },
+ { SGI_QUERY_FTIMER, "SGI_QUERY_FTIMER" },
+ { SGI_QUERY_CYCLECNTR, "SGI_QUERY_CYCLECNTR" },
+ { SGI_PROCSZ, "SGI_PROCSZ" },
+ { SGI_SIGACTION, "SGI_SIGACTION" },
+ { SGI_SIGPENDING, "SGI_SIGPENDING" },
+ { SGI_SIGPROCMASK, "SGI_SIGPROCMASK" },
+ { SGI_SIGSUSPEND, "SGI_SIGSUSPEND" },
+ { SGI_SETSID, "SGI_SETSID" },
+ { SGI_SETPGID, "SGI_SETPGID" },
+ { SGI_SYSCONF, "SGI_SYSCONF" },
+ { SGI_WAIT4, "SGI_WAIT4" },
+ { SGI_PATHCONF, "SGI_PATHCONF" },
+ { SGI_READB, "SGI_READB" },
+ { SGI_WRITEB, "SGI_WRITEB" },
+ { SGI_SETGROUPS, "SGI_SETGROUPS" },
+ { SGI_GETGROUPS, "SGI_GETGROUPS" },
+ { SGI_SETTIMEOFDAY, "SGI_SETTIMEOFDAY" },
+ { SGI_SETTIMETRIM, "SGI_SETTIMETRIM" },
+ { SGI_GETTIMETRIM, "SGI_GETTIMETRIM" },
+ { SGI_SPROFIL, "SGI_SPROFIL" },
+ { SGI_RUSAGE, "SGI_RUSAGE" },
+ { SGI_SIGSTACK, "SGI_SIGSTACK" },
+ { SGI_SIGSTATUS, "SGI_SIGSTATUS" },
+ { SGI_NETPROC, "SGI_NETPROC" },
+ { SGI_SIGALTSTACK, "SGI_SIGALTSTACK" },
+ { SGI_BDFLUSHCNT, "SGI_BDFLUSHCNT" },
+ { SGI_SSYNC, "SGI_SSYNC" },
+ { SGI_NFSCNVT, "SGI_NFSCNVT" },
+ { SGI_GETPGID, "SGI_GETPGID" },
+ { SGI_GETSID, "SGI_GETSID" },
+ { SGI_IOPROBE, "SGI_IOPROBE" },
+ { SGI_CONFIG, "SGI_CONFIG" },
+ { SGI_ELFMAP, "SGI_ELFMAP" },
+ { SGI_MCONFIG, "SGI_MCONFIG" },
+ { SGI_GETPLABEL, "SGI_GETPLABEL" },
+ { SGI_SETPLABEL, "SGI_SETPLABEL" },
+ { SGI_GETLABEL, "SGI_GETLABEL" },
+ { SGI_SETLABEL, "SGI_SETLABEL" },
+ { SGI_SATREAD, "SGI_SATREAD" },
+ { SGI_SATWRITE, "SGI_SATWRITE" },
+ { SGI_SATCTL, "SGI_SATCTL" },
+ { SGI_LOADATTR, "SGI_LOADATTR" },
+ { SGI_UNLOADATTR, "SGI_UNLOADATTR" },
+#ifdef SGI_RECVLMSG
+ { SGI_RECVLMSG, "SGI_RECVLMSG" },
+#endif
+ { SGI_PLANGMOUNT, "SGI_PLANGMOUNT" },
+ { SGI_GETPSOACL, "SGI_GETPSOACL" },
+ { SGI_SETPSOACL, "SGI_SETPSOACL" },
+ { SGI_RMI_FIXECC, "SGI_RMI_FIXECC" },
+ { SGI_R4K_CERRS, "SGI_R4K_CERRS" },
+ { SGI_GET_EVCONF, "SGI_GET_EVCONF" },
+ { SGI_MPCWAROFF, "SGI_MPCWAROFF" },
+ { SGI_SET_AUTOPWRON, "SGI_SET_AUTOPWRON" },
+ { SGI_SPIPE, "SGI_SPIPE" },
+ { SGI_SYMTAB, "SGI_SYMTAB" },
+#ifdef SGI_SET_FPDEBUG
+ { SGI_SET_FPDEBUG, "SGI_SET_FPDEBUG" },
+#endif
+ { SGI_TOSSTSAVE, "SGI_TOSSTSAVE" },
+ { SGI_FDHI, "SGI_FDHI" },
+ { SGI_MINRSS, "SGI_MINRSS" },
+ { 0, NULL },
+};
+
+int
+sys_syssgi(tcp)
+struct tcb *tcp;
+{
+ int i;
+
+ if (entering(tcp)) {
+ printxval(syssgi_options, tcp->u_arg[0], "SGI_???");
+ switch (tcp->u_arg[0]) {
+ default:
+ for (i = 1; i < tcp->u_nargs; i++)
+ tprintf(", %#lx", tcp->u_arg[i]);
+ break;
+ }
+ }
+ return 0;
+}
+
+#include <sys/types.h>
+#include <rpc/rpc.h>
+struct cred;
+struct uio;
+#include <sys/fsid.h>
+#include <sys/vnode.h>
+#include <sys/fs/nfs.h>
+#include <sys/fs/nfs_clnt.h>
+
+static struct xlat mount_flags[] = {
+ { MS_RDONLY, "MS_RDONLY" },
+ { MS_FSS, "MS_FSS" },
+ { MS_DATA, "MS_DATA" },
+ { MS_NOSUID, "MS_NOSUID" },
+ { MS_REMOUNT, "MS_REMOUNT" },
+ { MS_NOTRUNC, "MS_NOTRUNC" },
+ { MS_GRPID, "MS_GRPID" },
+ { MS_NODEV, "MS_NODEV" },
+ { MS_BEFORE, "MS_BEFORE" },
+ { MS_AFTER, "MS_AFTER" },
+ { 0, NULL },
+};
+
+static struct xlat nfs_flags[] = {
+ { NFSMNT_SOFT, "NFSMNT_SOFT" },
+ { NFSMNT_WSIZE, "NFSMNT_WSIZE" },
+ { NFSMNT_RSIZE, "NFSMNT_RSIZE" },
+ { NFSMNT_TIMEO, "NFSMNT_TIMEO" },
+ { NFSMNT_RETRANS, "NFSMNT_RETRANS" },
+ { NFSMNT_HOSTNAME, "NFSMNT_HOSTNAME" },
+ { NFSMNT_INT, "NFSMNT_INT" },
+ { NFSMNT_NOAC, "NFSMNT_NOAC" },
+ { NFSMNT_ACREGMIN, "NFSMNT_ACREGMIN" },
+ { NFSMNT_ACREGMAX, "NFSMNT_ACREGMAX" },
+ { NFSMNT_ACDIRMIN, "NFSMNT_ACDIRMIN" },
+ { NFSMNT_ACDIRMAX, "NFSMNT_ACDIRMAX" },
+ { NFSMNT_PRIVATE, "NFSMNT_PRIVATE" },
+ { NFSMNT_SYMTTL, "NFSMNT_SYMTTL" },
+ { NFSMNT_LOOPBACK, "NFSMNT_LOOPBACK" },
+ { NFSMNT_BASETYPE, "NFSMNT_BASETYPE" },
+ { NFSMNT_NAMEMAX, "NFSMNT_NAMEMAX" },
+ { 0, NULL },
+};
+
+int
+sys_mount(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", ");
+ printflags(mount_flags, tcp->u_arg[2]);
+ if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
+ tprintf(", ");
+ tprintf("%ld", tcp->u_arg[3]);
+ }
+ if (tcp->u_arg[2] & MS_DATA) {
+ int nfs_type = sysfs(GETFSIND, FSID_NFS);
+
+ tprintf(", ");
+ if (tcp->u_arg[3] == nfs_type) {
+ struct nfs_args args;
+ if (umove(tcp, tcp->u_arg[4], &args) < 0)
+ tprintf("%#lx", tcp->u_arg[4]);
+ else {
+ tprintf("addr=");
+ printsock(tcp, (int) args.addr);
+ tprintf(", flags=");
+ if (!printflags(nfs_flags, args.flags))
+ tprintf("NFSMNT_???");
+ tprintf(", hostname=");
+ printstr(tcp, (int) args.hostname, -1);
+ tprintf(", ...}");
+ }
+ }
+ else
+ tprintf("%#lx", tcp->u_arg[4]);
+ tprintf(", %ld", tcp->u_arg[5]);
+ }
+ }
+ return 0;
+}
+
+#else /* !MIPS */
+
+int
+sys_mount(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprintf(", ...");
+ }
+ return 0;
+}
+
+#endif /* !MIPS */
+
+#endif /* SVR4 */
+
+#ifdef __NR_capget
+int
+sys_capget(tcp)
+struct tcb *tcp;
+{
+ cap_user_header_t arg0;
+ cap_user_data_t arg1;
+
+ if(!entering(tcp)) {
+ arg0 = (cap_user_header_t)tcp->u_arg[0];
+ arg1 = (cap_user_data_t)tcp->u_arg[1];
+ tprintf("{%lx, %d}, ", (unsigned long)arg0->version, arg0->pid);
+ tprintf("{%lx, %lx, %lx}", (unsigned long)arg1->effective,
+ (unsigned long)arg1->permitted, (unsigned long)arg1->inheritable);
+ }
+ return 0;
+}
+
+int
+sys_capset(tcp)
+struct tcb *tcp;
+{
+ cap_user_header_t arg0;
+ cap_user_data_t arg1;
+
+ if(entering(tcp)) {
+ arg0 = (cap_user_header_t)tcp->u_arg[0];
+ arg1 = (cap_user_data_t)tcp->u_arg[1];
+ tprintf("{%lx, %d}, ", (unsigned long)arg0->version, arg0->pid);
+ tprintf("{%lx, %lx, %lx}", (unsigned long)arg1->effective,
+ (unsigned long)arg1->permitted, (unsigned long)arg1->inheritable);
+ }
+ return 0;
+}
+
+#else
+
+int sys_capget(tcp)
+struct tcb *tcp;
+{
+ return printargs(tcp);
+}
+
+int sys_capset(tcp)
+struct tcb *tcp;
+{
+ return printargs(tcp);
+}
+
+#endif
+
diff --git a/term.c b/term.c
new file mode 100644
index 000000000..5850e3377
--- /dev/null
+++ b/term.c
@@ -0,0 +1,380 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#ifdef __GLIBC__
+#include <termio.h>
+#endif /* __GLIBC__ */
+#include <termios.h>
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
+
+static struct xlat tcxonc_options[] = {
+ { TCOOFF, "TCOOFF" },
+ { TCOON, "TCOON" },
+ { TCIOFF, "TCIOFF" },
+ { TCION, "TCION" },
+ { 0, NULL },
+};
+
+static struct xlat tcflsh_options[] = {
+ { TCIFLUSH, "TCIFLUSH" },
+ { TCOFLUSH, "TCOFLUSH" },
+ { TCIOFLUSH, "TCIOFLUSH" },
+ { 0, NULL },
+};
+
+static struct xlat baud_options[] = {
+ { B0, "B0" },
+ { B50, "B50" },
+ { B75, "B75" },
+ { B110, "B110" },
+ { B134, "B134" },
+ { B150, "B150" },
+ { B200, "B200" },
+ { B300, "B300" },
+ { B600, "B600" },
+ { B1200, "B1200" },
+ { B1800, "B1800" },
+ { B2400, "B2400" },
+ { B4800, "B4800" },
+ { B9600, "B9600" },
+#ifdef B19200
+ { B19200, "B19200" },
+#endif
+#ifdef B38400
+ { B38400, "B38400" },
+#endif
+#ifdef EXTA
+ { EXTA, "EXTA" },
+#endif
+#ifdef EXTB
+ { EXTB, "EXTB" },
+#endif
+ { 0, NULL },
+};
+
+static struct xlat modem_flags[] = {
+#ifdef TIOCM_LE
+ { TIOCM_LE, "TIOCM_LE", },
+#endif
+#ifdef TIOCM_DTR
+ { TIOCM_DTR, "TIOCM_DTR", },
+#endif
+#ifdef TIOCM_RTS
+ { TIOCM_RTS, "TIOCM_RTS", },
+#endif
+#ifdef TIOCM_ST
+ { TIOCM_ST, "TIOCM_ST", },
+#endif
+#ifdef TIOCM_SR
+ { TIOCM_SR, "TIOCM_SR", },
+#endif
+#ifdef TIOCM_CTS
+ { TIOCM_CTS, "TIOCM_CTS", },
+#endif
+#ifdef TIOCM_CAR
+ { TIOCM_CAR, "TIOCM_CAR", },
+#endif
+#ifdef TIOCM_CD
+ { TIOCM_CD, "TIOCM_CD", },
+#endif
+#ifdef TIOCM_RNG
+ { TIOCM_RNG, "TIOCM_RNG", },
+#endif
+#ifdef TIOCM_RI
+ { TIOCM_RI, "TIOCM_RI", },
+#endif
+#ifdef TIOCM_DSR
+ { TIOCM_DSR, "TIOCM_DSR", },
+#endif
+ { 0, NULL, },
+};
+
+
+int
+term_ioctl(tcp, code, arg)
+struct tcb *tcp;
+long code, arg;
+{
+ struct termios tios;
+ struct termio tio;
+ struct winsize ws;
+#ifdef TIOCGSIZE
+ struct ttysize ts;
+#endif
+ int i;
+
+ if (entering(tcp))
+ return 0;
+
+ switch (code) {
+
+ /* ioctls with termios or termio args */
+
+#ifdef TCGETS
+ case TCGETS:
+ if (syserror(tcp))
+ return 0;
+ case TCSETS:
+ case TCSETSW:
+ case TCSETSF:
+ if (!verbose(tcp) || umove(tcp, arg, &tios) < 0)
+ return 0;
+ if (abbrev(tcp)) {
+ tprintf(", {");
+ printxval(baud_options, tios.c_cflag & CBAUD, "B???");
+ tprintf(" %sopost %sisig %sicanon %secho ...}",
+ (tios.c_oflag & OPOST) ? "" : "-",
+ (tios.c_lflag & ISIG) ? "" : "-",
+ (tios.c_lflag & ICANON) ? "" : "-",
+ (tios.c_lflag & ECHO) ? "" : "-");
+ return 1;
+ }
+ tprintf(", {c_iflags=%#lx, c_oflags=%#lx, ",
+ (long) tios.c_iflag, (long) tios.c_oflag);
+ tprintf("c_cflags=%#lx, c_lflags=%#lx, ",
+ (long) tios.c_cflag, (long) tios.c_lflag);
+#ifndef SVR4
+ tprintf("c_line=%u, ", tios.c_line);
+#endif
+ if (!(tios.c_lflag & ICANON))
+ tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ",
+ tios.c_cc[VMIN], tios.c_cc[VTIME]);
+ tprintf("c_cc=\"");
+ for (i = 0; i < NCCS; i++)
+ tprintf("\\x%02x", tios.c_cc[i]);
+ tprintf("\"}");
+ return 1;
+#endif /* TCGETS */
+
+#ifdef TCGETA
+ case TCGETA:
+ if (syserror(tcp))
+ return 0;
+ case TCSETA:
+ case TCSETAW:
+ case TCSETAF:
+ if (!verbose(tcp) || umove(tcp, arg, &tio) < 0)
+ return 0;
+ if (abbrev(tcp)) {
+ tprintf(", {");
+ printxval(baud_options, tio.c_cflag & CBAUD, "B???");
+ tprintf(" %sopost %sisig %sicanon %secho ...}",
+ (tio.c_oflag & OPOST) ? "" : "-",
+ (tio.c_lflag & ISIG) ? "" : "-",
+ (tio.c_lflag & ICANON) ? "" : "-",
+ (tio.c_lflag & ECHO) ? "" : "-");
+ return 1;
+ }
+ tprintf(", {c_iflags=%#lx, c_oflags=%#lx, ",
+ (long) tio.c_iflag, (long) tio.c_oflag);
+ tprintf("c_cflags=%#lx, c_lflags=%#lx, ",
+ (long) tio.c_cflag, (long) tio.c_lflag);
+ tprintf("c_line=%u, ", tio.c_line);
+#ifdef _VMIN
+ if (!(tio.c_lflag & ICANON))
+ tprintf("c_cc[_VMIN]=%d, c_cc[_VTIME]=%d, ",
+ tio.c_cc[_VMIN], tio.c_cc[_VTIME]);
+#else /* !_VMIN */
+ if (!(tio.c_lflag & ICANON))
+ tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ",
+ tio.c_cc[VMIN], tio.c_cc[VTIME]);
+#endif /* !_VMIN */
+ tprintf("c_cc=\"");
+ for (i = 0; i < NCC; i++)
+ tprintf("\\x%02x", tio.c_cc[i]);
+ tprintf("\"}");
+ return 1;
+#endif /* TCGETA */
+
+ /* ioctls with winsize or ttysize args */
+
+#ifdef TIOCGWINSZ
+ case TIOCGWINSZ:
+ if (syserror(tcp))
+ return 0;
+ case TIOCSWINSZ:
+ if (!verbose(tcp) || umove(tcp, arg, &ws) < 0)
+ return 0;
+ tprintf(", {ws_row=%d, ws_col=%d, ws_xpixel=%d, ws_ypixel=%d}",
+ ws.ws_row, ws.ws_col, ws.ws_xpixel, ws.ws_ypixel);
+ return 1;
+#endif /* TIOCGWINSZ */
+
+#ifdef TIOCGSIZE
+ case TIOCGSIZE:
+ if (syserror(tcp))
+ return 0;
+ case TIOCSSIZE:
+ if (!verbose(tcp) || umove(tcp, arg, &ts) < 0)
+ return 0;
+ tprintf(", {ts_lines=%d, ts_cols=%d}",
+ ts.ts_lines, ts.ts_cols);
+ return 1;
+#endif
+
+ /* ioctls with a direct decodable arg */
+
+ case TCXONC:
+ tprintf(", ");
+ printxval(tcxonc_options, arg, "TC???");
+ return 1;
+ case TCFLSH:
+ tprintf(", ");
+ printxval(tcflsh_options, arg, "TC???");
+ return 1;
+
+ /* ioctls with an indirect parameter displayed as modem flags */
+
+#ifdef TIOCMGET
+ case TIOCMGET:
+ case TIOCMBIS:
+ case TIOCMBIC:
+ case TIOCMSET:
+ if (umove(tcp, arg, &arg) < 0)
+ return 0;
+ tprintf(", [");
+ if (!printflags(modem_flags, arg))
+ tprintf("0");
+ tprintf("]");
+ return 1;
+#endif /* TIOCMGET */
+
+ /* ioctls with an indirect parameter displayed in decimal */
+
+ case TIOCSPGRP:
+ case TIOCGPGRP:
+#ifdef TIOCGETPGRP
+ case TIOCGETPGRP:
+#endif
+#ifdef TIOCSETPGRP
+ case TIOCSETPGRP:
+#endif
+#ifdef FIONREAD
+ case FIONREAD:
+#endif
+ case TIOCOUTQ:
+#ifdef FIONBIO
+ case FIONBIO:
+#endif
+#ifdef FIOASYNC
+ case FIOASYNC:
+#endif
+#ifdef FIOGETOWN
+ case FIOGETOWN:
+#endif
+#ifdef FIOSETOWN
+ case FIOSETOWN:
+#endif
+#ifdef TIOCGETD
+ case TIOCGETD:
+#endif
+#ifdef TIOCSETD
+ case TIOCSETD:
+#endif
+#ifdef TIOCPKT
+ case TIOCPKT:
+#endif
+#ifdef TIOCREMOTE
+ case TIOCREMOTE:
+#endif
+#ifdef TIOCUCNTL
+ case TIOCUCNTL:
+#endif
+#ifdef TIOCTCNTL
+ case TIOCTCNTL:
+#endif
+#ifdef TIOCSIGNAL
+ case TIOCSIGNAL:
+#endif
+#ifdef TIOCSSOFTCAR
+ case TIOCSSOFTCAR:
+#endif
+#ifdef TIOCGSOFTCAR
+ case TIOCGSOFTCAR:
+#endif
+#ifdef TIOCISPACE
+ case TIOCISPACE:
+#endif
+#ifdef TIOCISIZE
+ case TIOCISIZE:
+#endif
+#ifdef TIOCSINTR
+ case TIOCSINTR:
+#endif
+ tprintf(", ");
+ printnum(tcp, arg, "%d");
+ return 1;
+
+#if 0
+ /* ioctls with an indirect parameter displayed in hex */
+
+ tprintf(", ");
+ printnum(tcp, arg, "%#x");
+ return 1;
+#endif
+
+ /* ioctls with an indirect parameter displayed as a char */
+
+#ifdef TIOCSTI
+ case TIOCSTI:
+#endif
+ tprintf(", ");
+ printstr(tcp, arg, 1);
+ return 1;
+
+ /* ioctls with no parameters */
+
+#ifdef TIOCSCTTY
+ case TIOCSCTTY:
+#endif
+#ifdef TIOCNOTTY
+ case TIOCNOTTY:
+#endif
+#ifdef FIOCLEX
+ case FIOCLEX:
+#endif
+#ifdef FIONCLEX
+ case FIONCLEX:
+#endif
+#ifdef TIOCCONS
+ case TIOCCONS:
+#endif
+ return 1;
+
+ /* ioctls which are unknown */
+
+ default:
+ return 0;
+ }
+}
+
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 000000000..36670cb6a
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,9 @@
+#
+# $Id$
+#
+
+all: fork sig
+
+clean distclean:
+ rm -f fork sig *.o core
+
diff --git a/test/fork.c b/test/fork.c
new file mode 100644
index 000000000..3f68f6722
--- /dev/null
+++ b/test/fork.c
@@ -0,0 +1,10 @@
+main()
+{
+ if (fork() == 0)
+ write(1, "child\n", 6);
+ else {
+ wait(0);
+ write(1, "parent\n", 7);
+ }
+ exit(0);
+}
diff --git a/test/procpollable.c b/test/procpollable.c
new file mode 100644
index 000000000..fc599b566
--- /dev/null
+++ b/test/procpollable.c
@@ -0,0 +1,33 @@
+#include <stdio.h>
+#include <signal.h>
+#include <sys/procfs.h>
+#include <sys/stropts.h>
+#include <poll.h>
+main()
+{
+ int pid;
+ char proc[32];
+ FILE *pfp;
+ struct pollfd pfd;
+
+ if ((pid = fork()) == 0) {
+ pause();
+ exit(0);
+ }
+ sprintf(proc, "/proc/%d", pid);
+ if ((pfp = fopen(proc, "r+")) == NULL)
+ goto fail;
+ if (ioctl(fileno(pfp), PIOCSTOP, NULL) < 0)
+ goto fail;
+ pfd.fd = fileno(pfp);
+ pfd.events = POLLPRI;
+ if (poll(&pfd, 1, 0) < 0)
+ goto fail;
+ if (!(pfd.revents & POLLPRI))
+ goto fail;
+ kill(pid, SIGKILL);
+ exit(0);
+fail:
+ kill(pid, SIGKILL);
+ exit(1);
+}
diff --git a/test/sfd.c b/test/sfd.c
new file mode 100644
index 000000000..081de01e2
--- /dev/null
+++ b/test/sfd.c
@@ -0,0 +1,32 @@
+#include <fcntl.h>
+#include <stdio.h>
+main(int argc, char *argv[])
+{
+ int pid = atoi(argv[1]);
+ int sfd;
+ char sname[32];
+ char buf[1024];
+ char *s;
+ int i;
+ int signal, blocked, ignore, caught;
+
+ sprintf(sname, "/proc/%d/stat", pid);
+ if ((sfd = open(sname, O_RDONLY)) == -1) {
+ perror(sname);
+ return 1;
+ }
+ i = read(sfd, buf, 1024);
+ buf[i] = '\0';
+ for (i = 0, s = buf; i < 30; i++) {
+ while (*++s != ' ') {
+ if (!*s)
+ break;
+ }
+ }
+ if (sscanf(s, "%d%d%d%d", &signal, &blocked, &ignore, &caught) != 4) {
+ fprintf(stderr, "/proc/pid/stat format error\n");
+ return 1;
+ }
+ printf("%8x %8x %8x %8x\n", signal, blocked, ignore, caught);
+ return 1;
+}
diff --git a/test/sig.c b/test/sig.c
new file mode 100644
index 000000000..930a177f5
--- /dev/null
+++ b/test/sig.c
@@ -0,0 +1,16 @@
+#include <signal.h>
+main()
+{
+ char buf[1024];
+ void interrupt();
+
+ signal(SIGINT, interrupt);
+ read(0, buf, 1024);
+ write(2, "qwerty\n", 7);
+ exit(0);
+}
+
+interrupt()
+{
+ write(2, "xyzzy\n", 6);
+}
diff --git a/time.c b/time.c
new file mode 100644
index 000000000..b77ce5ca3
--- /dev/null
+++ b/time.c
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#ifdef LINUX
+#include <linux/version.h>
+#include <linux/timex.h>
+#endif /* LINUX */
+
+void
+printtv(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ struct timeval tv;
+
+ if (addr == 0)
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", addr);
+ else if (umove(tcp, addr, &tv) < 0)
+ tprintf("{...}");
+ else
+ tprintf("{%lu, %lu}", (long) tv.tv_sec, (long) tv.tv_usec);
+}
+
+int
+sys_time(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+#ifndef SVR4
+ printnum(tcp, tcp->u_arg[0], "%ld");
+#endif /* SVR4 */
+ }
+ return 0;
+}
+
+int
+sys_stime(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ printnum(tcp, tcp->u_arg[0], "%ld");
+ }
+ return 0;
+}
+
+int
+sys_gettimeofday(tcp)
+struct tcb *tcp;
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp)) {
+ tprintf("%#lx, %#lx",
+ tcp->u_arg[0], tcp->u_arg[1]);
+ return 0;
+ }
+ printtv(tcp, tcp->u_arg[0]);
+#ifndef SVR4
+ tprintf(", ");
+ printtv(tcp, tcp->u_arg[1]);
+#endif /* !SVR4 */
+ }
+ return 0;
+}
+
+int
+sys_settimeofday(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printtv(tcp, tcp->u_arg[0]);
+#ifndef SVR4
+ tprintf(", ");
+ printtv(tcp, tcp->u_arg[1]);
+#endif /* !SVR4 */
+ }
+ return 0;
+}
+
+int
+sys_adjtime(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printtv(tcp, tcp->u_arg[0]);
+ tprintf(", ");
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printtv(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+static struct xlat which[] = {
+ { ITIMER_REAL, "ITIMER_REAL" },
+ { ITIMER_VIRTUAL,"ITIMER_VIRTUAL"},
+ { ITIMER_PROF, "ITIMER_PROF" },
+ { 0, NULL },
+};
+
+static void
+printitv(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ struct itimerval itv;
+
+ if (addr == 0)
+ tprintf("NULL");
+ else if (!verbose(tcp))
+ tprintf("%#lx", addr);
+ else if (umove(tcp, addr, &itv) < 0)
+ tprintf("{...}");
+ else {
+ tprintf("{it_interval={%lu, %lu}, it_value={%lu, %lu}}",
+ (long) itv.it_interval.tv_sec, (long) itv.it_interval.tv_usec,
+ (long) itv.it_value.tv_sec, (long) itv.it_value.tv_usec);
+ }
+}
+
+int
+sys_getitimer(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(which, tcp->u_arg[0], "ITIMER_???");
+ tprintf(", ");
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+ printitv(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+int
+sys_setitimer(tcp)
+struct tcb *tcp;
+{
+ if (entering(tcp)) {
+ printxval(which, tcp->u_arg[0], "ITIMER_???");
+ tprintf(", ");
+ printitv(tcp, tcp->u_arg[1]);
+ tprintf(", ");
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[2]);
+ else
+ printitv(tcp, tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+#ifdef LINUX
+
+int
+sys_adjtimex(tcp)
+struct tcb *tcp;
+{
+ struct timex txc;
+
+ if (exiting(tcp)) {
+ if (tcp->u_arg[0] == 0)
+ tprintf("NULL");
+ else if (syserror(tcp) || !verbose(tcp))
+ tprintf("%#lx", tcp->u_arg[0]);
+ else if (umove(tcp, tcp->u_arg[0], &txc) < 0)
+ tprintf("{...}");
+ else {
+#if LINUX_VERSION_CODE < 66332
+ tprintf("{mode=%d, offset=%ld, frequency=%ld, ",
+ txc.mode, txc.offset, txc.frequency);
+ tprintf("maxerror=%ld, esterror=%lu, status=%u, ",
+ txc.maxerror, txc.esterror, txc.status);
+ tprintf("time_constant=%ld, precision=%lu, ",
+ txc.time_constant, txc.precision);
+ tprintf("tolerance=%ld, time={%lu, %lu}}",
+ txc.tolerance, (long) txc.time.tv_sec,
+ (long) txc.time.tv_usec);
+#else
+ tprintf("{modes=%d, offset=%ld, freq=%ld, ",
+ txc.modes, txc.offset, txc.freq);
+ tprintf("maxerror=%ld, esterror=%lu, status=%u, ",
+ txc.maxerror, txc.esterror, txc.status);
+ tprintf("constant=%ld, precision=%lu, ",
+ txc.constant, txc.precision);
+ tprintf("tolerance=%ld, time={%lu, %lu}}",
+ txc.tolerance, (long) txc.time.tv_sec,
+ (long) txc.time.tv_usec);
+ /* there's a bunch of other stuff, but it's not
+ * worth the time or the trouble to include */
+#endif
+ }
+ }
+ return 0;
+}
+#endif /* LINUX */
+
diff --git a/util.c b/util.c
new file mode 100644
index 000000000..6fd726ce1
--- /dev/null
+++ b/util.c
@@ -0,0 +1,1381 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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$
+ */
+
+#include "defs.h"
+
+#include <sys/user.h>
+#include <sys/param.h>
+#include <fcntl.h>
+#ifdef SUNOS4
+#include <machine/reg.h>
+#include <a.out.h>
+#include <link.h>
+#endif /* SUNOS4 */
+#if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1
+# include <sys/reg.h>
+# define PTRACE_PEEKUSR PTRACE_PEEKUSER
+#endif
+#ifdef LINUX
+#include <linux/ptrace.h>
+#endif /* LINUX */
+
+#ifdef SUNOS4_KERNEL_ARCH_KLUDGE
+#include <sys/utsname.h>
+#endif /* SUNOS4_KERNEL_ARCH_KLUDGE */
+
+#if defined(LINUX) && defined(SPARC) && !defined(__GLIBC__)
+
+#include <linux/unistd.h>
+
+#define _hack_syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,\
+ type5,arg5,syscall) \
+type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+{ \
+ long __res; \
+\
+__asm__ volatile ("or %%g0, %1, %%o0\n\t" \
+ "or %%g0, %2, %%o1\n\t" \
+ "or %%g0, %3, %%o2\n\t" \
+ "or %%g0, %4, %%o3\n\t" \
+ "or %%g0, %5, %%o4\n\t" \
+ "or %%g0, %6, %%g1\n\t" \
+ "t 0x10\n\t" \
+ "bcc 1f\n\t" \
+ "or %%g0, %%o0, %0\n\t" \
+ "sub %%g0, %%o0, %0\n\t" \
+ "1:\n\t" \
+ : "=r" (__res) \
+ : "0" ((long)(arg1)),"1" ((long)(arg2)), \
+ "2" ((long)(arg3)),"3" ((long)(arg4)),"4" ((long)(arg5)), \
+ "i" (__NR_##syscall) \
+ : "g1", "o0", "o1", "o2", "o3", "o4"); \
+if (__res>=0) \
+ return (type) __res; \
+errno = -__res; \
+return -1; \
+}
+
+static _hack_syscall5(int,_ptrace,int,__request,int,__pid,int,__addr,int,__data,int,__addr2,ptrace)
+
+#define _ptrace
+
+#endif
+
+/* macros */
+#ifndef MAX
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef MIN
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+void
+tv_tv(tv, a, b)
+struct timeval *tv;
+int a;
+int b;
+{
+ tv->tv_sec = a;
+ tv->tv_usec = b;
+}
+
+int
+tv_nz(a)
+struct timeval *a;
+{
+ return a->tv_sec || a->tv_usec;
+}
+
+int
+tv_cmp(a, b)
+struct timeval *a, *b;
+{
+ if (a->tv_sec < b->tv_sec
+ || (a->tv_sec == b->tv_sec && a->tv_usec < b->tv_usec))
+ return -1;
+ if (a->tv_sec > b->tv_sec
+ || (a->tv_sec == b->tv_sec && a->tv_usec > b->tv_usec))
+ return 1;
+ return 0;
+}
+
+double
+tv_float(tv)
+struct timeval *tv;
+{
+ return tv->tv_sec + tv->tv_usec/1000000.0;
+}
+
+void
+tv_add(tv, a, b)
+struct timeval *tv, *a, *b;
+{
+ tv->tv_sec = a->tv_sec + b->tv_sec;
+ tv->tv_usec = a->tv_usec + b->tv_usec;
+ if (tv->tv_usec > 1000000) {
+ tv->tv_sec++;
+ tv->tv_usec -= 1000000;
+ }
+}
+
+void
+tv_sub(tv, a, b)
+struct timeval *tv, *a, *b;
+{
+ tv->tv_sec = a->tv_sec - b->tv_sec;
+ tv->tv_usec = a->tv_usec - b->tv_usec;
+ if (((long) tv->tv_usec) < 0) {
+ tv->tv_sec--;
+ tv->tv_usec += 1000000;
+ }
+}
+
+void
+tv_div(tv, a, n)
+struct timeval *tv, *a;
+int n;
+{
+ tv->tv_usec = (a->tv_sec % n * 1000000 + a->tv_usec + n / 2) / n;
+ tv->tv_sec = a->tv_sec / n + tv->tv_usec / 1000000;
+ tv->tv_usec %= 1000000;
+}
+
+void
+tv_mul(tv, a, n)
+struct timeval *tv, *a;
+int n;
+{
+ tv->tv_usec = a->tv_usec * n;
+ tv->tv_sec = a->tv_sec * n + a->tv_usec / 1000000;
+ tv->tv_usec %= 1000000;
+}
+
+char *
+xlookup(xlat, val)
+struct xlat *xlat;
+int val;
+{
+ for (; xlat->str != NULL; xlat++)
+ if (xlat->val == val)
+ return xlat->str;
+ return NULL;
+}
+
+/*
+ * Print entry in struct xlat table, if there.
+ */
+void
+printxval(xlat, val, dflt)
+struct xlat *xlat;
+int val;
+char *dflt;
+{
+ char *str = xlookup(xlat, val);
+
+ if (str)
+ tprintf("%s", str);
+ else
+ tprintf("%#x /* %s */", val, dflt);
+}
+
+/*
+ * Interpret `xlat' as an array of flags
+ * print the entries whose bits are on in `flags'
+ * return # of flags printed.
+ */
+int
+addflags(xlat, flags)
+struct xlat *xlat;
+int flags;
+{
+ int n;
+
+ for (n = 0; xlat->str; xlat++) {
+ if (xlat->val && (flags & xlat->val) == xlat->val) {
+ tprintf("|%s", xlat->str);
+ flags &= ~xlat->val;
+ n++;
+ }
+ }
+ if (flags) {
+ tprintf("|%#x", flags);
+ n++;
+ }
+ return n;
+}
+
+int
+printflags(xlat, flags)
+struct xlat *xlat;
+int flags;
+{
+ int n;
+ char *sep;
+
+ if (flags == 0 && xlat->val == 0) {
+ tprintf("%s", xlat->str);
+ return 1;
+ }
+
+ sep = "";
+ for (n = 0; xlat->str; xlat++) {
+ if (xlat->val && (flags & xlat->val) == xlat->val) {
+ tprintf("%s%s", sep, xlat->str);
+ flags &= ~xlat->val;
+ sep = "|";
+ n++;
+ }
+ }
+ if (flags) {
+ tprintf("%s%#x", sep, flags);
+ n++;
+ }
+ return n;
+}
+
+void
+printnum(tcp, addr, fmt)
+struct tcb *tcp;
+long addr;
+char *fmt;
+{
+ int num;
+
+ if (!addr) {
+ tprintf("NULL");
+ return;
+ }
+ if (umove(tcp, addr, &num) < 0) {
+ tprintf("%#lx", addr);
+ return;
+ }
+ tprintf("[");
+ tprintf(fmt, num);
+ tprintf("]");
+}
+
+static char path[MAXPATHLEN + 1];
+
+void
+string_quote(str)
+char *str;
+{
+ char buf[2 * MAXPATHLEN + 1];
+ char *s;
+
+ if (!strpbrk(str, "\"\'\\")) {
+ tprintf("\"%s\"", str);
+ return;
+ }
+ for (s = buf; *str; str++) {
+ switch (*str) {
+ case '\"': case '\'': case '\\':
+ *s++ = '\\'; *s++ = *str; break;
+ default:
+ *s++ = *str; break;
+ }
+ }
+ *s = '\0';
+ tprintf("\"%s\"", buf);
+}
+
+void
+printpath(tcp, addr)
+struct tcb *tcp;
+long addr;
+{
+ if (umovestr(tcp, addr, MAXPATHLEN, path) < 0)
+ tprintf("%#lx", addr);
+ else
+ string_quote(path);
+ return;
+}
+
+void
+printpathn(tcp, addr, n)
+struct tcb *tcp;
+long addr;
+int n;
+{
+ if (umovestr(tcp, addr, n, path) < 0)
+ tprintf("%#lx", addr);
+ else {
+ path[n] = '\0';
+ string_quote(path);
+ }
+}
+
+void
+printstr(tcp, addr, len)
+struct tcb *tcp;
+long addr;
+int len;
+{
+ static unsigned char *str = NULL;
+ static char *outstr;
+ int i, n, c, usehex;
+ char *s, *outend;
+
+ if (!addr) {
+ tprintf("NULL");
+ return;
+ }
+ if (!str) {
+ if ((str = malloc(max_strlen)) == NULL
+ || (outstr = malloc(2*max_strlen)) == NULL) {
+ fprintf(stderr, "printstr: no memory\n");
+ tprintf("%#lx", addr);
+ return;
+ }
+ }
+ outend = outstr + max_strlen;
+ if (len < 0) {
+ n = max_strlen;
+ if (umovestr(tcp, addr, n, (char *) str) < 0) {
+ tprintf("%#lx", addr);
+ return;
+ }
+ }
+ else {
+ n = MIN(len, max_strlen);
+ if (umoven(tcp, addr, n, (char *) str) < 0) {
+ tprintf("%#lx", addr);
+ return;
+ }
+ }
+
+ usehex = 0;
+ if (xflag > 1)
+ usehex = 1;
+ else if (xflag) {
+ for (i = 0; i < n; i++) {
+ c = str[i];
+ if (len < 0 && c == '\0')
+ break;
+ if (!isprint(c) && !isspace(c)) {
+ usehex = 1;
+ break;
+ }
+ }
+ }
+
+ s = outstr;
+ *s++ = '\"';
+
+ if (usehex) {
+ for (i = 0; i < n; i++) {
+ c = str[i];
+ if (len < 0 && c == '\0')
+ break;
+ sprintf(s, "\\x%02x", c);
+ s += 4;
+ if (s > outend)
+ break;
+ }
+ }
+ else {
+ for (i = 0; i < n; i++) {
+ c = str[i];
+ if (len < 0 && c == '\0')
+ break;
+ switch (c) {
+ case '\"': case '\'': case '\\':
+ *s++ = '\\'; *s++ = c; break;
+ case '\f':
+ *s++ = '\\'; *s++ = 'f'; break;
+ case '\n':
+ *s++ = '\\'; *s++ = 'n'; break;
+ case '\r':
+ *s++ = '\\'; *s++ = 'r'; break;
+ case '\t':
+ *s++ = '\\'; *s++ = 't'; break;
+ case '\v':
+ *s++ = '\\'; *s++ = 'v'; break;
+ default:
+ if (isprint(c))
+ *s++ = c;
+ else if (i < n - 1 && isdigit(str[i + 1])) {
+ sprintf(s, "\\%03o", c);
+ s += 4;
+ }
+ else {
+ sprintf(s, "\\%o", c);
+ s += strlen(s);
+ }
+ break;
+ }
+ if (s > outend)
+ break;
+ }
+ }
+
+ *s++ = '\"';
+ if (i < len || (len < 0 && (i == n || s > outend))) {
+ *s++ = '.'; *s++ = '.'; *s++ = '.';
+ }
+ *s = '\0';
+ tprintf("%s", outstr);
+}
+
+void
+dumpstr(tcp, addr, len)
+struct tcb *tcp;
+long addr;
+int len;
+{
+ static int strsize = -1;
+ static unsigned char *str;
+ static char outstr[80];
+ char *s;
+ int i, j;
+
+ if (strsize < len) {
+ if (str)
+ free(str);
+ if ((str = malloc(len)) == NULL) {
+ fprintf(stderr, "dump: no memory\n");
+ return;
+ }
+ strsize = len;
+ }
+
+ if (umoven(tcp, addr, len, (char *) str) < 0)
+ return;
+
+ for (i = 0; i < len; i += 16) {
+ s = outstr;
+ sprintf(s, " | %05x ", i);
+ s += 9;
+ for (j = 0; j < 16; j++) {
+ if (j == 8)
+ *s++ = ' ';
+ if (i + j < len) {
+ sprintf(s, " %02x", str[i + j]);
+ s += 3;
+ }
+ else {
+ *s++ = ' '; *s++ = ' '; *s++ = ' ';
+ }
+ }
+ *s++ = ' '; *s++ = ' ';
+ for (j = 0; j < 16; j++) {
+ if (j == 8)
+ *s++ = ' ';
+ if (i + j < len) {
+ if (isprint(str[i + j]))
+ *s++ = str[i + j];
+ else
+ *s++ = '.';
+ }
+ else
+ *s++ = ' ';
+ }
+ tprintf("%s |\n", outstr);
+ }
+}
+
+#define PAGMASK (~(PAGSIZ - 1))
+/*
+ * move `len' bytes of data from process `pid'
+ * at address `addr' to our space at `laddr'
+ */
+int
+umoven(tcp, addr, len, laddr)
+struct tcb *tcp;
+long addr;
+int len;
+char *laddr;
+{
+
+#ifdef LINUX
+ int pid = tcp->pid;
+ int n, m;
+ union {
+ long val;
+ char x[sizeof(long)];
+ } u;
+
+ if (addr & (sizeof(long) - 1)) {
+ /* addr not a multiple of sizeof(long) */
+ n = addr - (addr & -sizeof(long)); /* residue */
+ addr &= -sizeof(long); /* residue */
+ errno = 0;
+ u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
+ if (errno) {
+ if (errno==EPERM || errno==EIO) {
+ /* Ran into 'end of memory' - stupid "printpath" */
+ return 0;
+ }
+ perror("ptrace: umoven");
+ return -1;
+ }
+ memcpy(laddr, &u.x[n], m = MIN(sizeof(long) - n, len));
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+ while (len) {
+ errno = 0;
+ u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
+ if (errno) {
+ if (errno==EPERM || errno==EIO) {
+ /* Ran into 'end of memory' - stupid "printpath" */
+ return 0;
+ }
+ perror("ptrace: umoven");
+ return -1;
+ }
+ memcpy(laddr, u.x, m = MIN(sizeof(long), len));
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+#endif /* LINUX */
+
+#ifdef SUNOS4
+ int pid = tcp->pid;
+#if 0
+ int n, m;
+ union {
+ long val;
+ char x[sizeof(long)];
+ } u;
+
+ if (addr & (sizeof(long) - 1)) {
+ /* addr not a multiple of sizeof(long) */
+ n = addr - (addr & -sizeof(long)); /* residue */
+ addr &= -sizeof(long); /* residue */
+ errno = 0;
+ u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
+ if (errno) {
+ perror("umoven");
+ return -1;
+ }
+ memcpy(laddr, &u.x[n], m = MIN(sizeof(long) - n, len));
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+ while (len) {
+ errno = 0;
+ u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
+ if (errno) {
+ perror("umoven");
+ return -1;
+ }
+ memcpy(laddr, u.x, m = MIN(sizeof(long), len));
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+#else /* !oldway */
+ int n;
+
+ while (len) {
+ n = MIN(len, PAGSIZ);
+ n = MIN(n, ((addr + PAGSIZ) & PAGMASK) - addr);
+ if (ptrace(PTRACE_READDATA, pid,
+ (char *) addr, len, laddr) < 0) {
+ perror("umoven: ptrace(PTRACE_READDATA, ...)");
+ abort();
+ return -1;
+ }
+ len -= n;
+ addr += n;
+ laddr += n;
+ }
+#endif /* !oldway */
+#endif /* SUNOS4 */
+
+#ifdef SVR4
+/*
+ * We would like to use pread preferentially for speed
+ * but even though SGI has it in their library, it no longer works.
+ */
+#ifdef MIPS
+#undef HAVE_PREAD
+#endif
+#ifdef HAVE_PREAD
+ if (pread(tcp->pfd, laddr, len, addr) == -1)
+ return -1;
+#else /* !HAVE_PREAD */
+ lseek(tcp->pfd, addr, SEEK_SET);
+ if (read(tcp->pfd, laddr, len) == -1)
+ return -1;
+#endif /* !HAVE_PREAD */
+#endif /* SVR4 */
+
+ return 0;
+}
+
+/*
+ * like `umove' but make the additional effort of looking
+ * for a terminating zero byte.
+ */
+int
+umovestr(tcp, addr, len, laddr)
+struct tcb *tcp;
+long addr;
+int len;
+char *laddr;
+{
+#ifdef SRVR4
+ return umoven(tcp, addr, len, laddr);
+#else /* !SVR4 */
+ int pid = tcp->pid;
+ int i, n, m;
+ union {
+ long val;
+ char x[sizeof(long)];
+ } u;
+
+ if (addr & (sizeof(long) - 1)) {
+ /* addr not a multiple of sizeof(long) */
+ n = addr - (addr & -sizeof(long)); /* residue */
+ addr &= -sizeof(long); /* residue */
+ errno = 0;
+ u.val = ptrace(PTRACE_PEEKDATA, pid, (char *)addr, 0);
+ if (errno) {
+ if (errno==EPERM || errno==EIO) {
+ /* Ran into 'end of memory' - stupid "printpath" */
+ return 0;
+ }
+ perror("umovestr");
+ return -1;
+ }
+ memcpy(laddr, &u.x[n], m = MIN(sizeof(long)-n,len));
+ while (n & (sizeof(long) - 1))
+ if (u.x[n++] == '\0')
+ return 0;
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+ while (len) {
+ errno = 0;
+ u.val = ptrace(PTRACE_PEEKDATA, pid, (char *)addr, 0);
+ if (errno) {
+ if (errno==EPERM || errno==EIO) {
+ /* Ran into 'end of memory' - stupid "printpath" */
+ return 0;
+ }
+ perror("umovestr");
+ return -1;
+ }
+ memcpy(laddr, u.x, m = MIN(sizeof(long), len));
+ for (i = 0; i < sizeof(long); i++)
+ if (u.x[i] == '\0')
+ return 0;
+
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+ return 0;
+#endif /* !SVR4 */
+}
+
+#ifdef LINUX
+#ifndef SPARC
+#define PTRACE_WRITETEXT 101
+#define PTRACE_WRITEDATA 102
+#endif /* !SPARC */
+#endif /* LINUX */
+
+#ifdef SUNOS4
+
+static int
+uload(cmd, pid, addr, len, laddr)
+int cmd;
+int pid;
+long addr;
+int len;
+char *laddr;
+{
+#if 0
+ int n;
+
+ while (len) {
+ n = MIN(len, PAGSIZ);
+ n = MIN(n, ((addr + PAGSIZ) & PAGMASK) - addr);
+ if (ptrace(cmd, pid, (char *)addr, n, laddr) < 0) {
+ perror("uload: ptrace(PTRACE_WRITE, ...)");
+ return -1;
+ }
+ len -= n;
+ addr += n;
+ laddr += n;
+ }
+#else
+ int peek, poke;
+ int n, m;
+ union {
+ long val;
+ char x[sizeof(long)];
+ } u;
+
+ if (cmd == PTRACE_WRITETEXT) {
+ peek = PTRACE_PEEKTEXT;
+ poke = PTRACE_POKETEXT;
+ }
+ else {
+ peek = PTRACE_PEEKDATA;
+ poke = PTRACE_POKEDATA;
+ }
+ if (addr & (sizeof(long) - 1)) {
+ /* addr not a multiple of sizeof(long) */
+ n = addr - (addr & -sizeof(long)); /* residue */
+ addr &= -sizeof(long);
+ errno = 0;
+ u.val = ptrace(peek, pid, (char *) addr, 0);
+ if (errno) {
+ perror("uload: POKE");
+ return -1;
+ }
+ memcpy(&u.x[n], laddr, m = MIN(sizeof(long) - n, len));
+ if (ptrace(poke, pid, (char *)addr, u.val) < 0) {
+ perror("uload: POKE");
+ return -1;
+ }
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+ while (len) {
+ if (len < sizeof(long))
+ u.val = ptrace(peek, pid, (char *) addr, 0);
+ memcpy(u.x, laddr, m = MIN(sizeof(long), len));
+ if (ptrace(poke, pid, (char *) addr, u.val) < 0) {
+ perror("uload: POKE");
+ return -1;
+ }
+ addr += sizeof(long), laddr += m, len -= m;
+ }
+#endif
+ return 0;
+}
+
+int
+tload(pid, addr, len, laddr)
+int pid;
+int addr, len;
+char *laddr;
+{
+ return uload(PTRACE_WRITETEXT, pid, addr, len, laddr);
+}
+
+int
+dload(pid, addr, len, laddr)
+int pid;
+int addr;
+int len;
+char *laddr;
+{
+ return uload(PTRACE_WRITEDATA, pid, addr, len, laddr);
+}
+
+#endif /* SUNOS4 */
+
+#ifndef SVR4
+
+int
+upeek(pid, off, res)
+int pid;
+long off;
+long *res;
+{
+ long val;
+
+#ifdef SUNOS4_KERNEL_ARCH_KLUDGE
+ {
+ static int is_sun4m = -1;
+ struct utsname name;
+
+ /* Round up the usual suspects. */
+ if (is_sun4m == -1) {
+ if (uname(&name) < 0) {
+ perror("upeek: uname?");
+ exit(1);
+ }
+ is_sun4m = strcmp(name.machine, "sun4m") == 0;
+ if (is_sun4m) {
+ extern struct xlat struct_user_offsets[];
+ struct xlat *x;
+
+ for (x = struct_user_offsets; x->str; x++)
+ x->val += 1024;
+ }
+ }
+ if (is_sun4m)
+ off += 1024;
+ }
+#endif /* SUNOS4_KERNEL_ARCH_KLUDGE */
+ errno = 0;
+ val = ptrace(PTRACE_PEEKUSER, pid, (char *) off, 0);
+ if (val == -1 && errno) {
+ perror("upeek: ptrace(PTRACE_PEEKUSER, ... )");
+ return -1;
+ }
+ *res = val;
+ return 0;
+}
+
+#endif /* !SVR4 */
+
+long
+getpc(tcp)
+struct tcb *tcp;
+{
+
+#ifdef LINUX
+ long pc;
+
+#ifdef I386
+ if (upeek(tcp->pid, 4*EIP, &pc) < 0)
+ return -1;
+#else /* !I386 */
+#ifdef ARM
+ if (upeek(tcp->pid, 4*15, &pc) < 0)
+ return -1;
+#else /* !ARM */
+#ifdef POWERPC
+ if (upeek(tcp->pid, 4*PT_NIP, &pc) < 0)
+ return -1;
+#else
+#ifdef M68K
+ if (upeek(tcp->pid, 4*PT_PC, &pc) < 0)
+ return -1;
+#else /* !M68K */
+#ifdef ALPHA
+ if (upeek(tcp->pid, REG_PC, &pc) < 0)
+ return -1;
+#else /* !ALPHA */
+#ifdef SPARC
+ struct pt_regs regs;
+ if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0)
+ return -1;
+ pc = regs.pc;
+#endif /* SPARC */
+#endif /* ALPHA */
+#endif /* !M68K */
+#endif /* !POWERPC */
+#endif /* !ARM */
+#endif /* !I386 */
+ return pc;
+#endif /* LINUX */
+
+#ifdef SUNOS4
+ /*
+ * Return current program counter for `pid'
+ * Assumes PC is never 0xffffffff
+ */
+ struct regs regs;
+
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *) &regs, 0) < 0) {
+ perror("getpc: ptrace(PTRACE_GETREGS, ...)");
+ return -1;
+ }
+ return regs.r_pc;
+#endif /* SUNOS4 */
+
+#ifdef SVR4
+ /* XXX */
+ return 0;
+#endif /* SVR4 */
+
+}
+
+void
+printcall(tcp)
+struct tcb *tcp;
+{
+
+#ifdef LINUX
+#ifdef I386
+ long eip;
+
+ if (upeek(tcp->pid, 4*EIP, &eip) < 0) {
+ tprintf("[????????] ");
+ return;
+ }
+ tprintf("[%08lx] ", eip);
+#else /* !I386K */
+#ifdef POWERPC
+ long pc;
+
+ if (upeek(tcp->pid, 4*PT_NIP, &pc) < 0) {
+ tprintf ("[????????] ");
+ return;
+ }
+ tprintf("[%08lx] ", pc);
+#else /* !POWERPC */
+#ifdef M68K
+ long pc;
+
+ if (upeek(tcp->pid, 4*PT_PC, &pc) < 0) {
+ tprintf ("[????????] ");
+ return;
+ }
+ tprintf("[%08lx] ", pc);
+#else /* !M68K */
+#ifdef ALPHA
+ long pc;
+
+ if (upeek(tcp->pid, REG_PC, &pc) < 0) {
+ tprintf ("[????????] ");
+ return;
+ }
+ tprintf("[%08lx] ", pc);
+#else /* !ALPHA */
+#ifdef SPARC
+ struct pt_regs regs;
+ if (ptrace(PTRACE_GETREGS,tcp->pid,(char *)&regs,0) < 0) {
+ tprintf("[????????] ");
+ return;
+ }
+ tprintf("[%08lx] ", regs.pc);
+#endif /* SPARC */
+#endif /* ALPHA */
+#endif /* !M68K */
+#endif /* !POWERPC */
+#endif /* !I386 */
+#endif /* LINUX */
+
+#ifdef SUNOS4
+ struct regs regs;
+
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *) &regs, 0) < 0) {
+ perror("printcall: ptrace(PTRACE_GETREGS, ...)");
+ tprintf("[????????] ");
+ return;
+ }
+ tprintf("[%08x] ", regs.r_o7);
+#endif /* SUNOS4 */
+
+#ifdef SVR4
+ /* XXX */
+ tprintf("[????????] ");
+#endif
+
+}
+
+#ifndef SVR4
+
+int
+setbpt(tcp)
+struct tcb *tcp;
+{
+
+#ifdef LINUX
+#ifdef SPARC
+ /* We simply use the SunOS breakpoint code. */
+
+ struct pt_regs regs;
+#define LOOPA 0x30800000 /* ba,a 0 */
+
+ if (tcp->flags & TCB_BPTSET) {
+ fprintf(stderr, "PANIC: TCB already set in pid %u\n", tcp->pid);
+ return -1;
+ }
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
+ perror("setbpt: ptrace(PTRACE_GETREGS, ...)");
+ return -1;
+ }
+ memmove (&regs.u_regs [1], &regs.u_regs [0],
+ sizeof (regs.u_regs) - sizeof (regs.u_regs [0]));
+ tcp->baddr = regs.u_regs[UREG_I7] + 8;
+ errno = 0;
+ tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)tcp->baddr, 0);
+ if(errno) {
+ perror("setbpt: ptrace(PTRACE_PEEKTEXT, ...)");
+ return -1;
+ }
+
+ /*
+ * XXX - BRUTAL MODE ON
+ * We cannot set a real BPT in the child, since it will not be
+ * traced at the moment it will reach the trap and would probably
+ * die with a core dump.
+ * Thus, we are force our way in by taking out two instructions
+ * and insert an eternal loop instead, in expectance of the SIGSTOP
+ * generated by out PTRACE_ATTACH.
+ * Of cause, if we evaporate ourselves in the middle of all this...
+ */
+ errno = 0;
+ ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, LOOPA);
+ if(errno) {
+ perror("setbpt: ptrace(PTRACE_POKETEXT, ...)");
+ return -1;
+ }
+ tcp->flags |= TCB_BPTSET;
+
+#else /* !SPARC */
+
+#if defined (I386)
+#define LOOP 0x0000feeb
+#elif defined (M68K)
+#define LOOP 0x60fe0000
+#elif defined (ALPHA)
+#define LOOP 0xc3ffffff
+#elif defined (POWERPC)
+#define LOOP 0x0000feeb
+#elif defined(ARM)
+#define LOOP -1 /* almost certainly wrong, jws */
+#else
+#error unknown architecture
+#endif
+
+ if (tcp->flags & TCB_BPTSET) {
+ fprintf(stderr, "PANIC: bpt already set in pid %u\n", tcp->pid);
+ return -1;
+ }
+#if defined (I386)
+ if (upeek(tcp->pid, 4*EIP, &tcp->baddr) < 0)
+ return -1;
+#elif defined (M68K)
+ if (upeek(tcp->pid, 4*PT_PC, &tcp->baddr) < 0)
+ return -1;
+#elif defined (ALPHA)
+ return -1;
+#elif defined (ARM)
+ return -1;
+#elif defined (POWERPC)
+ if (upeek(tcp->pid, 4*PT_NIP, &tcp->baddr) < 0)
+ return -1;
+#else
+#error unknown architecture
+#endif
+ if (debug)
+ fprintf(stderr, "[%d] setting bpt at %lx\n", tcp->pid, tcp->baddr);
+ tcp->inst[0] = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *) tcp->baddr, 0);
+ if (errno) {
+ perror("setbpt: ptrace(PTRACE_PEEKTEXT, ...)");
+ return -1;
+ }
+ ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, LOOP);
+ if (errno) {
+ perror("setbpt: ptrace(PTRACE_POKETEXT, ...)");
+ return -1;
+ }
+ tcp->flags |= TCB_BPTSET;
+
+#endif /* SPARC */
+#endif /* LINUX */
+
+#ifdef SUNOS4
+#ifdef SPARC /* This code is slightly sparc specific */
+
+ struct pt_regs regs;
+#define BPT 0x91d02001 /* ta 1 */
+#define LOOP 0x10800000 /* ba 0 */
+#define LOOPA 0x30800000 /* ba,a 0 */
+#define NOP 0x01000000
+#if LOOPA
+ static int loopdeloop[1] = {LOOPA};
+#else
+ static int loopdeloop[2] = {LOOP, NOP};
+#endif
+
+ if (tcp->flags & TCB_BPTSET) {
+ fprintf(stderr, "PANIC: TCB already set in pid %u\n", tcp->pid);
+ return -1;
+ }
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
+ perror("setbpt: ptrace(PTRACE_GETREGS, ...)");
+ return -1;
+ }
+ tcp->baddr = regs.r_o7 + 8;
+ if (ptrace(PTRACE_READTEXT, tcp->pid, (char *)tcp->baddr,
+ sizeof tcp->inst, (char *)tcp->inst) < 0) {
+ perror("setbpt: ptrace(PTRACE_READTEXT, ...)");
+ return -1;
+ }
+
+ /*
+ * XXX - BRUTAL MODE ON
+ * We cannot set a real BPT in the child, since it will not be
+ * traced at the moment it will reach the trap and would probably
+ * die with a core dump.
+ * Thus, we are force our way in by taking out two instructions
+ * and insert an eternal loop in stead, in expectance of the SIGSTOP
+ * generated by out PTRACE_ATTACH.
+ * Of cause, if we evaporate ourselves in the middle of all this...
+ */
+ if (ptrace(PTRACE_WRITETEXT, tcp->pid, (char *) tcp->baddr,
+ sizeof loopdeloop, (char *) loopdeloop) < 0) {
+ perror("setbpt: ptrace(PTRACE_WRITETEXT, ...)");
+ return -1;
+ }
+ tcp->flags |= TCB_BPTSET;
+
+#endif /* SPARC */
+#endif /* SUNOS4 */
+
+ return 0;
+}
+
+int
+clearbpt(tcp)
+struct tcb *tcp;
+{
+
+#ifdef LINUX
+#ifdef I386
+ long eip;
+#else /* !I386 */
+#ifdef POWERPC
+ long pc;
+#else /* !POWERPC */
+#ifdef M68K
+ long pc;
+#else /* !M68K */
+#ifdef ALPHA
+ long pc;
+#endif /* ALPHA */
+#endif /* !M68K */
+#endif /* !POWERPC */
+#endif /* !I386 */
+
+#ifdef SPARC
+ /* Again, we borrow the SunOS breakpoint code. */
+ if (!(tcp->flags & TCB_BPTSET)) {
+ fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid);
+ return -1;
+ }
+ errno = 0;
+ ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, tcp->inst[0]);
+ if(errno) {
+ perror("clearbtp: ptrace(PTRACE_POKETEXT, ...)");
+ return -1;
+ }
+ tcp->flags &= ~TCB_BPTSET;
+#else /* !SPARC */
+
+ if (debug)
+ fprintf(stderr, "[%d] clearing bpt\n", tcp->pid);
+ if (!(tcp->flags & TCB_BPTSET)) {
+ fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid);
+ return -1;
+ }
+ errno = 0;
+ ptrace(PTRACE_POKETEXT, tcp->pid, (char *) tcp->baddr, tcp->inst[0]);
+ if (errno) {
+ perror("clearbtp: ptrace(PTRACE_POKETEXT, ...)");
+ return -1;
+ }
+ tcp->flags &= ~TCB_BPTSET;
+
+#ifdef I386
+ if (upeek(tcp->pid, 4*EIP, &eip) < 0)
+ return -1;
+ if (eip != tcp->baddr) {
+ /* The breakpoint has not been reached yet. */
+ if (debug)
+ fprintf(stderr,
+ "NOTE: PC not at bpt (pc %#lx baddr %#lx)\n",
+ eip, tcp->baddr);
+ return 0;
+ }
+#else /* !I386 */
+#ifdef POWERPC
+ if (upeek(tcp->pid, 4*PT_NIP, &pc) < 0)
+ return -1;
+ if (pc != tcp->baddr) {
+ /* The breakpoint has not been reached yet. */
+ if (debug)
+ fprintf(stderr, "NOTE: PC not at bpt (pc %#lx baddr %#lx)\n",
+ pc, tcp->baddr);
+ return 0;
+ }
+#else /* !POWERPC */
+#ifdef M68K
+ if (upeek(tcp->pid, 4*PT_PC, &pc) < 0)
+ return -1;
+ if (pc != tcp->baddr) {
+ /* The breakpoint has not been reached yet. */
+ if (debug)
+ fprintf(stderr, "NOTE: PC not at bpt (pc %#lx baddr %#lx)\n",
+ pc, tcp->baddr);
+ return 0;
+ }
+#else /* !M68K */
+#ifdef ALPHA
+ if (upeek(tcp->pid, REG_PC, &pc) < 0)
+ return -1;
+ if (pc != tcp->baddr) {
+ /* The breakpoint has not been reached yet. */
+ if (debug)
+ fprintf(stderr, "NOTE: PC not at bpt (pc %#lx baddr %#lx)\n",
+ pc, tcp->baddr);
+ return 0;
+ }
+#endif /* ALPHA */
+#endif /* !M68K */
+#endif /* !POWERPC */
+#endif /* !I386 */
+#endif /* !SPARC */
+#endif /* LINUX */
+
+#ifdef SUNOS4
+#ifdef SPARC
+
+#if !LOOPA
+ struct pt_regs regs;
+#endif
+
+ if (!(tcp->flags & TCB_BPTSET)) {
+ fprintf(stderr, "PANIC: TCB not set in pid %u\n", tcp->pid);
+ return -1;
+ }
+ if (ptrace(PTRACE_WRITETEXT, tcp->pid, (char *) tcp->baddr,
+ sizeof tcp->inst, (char *) tcp->inst) < 0) {
+ perror("clearbtp: ptrace(PTRACE_WRITETEXT, ...)");
+ return -1;
+ }
+ tcp->flags &= ~TCB_BPTSET;
+
+#if !LOOPA
+ /*
+ * Since we don't have a single instruction breakpoint, we may have
+ * to adjust the program counter after removing the our `breakpoint'.
+ */
+ if (ptrace(PTRACE_GETREGS, tcp->pid, (char *)&regs, 0) < 0) {
+ perror("clearbpt: ptrace(PTRACE_GETREGS, ...)");
+ return -1;
+ }
+ if ((regs.r_pc < tcp->baddr) ||
+ (regs.r_pc > tcp->baddr + 4)) {
+ /* The breakpoint has not been reached yet */
+ if (debug)
+ fprintf(stderr,
+ "NOTE: PC not at bpt (pc %#x baddr %#x)\n",
+ regs.r_pc, tcp->parent->baddr);
+ return 0;
+ }
+ if (regs.r_pc != tcp->baddr)
+ if (debug)
+ fprintf(stderr, "NOTE: PC adjusted (%#x -> %#x\n",
+ regs.r_pc, tcp->baddr);
+
+ regs.r_pc = tcp->baddr;
+ if (ptrace(PTRACE_SETREGS, tcp->pid, (char *)&regs, 0) < 0) {
+ perror("clearbpt: ptrace(PTRACE_SETREGS, ...)");
+ return -1;
+ }
+#endif /* LOOPA */
+#endif /* SPARC */
+#endif /* SUNOS4 */
+
+ return 0;
+}
+
+#endif /* !SVR4 */
+
+#ifdef SUNOS4
+
+static int
+getex(pid, hdr)
+int pid;
+struct exec *hdr;
+{
+ int n;
+
+ for (n = 0; n < sizeof *hdr; n += 4) {
+ long res;
+ if (upeek(pid, uoff(u_exdata) + n, &res) < 0)
+ return -1;
+ memcpy(((char *) hdr) + n, &res, 4);
+ }
+ if (debug) {
+ fprintf(stderr, "[struct exec: magic: %o version %u Mach %o\n",
+ hdr->a_magic, hdr->a_toolversion, hdr->a_machtype);
+ fprintf(stderr, "Text %lu Data %lu Bss %lu Syms %lu Entry %#lx]\n",
+ hdr->a_text, hdr->a_data, hdr->a_bss, hdr->a_syms, hdr->a_entry);
+ }
+ return 0;
+}
+
+int
+fixvfork(tcp)
+struct tcb *tcp;
+{
+ int pid = tcp->pid;
+ /*
+ * Change `vfork' in a freshly exec'ed dynamically linked
+ * executable's (internal) symbol table to plain old `fork'
+ */
+
+ struct exec hdr;
+ struct link_dynamic dyn;
+ struct link_dynamic_2 ld;
+ char *strtab, *cp;
+
+ if (getex(pid, &hdr) < 0)
+ return -1;
+ if (!hdr.a_dynamic)
+ return -1;
+
+ if (umove(tcp, (int) N_DATADDR(hdr), &dyn) < 0) {
+ fprintf(stderr, "Cannot read DYNAMIC\n");
+ return -1;
+ }
+ if (umove(tcp, (int) dyn.ld_un.ld_2, &ld) < 0) {
+ fprintf(stderr, "Cannot read link_dynamic_2\n");
+ return -1;
+ }
+ if ((strtab = malloc((unsigned)ld.ld_symb_size)) == NULL) {
+ fprintf(stderr, "fixvfork: out of memory\n");
+ return -1;
+ }
+ if (umoven(tcp, (int)ld.ld_symbols+(int)N_TXTADDR(hdr),
+ (int)ld.ld_symb_size, strtab) < 0)
+ goto err;
+
+#if 0
+ for (cp = strtab; cp < strtab + ld.ld_symb_size; ) {
+ fprintf(stderr, "[symbol: %s]\n", cp);
+ cp += strlen(cp)+1;
+ }
+ return 0;
+#endif
+ for (cp = strtab; cp < strtab + ld.ld_symb_size; ) {
+ if (strcmp(cp, "_vfork") == 0) {
+ if (debug)
+ fprintf(stderr, "fixvfork: FOUND _vfork\n");
+ strcpy(cp, "_fork");
+ break;
+ }
+ cp += strlen(cp)+1;
+ }
+ if (cp < strtab + ld.ld_symb_size)
+ /*
+ * Write entire symbol table back to avoid
+ * memory alignment bugs in ptrace
+ */
+ if (tload(pid, (int)ld.ld_symbols+(int)N_TXTADDR(hdr),
+ (int)ld.ld_symb_size, strtab) < 0)
+ goto err;
+
+ free(strtab);
+ return 0;
+
+err:
+ free(strtab);
+ return -1;
+}
+
+#endif /* SUNOS4 */
diff --git a/version.c b/version.c
new file mode 100644
index 000000000..d9fd90e9a
--- /dev/null
+++ b/version.c
@@ -0,0 +1 @@
+char version[] = "strace -- version 3.1.0.1";
diff --git a/xlate.el b/xlate.el
new file mode 100644
index 000000000..cd083a1b7
--- /dev/null
+++ b/xlate.el
@@ -0,0 +1,80 @@
+;; Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+;; 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. The name of the author may not be used to endorse or promote products
+;; derived from this software without specific prior written permission.
+;;
+;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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: Automate the construction of strace xlat tables.
+
+;; Usage: Put point and mark around a set of definitions in a header
+;; file. Then grab them with C-c G. Switch to the strace source file
+;; and build the xlat table with C-c B. Then type the name of the table.
+
+(global-set-key "\C-cG" 'grab-xlate)
+(global-set-key "\C-cB" 'build-xlate)
+
+(defvar xlate-list nil
+ "See grab-xlate and build-xlate.")
+
+(defun grab-xlate (beg end)
+ "Grab all of the defined names in the region and save them in xlate-list."
+ (interactive "r")
+ (save-excursion
+ (setq xlate-list nil)
+ (goto-char beg)
+ (beginning-of-line)
+ (while (< (point) end)
+ (and (looking-at "^#[ \t]*define[ \t]+\\([A-Za-z0-9_]+\\)[ \t]+")
+ (setq xlate-list (cons (buffer-substring (match-beginning 1)
+ (match-end 1))
+ xlate-list)))
+ (forward-line)))
+ (and (fboundp 'deactivate-mark)
+ (deactivate-mark))
+ (setq xlate-list (nreverse xlate-list)))
+
+(defun build-xlate (&optional list)
+ "Build and insert an strace xlat table based on the last grab."
+ (interactive)
+ (or list
+ (setq list xlate-list))
+ (beginning-of-line)
+ (save-excursion
+ (insert "static struct xlat ?[] = {\n")
+ (while list
+ (insert "\t{ " (car list) ",\n")
+ (backward-char)
+ (move-to-column 24 'force)
+ (end-of-line)
+ (insert "\"" (car list) "\"")
+ (move-to-column 40 'force)
+ (end-of-line)
+ (insert "},")
+ (forward-line)
+ (setq list (cdr list)))
+ (insert " { 0, NULL },\n")
+ (insert "};\n")
+ (insert "\n"))
+ (search-forward "?")
+ (delete-backward-char 1))