home *** CD-ROM | disk | FTP | other *** search
- From: jrs@world.std.com (Rick Sladkey)
- Newsgroups: comp.sources.misc
- Subject: v43i083: strace - system call tracer for sunos, linux, svr4, solaris2, Part09/10
- Date: 9 Jul 1994 15:50:13 -0500
- Organization: Sterling Software
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <2vn2i5$9ia@sparky.sterling.com>
- X-Md4-Signature: e8b92868bae9f72ac7420a5199208f9a
-
- Submitted-by: jrs@world.std.com (Rick Sladkey)
- Posting-number: Volume 43, Issue 83
- Archive-name: strace/part09
- Environment: sunos, linux, svr4, solaris
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: strace-3.0/INSTALL strace-3.0/aclocal.m4 strace-3.0/io.c
- # strace-3.0/ioctlsort.c strace-3.0/linux/dummy.h
- # strace-3.0/linux/syscall.h strace-3.0/mem.c strace-3.0/proc.c
- # strace-3.0/sunos4/syscall.h strace-3.0/time.c
- # Wrapped by kent@sparky on Sat Jul 9 15:42:58 1994
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 9 (of 10)."'
- if test -f 'strace-3.0/INSTALL' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/INSTALL'\"
- else
- echo shar: Extracting \"'strace-3.0/INSTALL'\" \(5776 characters\)
- sed "s/^X//" >'strace-3.0/INSTALL' <<'END_OF_FILE'
- XThis is a generic INSTALL file for utilities distributions.
- XIf this package does not come with, e.g., installable documentation or
- Xdata files, please ignore the references to them below.
- X
- XTo compile this package:
- X
- X1. Configure the package for your system. In the directory that this
- Xfile is in, type `./configure'. If you're using `csh' on an old
- Xversion of System V, you might need to type `sh configure' instead to
- Xprevent `csh' from trying to execute `configure' itself.
- X
- XThe `configure' shell script attempts to guess correct values for
- Xvarious system-dependent variables used during compilation, and
- Xcreates the Makefile(s) (one in each subdirectory of the source
- Xdirectory). In some packages it creates a C header file containing
- Xsystem-dependent definitions. It also creates a file `config.status'
- Xthat you can run in the future to recreate the current configuration.
- X
- XRunning `configure' takes a minute or two. While it is running, it
- Xprints some messages that tell what it is doing. If you don't want to
- Xsee the messages, run `configure' with its standard output redirected
- Xto `/dev/null'; for example, `./configure >/dev/null'.
- X
- XTo compile the package in a different directory from the one
- Xcontaining the source code, you must use a version of `make' that
- Xsupports the VPATH variable, such as GNU `make'. `cd' to the directory
- Xwhere you want the object files and executables to go and run
- X`configure'. `configure' automatically checks for the source code in
- Xthe directory that `configure' is in and in `..'. If for some reason
- X`configure' is not in the source code directory that you are
- Xconfiguring, then it will report that it can't find the source code.
- XIn that case, run `configure' with the option `--srcdir=DIR', where
- XDIR is the directory that contains the source code.
- X
- XBy default, `make install' will install the package's files in
- X/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify an
- Xinstallation prefix other than /usr/local by giving `configure' the option
- X`--prefix=PATH'. Alternately, you can do so by consistently giving a value
- Xfor the `prefix' variable when you run `make', e.g.,
- X make prefix=/usr/gnu
- X make prefix=/usr/gnu install
- X
- XYou can specify separate installation prefixes for
- Xarchitecture-specific files and architecture-independent files. If
- Xyou give `configure' the option `--exec-prefix=PATH' or set the
- X`make' variable `exec_prefix' to PATH, the package will use PATH as
- Xthe prefix for installing programs and libraries. Data files and
- Xdocumentation will still use the regular prefix. Normally, all files
- Xare installed using the regular prefix.
- X
- XAnother `configure' option is useful mainly in `Makefile' rules for
- Xupdating `config.status' and `Makefile'. The `--no-create' option
- Xfigures out the configuration for your system and records it in
- X`config.status', without actually configuring the package (creating
- X`Makefile's and perhaps a configuration header file). Later, you can
- Xrun `./config.status' to actually configure the package. You can also
- Xgive `config.status' the `--recheck' option, which makes it re-run
- X`configure' with the same arguments you used before. This option is
- Xuseful if you change `configure'.
- X
- XSome packages pay attention to `--with-PACKAGE' options to `configure',
- Xwhere PACKAGE is something like `gnu-libc' or `x' (for the X Window System).
- XThe README should mention any --with- options that the package recognizes.
- X
- X`configure' ignores any other arguments that you give it.
- X
- XIf your system requires unusual options for compilation or linking
- Xthat `configure' doesn't know about, you can give `configure' initial
- Xvalues for some variables by setting them in the environment. In
- XBourne-compatible shells, you can do that on the command line like
- Xthis:
- X CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
- X
- XThe `make' variables that you might want to override with environment
- Xvariables when running `configure' are:
- X
- X(For these variables, any value given in the environment overrides the
- Xvalue that `configure' would choose:)
- XCC C compiler program.
- X Default is `cc', or `gcc' if `gcc' is in your PATH.
- XINSTALL Program to use to install files.
- X Default is `install' if you have it, `cp' otherwise.
- X
- X(For these variables, any value given in the environment is added to
- Xthe value that `configure' chooses:)
- XDEFS Configuration options, in the form `-Dfoo -Dbar ...'
- X Do not use this variable in packages that create a
- X configuration header file.
- XLIBS Libraries to link with, in the form `-lfoo -lbar ...'
- X
- XIf you need to do unusual things to compile the package, we encourage
- Xyou to figure out how `configure' could check whether to do them, and
- Xmail diffs or instructions to the address given in the README so we
- Xcan include them in the next release.
- X
- X2. Type `make' to compile the package. If you want, you can override
- Xthe `make' variables CFLAGS and LDFLAGS like this:
- X
- X make CFLAGS=-O2 LDFLAGS=-s
- X
- X3. If the package comes with self-tests and you want to run them,
- Xtype `make check'. If you're not sure whether there are any, try it;
- Xif `make' responds with something like
- X make: *** No way to make target `check'. Stop.
- Xthen the package does not come with self-tests.
- X
- X4. Type `make install' to install programs, data files, and
- Xdocumentation.
- X
- X5. You can remove the program binaries and object files from the
- Xsource directory by typing `make clean'. To also remove the
- XMakefile(s), the header file containing system-dependent definitions
- X(if the package uses one), and `config.status' (all the files that
- X`configure' created), type `make distclean'.
- X
- XThe file `configure.in' is used as a template to create `configure' by
- Xa program called `autoconf'. You will only need it if you want to
- Xregenerate `configure' using a newer version of `autoconf'.
- END_OF_FILE
- if test 5776 -ne `wc -c <'strace-3.0/INSTALL'`; then
- echo shar: \"'strace-3.0/INSTALL'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/INSTALL'
- fi
- if test -f 'strace-3.0/aclocal.m4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/aclocal.m4'\"
- else
- echo shar: Extracting \"'strace-3.0/aclocal.m4'\" \(5964 characters\)
- sed "s/^X//" >'strace-3.0/aclocal.m4' <<'END_OF_FILE'
- Xdnl A macro to redefine AC_PARSEARGS to recognize the host options.
- Xdefine(AC_PARSEHOST,
- X[undefine([AC_PARSEARGS])dnl
- Xdefine(AC_PARSEARGS,
- X[for arg
- Xdo
- X # Handle --exec-prefix with a space before the argument.
- X if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
- X # Handle --host with a space before the argument.
- X elif test x$next_host = xyes; then host=$arg; next_host=
- X # Handle --prefix with a space before the argument.
- X elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
- X # Handle --srcdir with a space before the argument.
- X elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
- X else
- X case $arg in
- X # For backward compatibility, recognize -exec-prefix and --exec_prefix.
- X -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
- Xchangequote(,)dnl
- X exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- Xchangequote([,])dnl
- X -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
- X next_exec_prefix=yes ;;
- X
- X -gas | --gas | --ga | --g) ;;
- X
- X -host=* | --host=* | --hos=* | --ho=* | --h=*)
- Xchangequote(,)dnl
- X host=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- Xchangequote([,])dnl
- X -host | --host | --hos | --ho | --h)
- X next_host=yes ;;
- X
- X -nfp | --nfp | --nf) ;;
- X
- X -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- Xchangequote(,)dnl
- X prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- Xchangequote([,])dnl
- X -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- X next_prefix=yes ;;
- X
- X -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
- Xchangequote(,)dnl
- X srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- Xchangequote([,])dnl
- X -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
- X next_srcdir=yes ;;
- X
- X -with-* | --with-*)
- X package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
- X # Reject names that aren't valid shell variable names.
- Xchangequote(,)dnl
- X if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- Xchangequote([,])dnl
- X echo "configure: $package: invalid package name" >&2; exit 1
- X fi
- X package=`echo $package| sed 's/-/_/g'`
- X case "$arg" in
- Xchangequote(,)dnl
- X *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
- Xchangequote([,])dnl
- X *) val=1 ;;
- X esac
- X eval "with_$package='$val'" ;;
- X
- X -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
- X verbose=yes ;;
- X
- X -*) ;;
- X
- X *)
- X host=$arg ;;
- X esac
- X fi
- Xdone
- X])])dnl
- Xdnl
- Xdnl A macro to run config.guess and config.sub if necessary and set
- Xdnl the shell variables $host and $canonical_host.
- Xdefine(AC_HOST,
- X[# Maybe guess the host type.
- Xif test -z "$host"
- Xthen
- X guesssys=`echo [$]0 | sed 's/configure$/config.guess/'`
- X if host=`$guesssys`
- X then
- X :
- X else
- X echo 'Failed to guess the host type. You need to tell me.' >&2
- X exit 1
- X fi
- Xfi
- X
- X# Canonicalize the host type.
- Xecho "checking the host type"
- Xif canonical_host=`${srcdir}/config.sub "${host}"`
- Xthen
- X :
- Xelse
- X exit 1
- Xfi
- X
- Xtest -n "$verbose" &&
- X echo " host type is $host"
- Xtest -n "$verbose" &&
- X echo " canonical name is $canonical_host"
- X])dnl
- Xdnl
- Xdnl A macro to find the include directory, useful for cross-compiling.
- Xdefine(AC_INCLUDEDIR,
- X[AC_REQUIRE([AC_PROG_AWK])dnl
- XAC_SUBST(includedir)
- Xecho checking for include directory
- Xincludedir=/usr/include
- Xif test -n "$GCC"
- Xthen
- X >conftest.c
- X includedir=`
- X $CC -v -E conftest.c 2>&1 | $AWK '
- X /^End of search list/ { print last; exit }
- X { last = [$]1 }
- X '
- X `
- X rm -f conftest.c
- X if test -n "$includedir" && test -d "$includedir"
- X then
- X test -n "$verbose" &&
- X echo " setting includedir to $includedir"
- X else
- X includedir=/usr/include
- X fi
- Xelse
- X test -n "$verbose" &&
- X echo " nothing happens"
- Xfi
- X])dnl
- Xdnl
- Xdnl A macro to automatically set different CC and HOSTCC if using gcc.
- Xdefine(AC_PROG_HOSTCC,
- X[AC_SUBST(HOSTCC)dnl
- Xif test -z "$HOSTCC"
- Xthen
- X HOSTCC="$CC"
- X if test -n "$GCC"
- X then
- X # Find out if gcc groks our host.
- X worked=
- X last=
- X for i in $1
- X do
- X test "x$i" = "x$last" && continue
- X last="$i"
- X CC="$HOSTCC -b $i"
- X AC_COMPILE_CHECK([working $CC],,,
- X [worked=1
- X test -n "$verbose" &&
- X echo " setting CC to $CC"
- X break])
- X done
- X if test -z "$worked"
- X then
- X CC="$HOSTCC"
- X fi
- X fi
- Xfi
- Xtest "x$HOSTCC" != "x$CC" &&
- X test -n "$verbose" &&
- X echo " setting HOSTCC to $HOSTCC"
- X])dnl
- Xdnl
- Xdnl A macro to set gcc warning flags.
- Xdefine(AC_WARNFLAGS,
- X[AC_SUBST(WARNFLAGS)
- Xif test -z "$WARNFLAGS"
- Xthen
- X if test -n "$GCC"
- X then
- X # If we're using gcc we want warning flags.
- X WARNFLAGS=-Wall
- X fi
- Xfi
- X])dnl
- Xdnl
- Xdnl A macro to determine if procfs is pollable.
- Xdefine(AC_POLLABLE_PROCFS,
- X[echo "checking for pollable procfs"
- XAC_TEST_PROGRAM([
- X#include <stdio.h>
- X#include <signal.h>
- X#include <sys/procfs.h>
- X#include <sys/stropts.h>
- X#include <poll.h>
- X
- Xmain()
- X{
- X int pid;
- X char proc[32];
- X FILE *pfp;
- X struct pollfd pfd;
- X
- X if ((pid = fork()) == 0) {
- X pause();
- X exit(0);
- X }
- X sprintf(proc, "/proc/%d", pid);
- X if ((pfp = fopen(proc, "r+")) == NULL)
- X goto fail;
- X if (ioctl(fileno(pfp), PIOCSTOP, NULL) < 0)
- X goto fail;
- X pfd.fd = fileno(pfp);
- X pfd.events = POLLPRI;
- X if (poll(&pfd, 1, 0) < 0)
- X goto fail;
- X if (!(pfd.revents & POLLPRI))
- X goto fail;
- X kill(pid, SIGKILL);
- X exit(0);
- Xfail:
- X kill(pid, SIGKILL);
- X exit(1);
- X}
- X],
- XAC_DEFINE(HAVE_POLLABLE_PROCFS))
- X])dnl
- Xdnl
- Xdnl A macro to determine if the prstatus structure has a pr_syscall member.
- Xdefine(AC_PR_SYSCALL,
- X[AC_COMPILE_CHECK([pr_syscall in struct prstatus],
- X[#include <sys/procfs.h>], [struct prstatus s; s.pr_syscall;],
- XAC_DEFINE(HAVE_PR_SYSCALL))])dnl
- Xdnl
- Xdnl A macro to detect the presence of the sig_atomic_t in signal.h
- Xdefine(AC_SIG_ATOMIC_T,
- X[AC_COMPILE_CHECK([sig_atomic_t in signal.h],
- X[#include <signal.h>],
- X[sig_atomic_t x;],
- XAC_DEFINE(HAVE_SIG_ATOMIC_T))
- X])dnl
- Xdnl
- END_OF_FILE
- if test 5964 -ne `wc -c <'strace-3.0/aclocal.m4'`; then
- echo shar: \"'strace-3.0/aclocal.m4'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/aclocal.m4'
- fi
- if test -f 'strace-3.0/io.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/io.c'\"
- else
- echo shar: Extracting \"'strace-3.0/io.c'\" \(4872 characters\)
- sed "s/^X//" >'strace-3.0/io.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
- X * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * io.c,v 2.24 1994/06/29 04:43:21 jrs Exp
- X */
- X
- X#include "defs.h"
- X
- X#include <fcntl.h>
- X#include <sys/uio.h>
- X
- Xint
- Xsys_read(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%d, ", tcp->u_arg[0]);
- X } else {
- X if (syserror(tcp))
- X tprintf("%#x", tcp->u_arg[1]);
- X else
- X printstr(tcp, tcp->u_arg[1], tcp->u_rval);
- X tprintf(", %u", tcp->u_arg[2]);
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_write(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%d, ", tcp->u_arg[0]);
- X printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
- X tprintf(", %u", tcp->u_arg[2]);
- X }
- X return 0;
- X}
- X
- X#ifndef LINUX
- X
- Xint
- Xsys_readv(tcp)
- Xstruct tcb *tcp;
- X{
- X struct iovec *iov;
- X int i, len;
- X
- X if (entering(tcp)) {
- X tprintf("%d, ", tcp->u_arg[0]);
- X } else {
- X if (syserror(tcp)) {
- X tprintf("%#x, %u",
- X tcp->u_arg[1], tcp->u_arg[2]);
- X return 0;
- X }
- X len = tcp->u_arg[2];
- X if ((iov = (struct iovec *) malloc(len * sizeof *iov)) == NULL) {
- X fprintf(stderr, "No memory");
- X return 0;
- X }
- X if (umoven(tcp, tcp->u_arg[1],
- X len * sizeof *iov, (char *) iov) < 0) {
- X tprintf("%#x", tcp->u_arg[1]);
- X } else {
- X tprintf("[");
- X for (i = 0; i < len; i++) {
- X if (i)
- X tprintf(", ");
- X tprintf("{");
- X printstr(tcp, (int) iov[i].iov_base,
- X iov[i].iov_len);
- X tprintf(", %u}", iov[i].iov_len);
- X }
- X tprintf("]");
- X }
- X free((char *) iov);
- X tprintf(", %u", tcp->u_arg[2]);
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_writev(tcp)
- Xstruct tcb *tcp;
- X{
- X struct iovec *iov;
- X int i, len;
- X
- X if (entering(tcp)) {
- X tprintf("%d, ", tcp->u_arg[0]);
- X len = tcp->u_arg[2];
- X iov = (struct iovec *) malloc(len * sizeof *iov);
- X if (iov == NULL) {
- X fprintf(stderr, "No memory");
- X return 0;
- X }
- X if (umoven(tcp, tcp->u_arg[1],
- X len * sizeof *iov, (char *) iov) < 0) {
- X tprintf("%#x", tcp->u_arg[1]);
- X } else {
- X tprintf("[");
- X for (i = 0; i < len; i++) {
- X if (i)
- X tprintf(", ");
- X tprintf("{");
- X printstr(tcp, (int) iov[i].iov_base,
- X iov[i].iov_len);
- X tprintf(", %u}", iov[i].iov_len);
- X }
- X tprintf("]");
- X }
- X free((char *) iov);
- X tprintf(", %u", tcp->u_arg[2]);
- X }
- X return 0;
- X}
- X
- X#endif /* !LINUX */
- X
- X#ifdef SVR4
- X
- Xint
- Xsys_pread(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%d, ", tcp->u_arg[0]);
- X } else {
- X if (syserror(tcp))
- X tprintf("%#x", tcp->u_arg[1]);
- X else
- X printstr(tcp, tcp->u_arg[1], tcp->u_rval);
- X tprintf(", %u, %u", tcp->u_arg[2], tcp->u_arg[3]);
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_pwrite(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%d, ", tcp->u_arg[0]);
- X printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
- X tprintf(", %u, %u", tcp->u_arg[2], tcp->u_arg[3]);
- X }
- X return 0;
- X}
- X
- X#endif /* SVR4 */
- X
- Xint
- Xsys_ioctl(tcp)
- Xstruct tcb *tcp;
- X{
- X char *symbol;
- X
- X if (entering(tcp)) {
- X tprintf("%d, ", tcp->u_arg[0]);
- X symbol = ioctl_lookup(tcp->u_arg[1]);
- X if (symbol)
- X tprintf("%s", symbol);
- X else
- X tprintf("%#x", tcp->u_arg[1]);
- X ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
- X }
- X else {
- X if (ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]) == 0)
- X tprintf(", %#x", tcp->u_arg[2]);
- X }
- X return 0;
- X}
- END_OF_FILE
- if test 4872 -ne `wc -c <'strace-3.0/io.c'`; then
- echo shar: \"'strace-3.0/io.c'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/io.c'
- fi
- if test -f 'strace-3.0/ioctlsort.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/ioctlsort.c'\"
- else
- echo shar: Extracting \"'strace-3.0/ioctlsort.c'\" \(2496 characters\)
- sed "s/^X//" >'strace-3.0/ioctlsort.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * ioctlsort.c,v 2.2 1994/03/12 23:11:44 jrs Exp
- X */
- X
- X#ifdef HAVE_CONFIG_H
- X#include "config.h"
- X#endif
- X
- X#include <stdio.h>
- X
- X#ifdef STDC_HEADERS
- X#include <stdlib.h>
- X#endif
- X
- Xstruct ioctlent {
- X char *doth;
- X char *symbol;
- X long code;
- X};
- X
- X#include "ioctlent.raw"
- X
- Xint nioctlent = sizeof ioctlent / sizeof ioctlent[0];
- X
- Xint
- Xcompare(a, b)
- Xconst void *a;
- Xconst void *b;
- X{
- X return ((struct ioctlent *) a)->code - ((struct ioctlent *) b)->code;
- X}
- X
- Xint
- Xmain(argc, argv)
- Xint argc;
- Xchar *argv[];
- X{
- X int i;
- X
- X qsort(ioctlent, nioctlent, sizeof ioctlent[0], compare);
- X for (i = 0; i < nioctlent; i++) {
- X printf("{\"%s\",\t\"%s\",\t%#lx},\n",
- X ioctlent[i].doth, ioctlent[i].symbol, ioctlent[i].code);
- X }
- X return 0;
- X}
- END_OF_FILE
- if test 2496 -ne `wc -c <'strace-3.0/ioctlsort.c'`; then
- echo shar: \"'strace-3.0/ioctlsort.c'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/ioctlsort.c'
- fi
- if test -f 'strace-3.0/linux/dummy.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/linux/dummy.h'\"
- else
- echo shar: Extracting \"'strace-3.0/linux/dummy.h'\" \(6202 characters\)
- sed "s/^X//" >'strace-3.0/linux/dummy.h' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * dummy.h,v 2.19 1994/03/12 23:12:13 jrs Exp
- X */
- X
- X/* still unfinished */
- X#define sys_reboot printargs
- X#define sys_ioperm printargs
- X#define sys_syslog printargs
- X#define sys_iopl printargs
- X#define sys_vm86 printargs
- X#define sys_modify_ldt printargs
- X#define sys_init_module printargs
- X#define sys_get_kernel_syms printargs
- X#define sys_quotactl printargs
- X
- X/* like another call */
- X#define sys_uselib sys_chdir
- X#define sys_umount sys_chdir
- X#define sys_swapon sys_chdir
- X#define sys_swapoff sys_chdir
- X#define sys_clone sys_fork
- X#define sys_create_module sys_sethostname
- X#define sys_delete_module sys_chdir
- X
- X/* printargs does the right thing */
- X#define sys_setup printargs
- X#define sys_getpid printargs
- X#define sys_getuid printargs
- X#define sys_pause printargs
- X#define sys_sync printargs
- X#define sys_getgid printargs
- X#define sys_geteuid printargs
- X#define sys_getegid printargs
- X#define sys_getppid printargs
- X#define sys_getpgrp printargs
- X#define sys_setsid printargs
- X#define sys_vhangup printargs
- X#define sys_idle printargs
- X#define sys_getpgid printargs
- X#define sys_fchdir printargs
- X#define sys_bdflush printargs
- X
- X/* subcall entry points */
- X#define sys_socketcall printargs
- X#define sys_ipc printargs
- X
- X/* unimplemented */
- X#define sys_stty printargs
- X#define sys_gtty printargs
- X#define sys_ftime printargs
- X#define sys_prof printargs
- X#define sys_acct printargs
- X#define sys_phys printargs
- X#define sys_lock printargs
- X#define sys_mpx printargs
- X#define sys_ulimit printargs
- X#define sys_profil printargs
- X#define sys_ustat printargs
- X#define sys_break printargs
- X
- X/* deprecated */
- X#define sys_oldstat printargs
- X#define sys_oldlstat printargs
- X#define sys_oldfstat printargs
- X#define sys_olduname printargs
- X#define sys_oldolduname printargs
- X
- X#if DONE
- X#define sys_stime printargs
- X#define sys_time printargs
- X#define sys_times printargs
- X#define sys_mount printargs
- X#define sys_nice printargs
- X#define sys_mprotect printargs
- X#define sys_sigprocmask printargs
- X#define sys_adjtimex printargs
- X#define sys_sysinfo printargs
- X#define sys_ipc printargs
- X#define sys_setdomainname printargs
- X#define sys_statfs printargs
- X#define sys_fstatfs printargs
- X#define sys_ptrace printargs
- X#define sys_sigreturn printargs
- X#define sys_fsync printargs
- X#define sys_alarm printargs
- X#define sys_socketcall printargs
- X#define sys_sigsuspend printargs
- X#define sys_utime printargs
- X#define sys_brk printargs
- X#define sys_mmap printargs
- X#define sys_munmap printargs
- X#define sys_select printargs
- X#define sys_setuid printargs
- X#define sys_setgid printargs
- X#define sys_setreuid printargs
- X#define sys_setregid printargs
- X#define sys_getgroups printargs
- X#define sys_setgroups printargs
- X#define sys_setrlimit printargs
- X#define sys_getrlimit printargs
- X#define sys_getrusage printargs
- X#define sys_getpriority printargs
- X#define sys_setpriority printargs
- X#define sys_setpgid printargs
- X#define sys_access printargs
- X#define sys_sethostname printargs
- X#define sys_readdir printargs
- X#define sys_waitpid printargs
- X#define sys_wait4 printargs
- X#define sys_execve printargs
- X#define sys_fork printargs
- X#define sys_uname printargs
- X#define sys_pipe printargs
- X#define sys_siggetmask printargs
- X#define sys_sigsetmask printargs
- X#define sys_exit printargs
- X#define sys_kill printargs
- X#define sys_signal printargs
- X#define sys_sigaction printargs
- X#define sys_sigpending printargs
- X#define sys_fcntl printargs
- X#define sys_dup printargs
- X#define sys_dup2 printargs
- X#define sys_close printargs
- X#define sys_ioctl printargs
- X#define sys_read printargs
- X#define sys_write printargs
- X#define sys_open printargs
- X#define sys_creat printargs
- X#define sys_link printargs
- X#define sys_unlink printargs
- X#define sys_chdir printargs
- X#define sys_mknod printargs
- X#define sys_chmod printargs
- X#define sys_chown printargs
- X#define sys_lseek printargs
- X#define sys_rename printargs
- X#define sys_mkdir printargs
- X#define sys_rmdir printargs
- X#define sys_umask printargs
- X#define sys_chroot printargs
- X#define sys_gettimeofday printargs
- X#define sys_settimeofday printargs
- X#define sys_symlink printargs
- X#define sys_readlink printargs
- X#define sys_truncate printargs
- X#define sys_ftruncate printargs
- X#define sys_fchmod printargs
- X#define sys_fchown printargs
- X#define sys_setitimer printargs
- X#define sys_getitimer printargs
- X#define sys_stat printargs
- X#define sys_lstat printargs
- X#define sys_fstat printargs
- X#endif
- END_OF_FILE
- if test 6202 -ne `wc -c <'strace-3.0/linux/dummy.h'`; then
- echo shar: \"'strace-3.0/linux/dummy.h'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/linux/dummy.h'
- fi
- if test -f 'strace-3.0/linux/syscall.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/linux/syscall.h'\"
- else
- echo shar: Extracting \"'strace-3.0/linux/syscall.h'\" \(5719 characters\)
- sed "s/^X//" >'strace-3.0/linux/syscall.h' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * syscall.h,v 2.18 1994/03/12 23:12:15 jrs Exp
- X */
- X
- X#include "dummy.h"
- X
- X/* primary syscalls */
- X
- Xint sys_setup(), sys_exit(), sys_fork(), sys_read(), sys_write();
- Xint sys_open(), sys_close(), sys_waitpid(), sys_creat(), sys_link();
- Xint sys_unlink(), sys_execve(), sys_chdir(), sys_time(), sys_mknod();
- Xint sys_chmod(), sys_chown(), sys_break(), sys_oldstat();
- Xint sys_lseek(), sys_getpid(), sys_mount(), sys_umount();
- Xint sys_setuid(), sys_getuid(), sys_stime(), sys_ptrace();
- Xint sys_alarm(), sys_oldfstat(), sys_pause(), sys_utime();
- Xint sys_stty(), sys_gtty(), sys_access(), sys_nice(), sys_ftime();
- Xint sys_sync(), sys_kill(), sys_rename(), sys_mkdir(), sys_rmdir();
- Xint sys_dup(), sys_pipe(), sys_times(), sys_prof(), sys_brk();
- Xint sys_setgid(), sys_getgid(), sys_signal(), sys_geteuid();
- Xint sys_getegid(), sys_acct(), sys_phys(), sys_lock(), sys_ioctl();
- Xint sys_fcntl(), sys_mpx(), sys_setpgid(), sys_ulimit();
- Xint sys_olduname(), sys_umask(), sys_chroot(), sys_ustat();
- Xint sys_dup2(), sys_getppid(), sys_getpgrp(), sys_setsid();
- Xint sys_sigaction(), sys_siggetmask(), sys_sigsetmask();
- Xint sys_setreuid(), sys_setregid(), sys_sigsuspend();
- Xint sys_sigpending(), sys_sethostname(), sys_setrlimit();
- Xint sys_getrlimit(), sys_getrusage(), sys_gettimeofday();
- Xint sys_settimeofday(), sys_getgroups(), sys_setgroups();
- Xint sys_select(), sys_symlink(), sys_oldlstat(), sys_readlink();
- Xint sys_uselib(), sys_swapon(), sys_reboot(), sys_readdir();
- Xint sys_mmap(), sys_munmap(), sys_truncate(), sys_ftruncate();
- Xint sys_fchmod(), sys_fchown(), sys_getpriority();
- Xint sys_setpriority(), sys_profil(), sys_statfs(), sys_fstatfs();
- Xint sys_ioperm(), sys_socketcall(), sys_syslog(), sys_setitimer();
- Xint sys_getitimer(), sys_stat(), sys_lstat(), sys_fstat();
- Xint sys_uname(), sys_iopl(), sys_vhangup(), sys_idle(), sys_vm86();
- Xint sys_wait4(), sys_swapoff(), sys_ipc(), sys_sigreturn();
- Xint sys_fsync(), sys_clone(), sys_setdomainname(), sys_sysinfo();
- Xint sys_modify_ldt(), sys_adjtimex(), sys_mprotect();
- Xint sys_sigprocmask(), sys_create_module(), sys_init_module();
- Xint sys_delete_module(), sys_get_kernel_syms(), sys_quotactl();
- Xint sys_getpgid(), sys_fchdir(), sys_bdflush();
- X
- X/* sys_socketcall subcalls */
- X
- Xint sys_socket(), sys_bind(), sys_connect(), sys_listen();
- Xint sys_accept(), sys_getsockname(), sys_getpeername(), sys_socketpair();
- Xint sys_send(), sys_recv(), sys_sendto(), sys_recvfrom();
- Xint sys_shutdown(), sys_setsockopt(), sys_getsockopt();
- X
- X#define SYS_socket_subcall 150
- X#define SYS_socket (SYS_socket_subcall + 1)
- X#define SYS_bind (SYS_socket_subcall + 2)
- X#define SYS_connect (SYS_socket_subcall + 3)
- X#define SYS_listen (SYS_socket_subcall + 4)
- X#define SYS_accept (SYS_socket_subcall + 5)
- X#define SYS_getsockname (SYS_socket_subcall + 6)
- X#define SYS_getpeername (SYS_socket_subcall + 7)
- X#define SYS_socketpair (SYS_socket_subcall + 8)
- X#define SYS_send (SYS_socket_subcall + 9)
- X#define SYS_recv (SYS_socket_subcall + 10)
- X#define SYS_sendto (SYS_socket_subcall + 11)
- X#define SYS_recvfrom (SYS_socket_subcall + 12)
- X#define SYS_shutdown (SYS_socket_subcall + 13)
- X#define SYS_setsockopt (SYS_socket_subcall + 14)
- X#define SYS_getsockopt (SYS_socket_subcall + 15)
- X
- X#define SYS_socket_nsubcalls 16
- X
- X/* sys_ipc subcalls */
- X
- Xint sys_semget(), sys_semctl();
- Xint sys_msgsnd(), sys_msgrcv(), sys_msgget(), sys_msgctl();
- Xint sys_shmat(), sys_shmdt(), sys_shmget(), sys_shmctl();
- X
- X#define SYS_ipc_subcall 170
- X#define SYS_semop (SYS_ipc_subcall + 1)
- X#define SYS_semget (SYS_ipc_subcall + 2)
- X#define SYS_semctl (SYS_ipc_subcall + 3)
- X#define SYS_msgsnd (SYS_ipc_subcall + 11)
- X#define SYS_msgrcv (SYS_ipc_subcall + 12)
- X#define SYS_msgget (SYS_ipc_subcall + 13)
- X#define SYS_msgctl (SYS_ipc_subcall + 14)
- X#define SYS_shmat (SYS_ipc_subcall + 21)
- X#define SYS_shmdt (SYS_ipc_subcall + 22)
- X#define SYS_shmget (SYS_ipc_subcall + 23)
- X#define SYS_shmctl (SYS_ipc_subcall + 24)
- X
- X#define SYS_ipc_nsubcalls 25
- X
- END_OF_FILE
- if test 5719 -ne `wc -c <'strace-3.0/linux/syscall.h'`; then
- echo shar: \"'strace-3.0/linux/syscall.h'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/linux/syscall.h'
- fi
- if test -f 'strace-3.0/mem.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/mem.c'\"
- else
- echo shar: Extracting \"'strace-3.0/mem.c'\" \(5515 characters\)
- sed "s/^X//" >'strace-3.0/mem.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
- X * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * mem.c,v 2.20 1994/03/21 05:45:30 jrs Exp
- X */
- X
- X#include "defs.h"
- X
- X#include <sys/mman.h>
- X
- Xint
- Xsys_brk(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%#x", tcp->u_arg[0]);
- X }
- X#ifdef linux
- X return RVAL_HEX;
- X}
- X#else
- X return 0;
- X}
- X
- Xint
- Xsys_sbrk(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%u", tcp->u_arg[0]);
- X }
- X return RVAL_HEX;
- X}
- X#endif
- X
- Xstatic struct xlat mmap_prot[] = {
- X { PROT_NONE, "PROT_NONE", },
- X { PROT_READ, "PROT_READ" },
- X { PROT_WRITE, "PROT_WRITE" },
- X { PROT_EXEC, "PROT_EXEC" },
- X { 0, NULL },
- X};
- Xstatic struct xlat mmap_flags[] = {
- X { MAP_SHARED, "MAP_SHARED" },
- X { MAP_PRIVATE, "MAP_PRIVATE" },
- X { MAP_FIXED, "MAP_FIXED" },
- X#ifdef MAP_ANONYMOUS
- X { MAP_FIXED, "MAP_ANONYMOUS" },
- X#endif
- X#ifdef MAP_RENAME
- X { MAP_RENAME, "MAP_RENAME" },
- X#endif
- X#ifdef MAP_NORESERVE
- X { MAP_NORESERVE,"MAP_NORESERVE" },
- X#endif
- X#ifdef _MAP_NEW
- X { _MAP_NEW, "_MAP_NEW" },
- X#endif
- X { 0, NULL },
- X};
- X
- Xint
- Xsys_mmap(tcp)
- Xstruct tcb *tcp;
- X{
- X#ifdef LINUX
- X int u_arg[6];
- X#else /* !LINUX */
- X int *u_arg = tcp->u_arg;
- X#endif /* !LINUX */
- X
- X if (entering(tcp)) {
- X#ifdef LINUX
- X if (umoven(tcp, tcp->u_arg[0], sizeof u_arg,
- X (char *) u_arg) == -1)
- X return 0;
- X#endif /* LINUX */
- X
- X /* addr */
- X tprintf("%#x, ", u_arg[0]);
- X /* len */
- X tprintf("%u, ", u_arg[1]);
- X /* prot */
- X printflags(mmap_prot, u_arg[2]);
- X tprintf(", ");
- X /* flags */
- X printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???");
- X addflags(mmap_flags, u_arg[3] & ~MAP_TYPE);
- X /* fd */
- X tprintf(", %u, ", u_arg[4]);
- X /* offset */
- X tprintf("%#x", u_arg[5]);
- X }
- X return RVAL_HEX;
- X}
- X
- Xint
- Xsys_munmap(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%#x, %u",
- X tcp->u_arg[0], tcp->u_arg[1]);
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_mprotect(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X tprintf("%#x, %u, ",
- X tcp->u_arg[0], tcp->u_arg[1]);
- X if (!printflags(mmap_prot, tcp->u_arg[2]))
- X tprintf("PROT_???");
- X }
- X return 0;
- X}
- X
- X#ifdef HAVE_MCTL
- X
- Xstatic struct xlat mctl_funcs[] = {
- X { MC_LOCK, "MC_LOCK" },
- X { MC_LOCKAS, "MC_LOCKAS" },
- X { MC_SYNC, "MC_SYNC" },
- X { MC_UNLOCK, "MC_UNLOCK" },
- X { MC_UNLOCKAS, "MC_UNLOCKAS" },
- X { 0, NULL },
- X};
- X
- Xstatic struct xlat mctl_lockas[] = {
- X { MCL_CURRENT, "MCL_CURRENT" },
- X { MCL_FUTURE, "MCL_FUTURE" },
- X { 0, NULL },
- X};
- X
- Xstatic struct xlat mctl_sync[] = {
- X { MS_ASYNC, "MS_ASYNC" },
- X { MS_INVALIDATE,"MS_INVALIDATE" },
- X { 0, NULL },
- X};
- X
- Xint
- Xsys_mctl(tcp)
- Xstruct tcb *tcp;
- X{
- X int arg, function;
- X
- X if (entering(tcp)) {
- X /* addr */
- X tprintf("%#x", tcp->u_arg[0]);
- X /* len */
- X tprintf(", %u, ", tcp->u_arg[1]);
- X /* function */
- X function = tcp->u_arg[2];
- X if (!printflags(mctl_funcs, function))
- X tprintf("MC_???");
- X /* arg */
- X arg = tcp->u_arg[3];
- X tprintf(", ");
- X switch (function) {
- X case MC_SYNC:
- X if (!printflags(mctl_sync, arg))
- X tprintf("MS_???");
- X break;
- X case MC_LOCKAS:
- X if (!printflags(mctl_lockas, arg))
- X tprintf("MCL_???");
- X break;
- X default:
- X tprintf("%#x", arg);
- X break;
- X }
- X }
- X return 0;
- X}
- X
- X#endif /* HAVE_MCTL */
- X
- Xint
- Xsys_mincore(tcp)
- Xstruct tcb *tcp;
- X{
- X int i, len;
- X char *vec = NULL;
- X
- X if (entering(tcp)) {
- X tprintf("%#x, %u, ", tcp->u_arg[0], tcp->u_arg[1]);
- X } else {
- X len = tcp->u_arg[1];
- X if (syserror(tcp) || tcp->u_arg[2] == 0 ||
- X (vec = malloc((u_int)len)) == NULL ||
- X umoven(tcp, tcp->u_arg[2], len, vec) < 0)
- X tprintf("%#x", tcp->u_arg[2]);
- X else {
- X tprintf("[");
- X for (i = 0; i < len; i++) {
- X if (abbrev(tcp) && i >= max_strlen) {
- X tprintf("...");
- X break;
- X }
- X tprintf((vec[i] & 1) ? "1" : "0");
- X }
- X tprintf("]");
- X }
- X if (vec)
- X free(vec);
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_getpagesize(tcp)
- Xstruct tcb *tcp;
- X{
- X if (exiting(tcp))
- X return RVAL_HEX;
- X return 0;
- X}
- END_OF_FILE
- if test 5515 -ne `wc -c <'strace-3.0/mem.c'`; then
- echo shar: \"'strace-3.0/mem.c'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/mem.c'
- fi
- if test -f 'strace-3.0/proc.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/proc.c'\"
- else
- echo shar: Extracting \"'strace-3.0/proc.c'\" \(6152 characters\)
- sed "s/^X//" >'strace-3.0/proc.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * proc.c,v 2.9 1994/03/21 05:45:32 jrs Exp
- X */
- X
- X#include "defs.h"
- X
- X#ifdef SVR4
- X
- Xstatic struct xlat proc_status_flags[] = {
- X { PR_STOPPED, "PR_STOPPED" },
- X { PR_ISTOP, "PR_ISTOP" },
- X { PR_DSTOP, "PR_DSTOP" },
- X { PR_ASLEEP, "PR_ASLEEP" },
- X { PR_FORK, "PR_FORK" },
- X { PR_RLC, "PR_RLC" },
- X { PR_PTRACE, "PR_PTRACE" },
- X { PR_PCINVAL, "PR_PCINVAL" },
- X { PR_ISSYS, "PR_ISSYS" },
- X#ifdef PR_STEP
- X { PR_STEP, "PR_STEP" },
- X#endif
- X#ifdef PR_KLC
- X { PR_KLC, "PR_KLC" },
- X#endif
- X#ifdef PR_ASYNC
- X { PR_ASYNC, "PR_ASYNC" },
- X#endif
- X#ifdef PR_PCOMPAT
- X { PR_PCOMPAT, "PR_PCOMPAT" },
- X#endif
- X { 0, NULL },
- X};
- X
- Xstatic struct xlat proc_status_why[] = {
- X { PR_REQUESTED, "PR_REQUESTED" },
- X { PR_SIGNALLED, "PR_SIGNALLED" },
- X { PR_SYSENTRY, "PR_SYSENTRY" },
- X { PR_SYSEXIT, "PR_SYSEXIT" },
- X { PR_JOBCONTROL,"PR_JOBCONTROL" },
- X { PR_FAULTED, "PR_FAULTED" },
- X#ifdef PR_SUSPENDED
- X { PR_SUSPENDED, "PR_SUSPENDED" },
- X#endif
- X#ifdef PR_CHECKPOINT
- X { PR_CHECKPOINT,"PR_CHECKPOINT" },
- X#endif
- X { 0, NULL },
- X};
- X
- Xstatic struct xlat proc_run_flags[] = {
- X { PRCSIG, "PRCSIG" },
- X { PRCFAULT, "PRCFAULT" },
- X { PRSTRACE, "PRSTRACE" },
- X { PRSHOLD, "PRSHOLD" },
- X { PRSFAULT, "PRSFAULT" },
- X { PRSVADDR, "PRSVADDR" },
- X { PRSTEP, "PRSTEP" },
- X { PRSABORT, "PRSABORT" },
- X { PRSTOP, "PRSTOP" },
- X { 0, NULL },
- X};
- X
- X#if 0
- X
- Xstatic struct xlat proc_map_flags[] = {
- X { MA_READ, "MA_READ" },
- X { MA_WRITE, "MA_WRITE" },
- X { MA_EXEC, "MA_EXEC" },
- X { MA_SHARED, "MA_SHARED" },
- X { MA_BREAK, "MA_BREAK" },
- X { MA_STACK, "MA_STACK" },
- X { 0, NULL },
- X};
- X
- Xstatic struct xlat proc_page_flags[] = {
- X { PG_REFERENCED,"PG_REFERENCED" },
- X { PG_MODIFIED, "PG_MODIFIED" },
- X { PG_HWMAPPED, "PG_HWMAPPED" },
- X { 0, NULL },
- X};
- X
- X#ifdef SPARC
- X
- Xstatic struct xlat proc_regs[] = {
- X { R_G0, "R_G0" },
- X { R_G1, "R_G1" },
- X { R_G2, "R_G2" },
- X { R_G3, "R_G3" },
- X { R_G4, "R_G4" },
- X { R_G5, "R_G5" },
- X { R_G6, "R_G6" },
- X { R_G7, "R_G7" },
- X { R_O0, "R_O0" },
- X { R_O1, "R_O1" },
- X { R_O2, "R_O2" },
- X { R_O3, "R_O3" },
- X { R_O4, "R_O4" },
- X { R_O5, "R_O5" },
- X { R_O6, "R_O6" },
- X { R_O7, "R_O7" },
- X { R_L0, "R_L0" },
- X { R_L1, "R_L1" },
- X { R_L2, "R_L2" },
- X { R_L3, "R_L3" },
- X { R_L4, "R_L4" },
- X { R_L5, "R_L5" },
- X { R_L6, "R_L6" },
- X { R_L7, "R_L7" },
- X { R_I0, "R_I0" },
- X { R_I1, "R_I1" },
- X { R_I2, "R_I2" },
- X { R_I3, "R_I3" },
- X { R_I4, "R_I4" },
- X { R_I5, "R_I5" },
- X { R_I6, "R_I6" },
- X { R_I7, "R_I7" },
- X { R_PSR, "R_PSR" },
- X { R_PC, "R_PC" },
- X { R_nPC, "R_nPC" },
- X { R_Y, "R_Y" },
- X { R_WIM, "R_WIM" },
- X { R_TBR, "R_TBR" },
- X { 0, NULL },
- X};
- X
- X#endif /* SPARC */
- X
- X#endif /* 0 */
- X
- Xint
- Xproc_ioctl(tcp, code, arg)
- Xstruct tcb *tcp;
- Xint code, arg;
- X{
- X int val;
- X prstatus_t status;
- X prrun_t run;
- X
- X if (entering(tcp))
- X return 0;
- X
- X switch (code) {
- X case PIOCSTATUS:
- X case PIOCSTOP:
- X case PIOCWSTOP:
- X if (arg == 0)
- X tprintf(", NULL");
- X else if (syserror(tcp))
- X tprintf(", %#x", arg);
- X else if (umove(tcp, arg, &status) < 0)
- X tprintf(", {...}");
- X else {
- X tprintf(", {pr_flags=");
- X if (!printflags(proc_status_flags, status.pr_flags))
- X tprintf("0");
- X if (status.pr_why) {
- X tprintf(", pr_why=");
- X printxval(proc_status_why, status.pr_why,
- X "PR_???");
- X }
- X switch (status.pr_why) {
- X case PR_SIGNALLED:
- X case PR_JOBCONTROL:
- X tprintf(", pr_what=");
- X printsignal(status.pr_what);
- X break;
- X case PR_FAULTED:
- X tprintf(", pr_what=%d", status.pr_what);
- X break;
- X case PR_SYSENTRY:
- X case PR_SYSEXIT:
- X tprintf(", pr_what=SYS_%s",
- X sysent[status.pr_what].sys_name);
- X break;
- X }
- X tprintf(", ...}");
- X }
- X return 1;
- X case PIOCRUN:
- X if (arg == 0)
- X tprintf(", NULL");
- X else if (umove(tcp, arg, &run) < 0)
- X tprintf(", {...}");
- X else {
- X tprintf(", {pr_flags=");
- X if (!printflags(proc_run_flags, run.pr_flags))
- X tprintf("0");
- X tprintf(", ...}");
- X }
- X return 1;
- X#ifdef PIOCSET
- X case PIOCSET:
- X case PIOCRESET:
- X if (umove(tcp, arg, &val) < 0)
- X tprintf(", [?]");
- X else {
- X tprintf(", [");
- X if (!printflags(proc_status_flags, val))
- X tprintf("0");
- X tprintf("]");
- X }
- X return 1;
- X#endif /* PIOCSET */
- X case PIOCKILL:
- X case PIOCUNKILL:
- X /* takes a pointer to a signal */
- X if (umove(tcp, arg, &val) < 0)
- X tprintf(", [?]");
- X else {
- X tprintf(", [");
- X printsignal(val);
- X tprintf("]");
- X }
- X return 1;
- X case PIOCSFORK:
- X case PIOCRFORK:
- X case PIOCSRLC:
- X case PIOCRRLC:
- X /* doesn't take an arg */
- X return 1;
- X default:
- X /* ad naseum */
- X return 0;
- X }
- X}
- X
- X#endif /* SVR4 */
- END_OF_FILE
- if test 6152 -ne `wc -c <'strace-3.0/proc.c'`; then
- echo shar: \"'strace-3.0/proc.c'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/proc.c'
- fi
- if test -f 'strace-3.0/sunos4/syscall.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/sunos4/syscall.h'\"
- else
- echo shar: Extracting \"'strace-3.0/sunos4/syscall.h'\" \(6181 characters\)
- sed "s/^X//" >'strace-3.0/sunos4/syscall.h' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * syscall.h,v 2.18 1994/03/12 23:12:20 jrs Exp
- X */
- X#include "dummy.h"
- X
- Xint sys_nosys();
- Xint sys_nullsys();
- Xint sys_errsys();
- X
- X/* 1.1 processes and protection */
- Xint sys_gethostid(),sys_sethostname(),sys_gethostname(),sys_getpid();
- Xint sys_setdomainname(),sys_getdomainname();
- Xint sys_fork(),sys_exit(),sys_execv(),sys_execve(),sys_wait4();
- Xint sys_getuid(),sys_setreuid(),sys_getgid(),sys_getgroups(),sys_setregid(),sys_setgroups();
- Xint sys_getpgrp(),sys_setpgrp();
- Xint sys_sys_setsid(), sys_setpgid();
- Xint sys_uname();
- X
- X/* 1.2 memory management */
- Xint sys_brk(),sys_sbrk(),sys_sstk();
- Xint sys_getpagesize(),sys_mmap(),sys_mctl(),sys_munmap(),sys_mprotect(),sys_mincore();
- Xint sys_omsync(),sys_omadvise();
- X
- X/* 1.3 signals */
- Xint sys_sigvec(),sys_sigblock(),sys_sigsetmask(),sys_sigpause(),sys_sigstack(),sys_sigcleanup();
- Xint sys_kill(), sys_killpg(), sys_sigpending();
- X
- X/* 1.4 timing and statistics */
- Xint sys_gettimeofday(),sys_settimeofday();
- Xint sys_adjtime();
- Xint sys_getitimer(),sys_setitimer();
- X
- X/* 1.5 descriptors */
- Xint sys_getdtablesize(),sys_dup(),sys_dup2(),sys_close();
- Xint sys_select(),sys_getdopt(),sys_setdopt(),sys_fcntl(),sys_flock();
- X
- X/* 1.6 resource controls */
- Xint sys_getpriority(),sys_setpriority(),sys_getrusage(),sys_getrlimit(),sys_setrlimit();
- Xint sys_oldquota(), sys_quotactl();
- Xint sys_rtschedule();
- X
- X/* 1.7 system operation support */
- Xint sys_mount(),sys_unmount(),sys_swapon();
- Xint sys_sync(),sys_reboot();
- Xint sys_sysacct();
- Xint sys_auditsys();
- X
- X/* 2.1 generic operations */
- Xint sys_read(),sys_write(),sys_readv(),sys_writev(),sys_ioctl();
- X
- X/* 2.1.1 asynch operations */
- Xint sys_aioread(), sys_aiowrite(), sys_aiowait(), sys_aiocancel();
- X
- X/* 2.2 file system */
- Xint sys_chdir(),sys_chroot();
- Xint sys_fchdir(),sys_fchroot();
- Xint sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents();
- Xint sys_creat(),sys_open(),sys_mknod(),sys_unlink(),sys_stat(),sys_fstat(),sys_lstat();
- Xint sys_chown(),sys_fchown(),sys_chmod(),sys_fchmod(),sys_utimes();
- Xint sys_link(),sys_symlink(),sys_readlink(),sys_rename();
- Xint sys_lseek(),sys_truncate(),sys_ftruncate(),sys_access(),sys_fsync();
- Xint sys_statfs(),sys_fstatfs();
- X
- X/* 2.3 communications */
- Xint sys_socket(),sys_bind(),sys_listen(),sys_accept(),sys_connect();
- Xint sys_socketpair(),sys_sendto(),sys_send(),sys_recvfrom(),sys_recv();
- Xint sys_sendmsg(),sys_recvmsg(),sys_shutdown(),sys_setsockopt(),sys_getsockopt();
- Xint sys_getsockname(),sys_getpeername(),sys_pipe();
- X
- Xint sys_umask(); /* XXX */
- X
- X/* 2.3.1 SystemV-compatible IPC */
- Xint sys_semsys();
- Xint sys_msgsys();
- Xint sys_shmsys();
- X
- X/* 2.4 processes */
- Xint sys_ptrace();
- X
- X/* 2.5 terminals */
- X
- X/* emulations for backwards compatibility */
- Xint sys_otime(); /* now use gettimeofday */
- Xint sys_ostime(); /* now use settimeofday */
- Xint sys_oalarm(); /* now use setitimer */
- Xint sys_outime(); /* now use utimes */
- Xint sys_opause(); /* now use sigpause */
- Xint sys_onice(); /* now use setpriority,getpriority */
- Xint sys_oftime(); /* now use gettimeofday */
- Xint sys_osetpgrp(); /* ??? */
- Xint sys_otimes(); /* now use getrusage */
- Xint sys_ossig(); /* now use sigvec, etc */
- Xint sys_ovlimit(); /* now use setrlimit,getrlimit */
- Xint sys_ovtimes(); /* now use getrusage */
- Xint sys_osetuid(); /* now use setreuid */
- Xint sys_osetgid(); /* now use setregid */
- Xint sys_ostat(); /* now use stat */
- Xint sys_ofstat(); /* now use fstat */
- X
- X/* BEGIN JUNK */
- Xint sys_profil(); /* 'cuz sys calls are interruptible */
- Xint sys_vhangup(); /* should just do in sys_exit() */
- Xint sys_vfork(); /* XXX - was awaiting fork w/ copy on write */
- Xint sys_ovadvise(); /* awaiting new madvise */
- Xint sys_indir(); /* indirect system call */
- Xint sys_ustat(); /* System V compatibility */
- Xint sys_owait(); /* should use wait4 interface */
- Xint sys_owait3(); /* should use wait4 interface */
- Xint sys_umount(); /* still more Sys V (and 4.2?) compatibility */
- Xint sys_pathconf(); /* posix */
- Xint sys_fpathconf(); /* posix */
- Xint sys_sysconf(); /* posix */
- X
- Xint sys_debug();
- X/* END JUNK */
- X
- Xint sys_vtrace(); /* kernel event tracing */
- X
- X/* nfs */
- Xint sys_async_daemon(); /* client async daemon */
- Xint sys_nfs_svc(); /* run nfs server */
- Xint sys_nfs_getfh(); /* get file handle */
- Xint sys_exportfs(); /* export file systems */
- X
- Xint sys_rfssys(); /* RFS-related calls */
- X
- Xint sys_getmsg();
- Xint sys_putmsg();
- Xint sys_poll();
- X
- Xint sys_vpixsys(); /* VP/ix system calls */
- X
- END_OF_FILE
- if test 6181 -ne `wc -c <'strace-3.0/sunos4/syscall.h'`; then
- echo shar: \"'strace-3.0/sunos4/syscall.h'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/sunos4/syscall.h'
- fi
- if test -f 'strace-3.0/time.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/time.c'\"
- else
- echo shar: Extracting \"'strace-3.0/time.c'\" \(5055 characters\)
- sed "s/^X//" >'strace-3.0/time.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
- X * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
- X * Copyright (c) 1993, 1994 Rick Sladkey <jrs@world.std.com>
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by Paul Kranenburg,
- X * Branko Lankester and Rick Sladkey.
- X * 4. The name of the author may not be used to endorse or promote products
- X * derived from this software without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- X *
- X * time.c,v 2.23 1994/06/29 04:43:27 jrs Exp
- X */
- X
- X#include "defs.h"
- X
- X#ifdef LINUX
- X#include <linux/timex.h>
- X#endif /* LINUX */
- X
- Xvoid
- Xprinttv(tcp, addr)
- Xstruct tcb *tcp;
- Xint addr;
- X{
- X struct timeval tv;
- X
- X if (addr == 0)
- X tprintf("NULL");
- X else if (!verbose(tcp))
- X tprintf("%#x", addr);
- X else if (umove(tcp, addr, &tv) < 0)
- X tprintf("{...}");
- X else
- X tprintf("{%lu, %lu}", tv.tv_sec, tv.tv_usec);
- X}
- X
- Xint
- Xsys_time(tcp)
- Xstruct tcb *tcp;
- X{
- X if (exiting(tcp)) {
- X#ifndef SVR4
- X printnum(tcp, tcp->u_arg[0], "%d");
- X#endif /* SVR4 */
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_stime(tcp)
- Xstruct tcb *tcp;
- X{
- X if (exiting(tcp)) {
- X printnum(tcp, tcp->u_arg[0], "%d");
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_gettimeofday(tcp)
- Xstruct tcb *tcp;
- X{
- X if (exiting(tcp)) {
- X if (syserror(tcp)) {
- X tprintf("%#x, %#x",
- X tcp->u_arg[0], tcp->u_arg[1]);
- X return 0;
- X }
- X printtv(tcp, tcp->u_arg[0]);
- X#ifndef SVR4
- X tprintf(", ");
- X printtv(tcp, tcp->u_arg[1]);
- X#endif /* !SVR4 */
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_settimeofday(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X printtv(tcp, tcp->u_arg[0]);
- X#ifndef SVR4
- X tprintf(", ");
- X printtv(tcp, tcp->u_arg[1]);
- X#endif /* !SVR4 */
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_adjtime(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X printtv(tcp, tcp->u_arg[0]);
- X tprintf(", ");
- X } else {
- X if (syserror(tcp))
- X tprintf("%#x", tcp->u_arg[1]);
- X else
- X printtv(tcp, tcp->u_arg[1]);
- X }
- X return 0;
- X}
- X
- Xstatic struct xlat which[] = {
- X { ITIMER_REAL, "ITIMER_REAL" },
- X { ITIMER_VIRTUAL,"ITIMER_VIRTUAL"},
- X { ITIMER_PROF, "ITIMER_PROF" },
- X { 0, NULL },
- X};
- X
- Xstatic void
- Xprintitv(tcp, addr)
- Xstruct tcb *tcp;
- Xint addr;
- X{
- X struct itimerval itv;
- X
- X if (addr == 0)
- X tprintf("NULL");
- X else if (!verbose(tcp))
- X tprintf("%#x", addr);
- X else if (umove(tcp, addr, &itv) < 0)
- X tprintf("{...}");
- X else {
- X tprintf("{it_interval={%lu, %lu}, it_value={%lu, %lu}}",
- X itv.it_interval.tv_sec, itv.it_interval.tv_usec,
- X itv.it_value.tv_sec, itv.it_value.tv_usec);
- X }
- X}
- X
- Xint
- Xsys_getitimer(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X printxval(which, tcp->u_arg[0], "ITIMER_???");
- X tprintf(", ");
- X } else {
- X if (syserror(tcp))
- X tprintf("%#x", tcp->u_arg[1]);
- X else
- X printitv(tcp, tcp->u_arg[1]);
- X }
- X return 0;
- X}
- X
- Xint
- Xsys_setitimer(tcp)
- Xstruct tcb *tcp;
- X{
- X if (entering(tcp)) {
- X printxval(which, tcp->u_arg[0], "ITIMER_???");
- X tprintf(", ");
- X printitv(tcp, tcp->u_arg[1]);
- X tprintf(", ");
- X } else {
- X if (syserror(tcp))
- X tprintf("%#x", tcp->u_arg[2]);
- X else
- X printitv(tcp, tcp->u_arg[2]);
- X }
- X return 0;
- X}
- X
- X#ifdef LINUX
- X
- Xint
- Xsys_adjtimex(tcp)
- Xstruct tcb *tcp;
- X{
- X struct timex txc;
- X
- X if (exiting(tcp)) {
- X if (tcp->u_arg[0] == 0)
- X tprintf("NULL");
- X else if (syserror(tcp) || !verbose(tcp))
- X tprintf("%#x", tcp->u_arg[0]);
- X else if (umove(tcp, tcp->u_arg[0], &txc) < 0)
- X tprintf("{...}");
- X else {
- X tprintf("{mode=%d, offset=%ld, frequency=%ld, ",
- X txc.mode, txc.offset, txc.frequency);
- X tprintf("maxerror=%ld, esterror=%lu, status=%u, ",
- X txc.maxerror, txc.esterror, txc.status);
- X tprintf("time_constant=%ld, precision=%lu, ",
- X txc.time_constant, txc.precision);
- X tprintf("tolerance=%ld, time={%lu, %lu}}",
- X txc.tolerance,
- X txc.time.tv_sec, txc.time.tv_usec);
- X }
- X }
- X return 0;
- X}
- X#endif /* LINUX */
- X
- END_OF_FILE
- if test 5055 -ne `wc -c <'strace-3.0/time.c'`; then
- echo shar: \"'strace-3.0/time.c'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/time.c'
- fi
- echo shar: End of archive 9 \(of 10\).
- cp /dev/null ark9isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 10 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-