home *** CD-ROM | disk | FTP | other *** search
- From: jrs@world.std.com (Rick Sladkey)
- Newsgroups: comp.sources.misc
- Subject: v43i076: strace - system call tracer for sunos, linux, svr4, solaris2, Part02/10
- Date: 9 Jul 1994 15:48:46 -0500
- Organization: Sterling Software
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <2vn2fe$997@sparky.sterling.com>
- X-Md4-Signature: f01ce4e31f90db38ca98c1c201107df8
-
- Submitted-by: jrs@world.std.com (Rick Sladkey)
- Posting-number: Volume 43, Issue 76
- Archive-name: strace/part02
- 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/strace.c strace-3.0/sunos4/ioctlent.h
- # strace-3.0/syscallent.sh
- # Wrapped by kent@sparky on Sat Jul 9 15:42:55 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 2 (of 10)."'
- if test -f 'strace-3.0/strace.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/strace.c'\"
- else
- echo shar: Extracting \"'strace-3.0/strace.c'\" \(31363 characters\)
- sed "s/^X//" >'strace-3.0/strace.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 * strace.c,v 2.28 1994/06/29 04:43:25 jrs Exp
- X */
- X
- X#include "defs.h"
- X
- X#include <signal.h>
- X#include <errno.h>
- X#include <sys/param.h>
- X#include <fcntl.h>
- X#include <sys/resource.h>
- X#include <sys/wait.h>
- X#include <sys/stat.h>
- X#ifdef SVR4
- X#include <sys/stropts.h>
- X#include <poll.h>
- X#endif
- X
- Xint debug = 0, followfork = 0, followvfork = 0, interactive = 0;
- Xint rflag = 0, tflag = 0, dtime = 0, cflag = 0;
- Xint iflag = 0, xflag = 0, qflag = 0;
- Xint pflag_seen = 0;
- Xint acolumn = DEFAULT_ACOLUMN;
- Xint max_strlen = DEFAULT_STRLEN;
- Xchar *outfname;
- XFILE *outf;
- Xstruct tcb tcbtab[MAX_PROCS];
- Xint nprocs;
- Xchar *progname;
- Xextern char version[];
- X
- Xstatic struct tcb *pid2tcb P((int pid));
- Xstatic int trace P((void));
- Xstatic void cleanup P((void));
- Xstatic void interrupt P((int sig));
- Xstatic sigset_t empty_set, blocked_set;
- X
- X#ifdef HAVE_SIG_ATOMIC_T
- Xstatic volatile sig_atomic_t interrupted;
- X#else /* !HAVE_SIG_ATOMIC_T */
- X#ifdef __STDC__
- Xstatic volatile int interrupted;
- X#else /* !__STDC__ */
- Xstatic int interrupted;
- X#endif /* !__STDC__ */
- X#endif /* !HAVE_SIG_ATOMIC_T */
- X
- X#ifdef SVR4
- X
- Xstatic struct tcb *pfd2tcb P((int pfd));
- Xstatic void reaper P((int sig));
- Xstatic void rebuild_pollv P((void));
- Xstruct pollfd pollv[MAX_PROCS];
- X
- X#ifndef HAVE_POLLABLE_PROCFS
- X
- Xstatic void proc_poll_open P((void));
- Xstatic void proc_poller P((int pfd));
- X
- Xstruct proc_pollfd {
- X int fd;
- X int revents;
- X int pid;
- X};
- X
- Xstatic int poller_pid;
- Xstatic int proc_poll_pipe[2] = { -1, -1 };
- X
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X
- X#endif /* SVR4 */
- X
- Xstatic void
- Xusage(ofp, exitval)
- XFILE *ofp;
- Xint exitval;
- X{
- X fprintf(ofp, "\
- Xusage: strace [-dffhiqrtttTvVxx] [-a column] [-e expr] ... [-o file]\n\
- X [-p pid] ... [-s strsize] [command [arg ...]]\n\
- X or: strace -c [-e expr] ... [-O overhead] [-S sortby] [command [arg ...]]\n\
- X-c -- count time, calls, and errors for each syscall and report summary\n\
- X-f -- follow forks, -ff -- with output into separate files\n\
- X-F -- attempt to follow vforks, -h -- print help message\n\
- X-i -- print instruction pointer at time of syscall\n\
- X-q -- suppress messages about attaching, detaching, etc.\n\
- X-r -- print relative timestamp, -t -- absolute timestamp, -tt -- with usecs\n\
- X-T -- print time spent in each syscall, -V -- print version\n\
- X-v -- verbose mode: print unabbreviated argv, stat, termio[s], etc. args\n\
- X-x -- print non-ascii strings in hex, -xx -- print all strings in hex\n\
- X-a column -- alignment COLUMN for printing syscall results (default %d)\n\
- X-e expr -- a qualifying expression: option=[!]all or option=[!]val1[,val2]...\n\
- X options: trace, abbrev, verbose, raw, signal, read, or write\n\
- X-o file -- send trace output to FILE instead of stderr\n\
- X-O overhead -- set overhead for tracing syscalls to OVERHEAD usecs\n\
- X-p pid -- trace process with process id PID, may be repeated\n\
- X-s strsize -- limit length of print strings to STRSIZE chars (default %d)\n\
- X-S sortby -- sort syscall counts by: time, calls, name, nothing (default %s)\n\
- X", DEFAULT_ACOLUMN, DEFAULT_STRLEN, DEFAULT_SORTBY);
- X exit(exitval);
- X}
- X
- Xint
- Xmain(argc, argv)
- Xint argc;
- Xchar *argv[];
- X{
- X extern int optind;
- X extern char *optarg;
- X struct tcb *tcp;
- X int c, pid = 0;
- X struct sigaction sa;
- X
- X static char buf[BUFSIZ];
- X
- X progname = argv[0];
- X outf = stderr;
- X interactive = 1;
- X qualify("trace=all");
- X qualify("abbrev=all");
- X qualify("verbose=all");
- X qualify("signal=all");
- X set_sortby(DEFAULT_SORTBY);
- X while ((c = getopt(argc, argv,
- X "+cdfFhiqrtTvVxa:e:o:O:p:s:S:")) != EOF) {
- X switch (c) {
- X case 'c':
- X cflag++;
- X dtime++;
- X break;
- X case 'd':
- X debug++;
- X break;
- X case 'f':
- X followfork++;
- X break;
- X case 'F':
- X followvfork++;
- X break;
- X case 'h':
- X usage(stdout, 0);
- X break;
- X case 'i':
- X iflag++;
- X break;
- X case 'q':
- X qflag++;
- X break;
- X case 'r':
- X rflag++;
- X tflag++;
- X break;
- X case 't':
- X tflag++;
- X break;
- X case 'T':
- X dtime++;
- X break;
- X case 'x':
- X xflag++;
- X break;
- X case 'v':
- X qualify("abbrev=none");
- X break;
- X case 'V':
- X printf("%s\n", version);
- X exit(0);
- X break;
- X case 'a':
- X acolumn = atoi(optarg);
- X break;
- X case 'e':
- X qualify(optarg);
- X break;
- X case 'o':
- X outfname = strdup(optarg);
- X if ((outf = fopen(outfname, "w")) == NULL) {
- X perror("strace: fopen");
- X exit(1);
- X }
- X break;
- X case 'O':
- X set_overhead(atoi(optarg));
- X break;
- X case 'p':
- X if ((pid = atoi(optarg)) == 0) {
- X fprintf(stderr, "%s: Invalid process id: %s\n",
- X progname, optarg);
- X break;
- X }
- X if ((tcp = alloctcb(pid)) == NULL) {
- X fprintf(stderr, "%s: tcb table full\n",
- X progname);
- X exit(1);
- X }
- X tcp->flags |= TCB_ATTACHED;
- X pflag_seen++;
- X break;
- X case 's':
- X max_strlen = atoi(optarg);
- X break;
- X case 'S':
- X set_sortby(optarg);
- X break;
- X default:
- X usage(stderr, 1);
- X break;
- X }
- X }
- X
- X if (outf == stderr) {
- X qflag = 1;
- X setvbuf(outf, buf, _IOLBF, BUFSIZ);
- X }
- X else if (optind < argc)
- X interactive = 0;
- X else
- X qflag = 1;
- X
- X for (c = 0, tcp = tcbtab; c < MAX_PROCS; c++, tcp++) {
- X if (!(tcp->flags & TCB_INUSE) || !(tcp->flags & TCB_ATTACHED))
- X continue;
- X#ifdef SVR4
- X if (proc_open(tcp, 1) < 0) {
- X fprintf(stderr, "trouble opening proc file\n");
- X droptcb(tcp);
- X continue;
- X }
- X#else /* !SVR4 */
- X if (ptrace(PTRACE_ATTACH, tcp->pid, (char *) 1, 0) < 0) {
- X perror("attach: ptrace(PTRACE_ATTACH, ...)");
- X droptcb(tcp);
- X continue;
- X }
- X#endif /* !SVR4 */
- X if (!qflag)
- X fprintf(stderr,
- X "Process %u attached - interrupt to quit\n",
- X pid);
- X }
- X
- X if (optind < argc) {
- X struct stat statbuf;
- X char *filename;
- X char pathname[MAXPATHLEN];
- X
- X filename = argv[optind];
- X if (strchr(filename, '/'))
- X strcpy(pathname, filename);
- X#ifdef USE_DEBUGGING_EXEC
- X /*
- X * Debuggers customarily check the current directory
- X * first regardless of the path but doing that gives
- X * security geeks a panic attack.
- X */
- X else if (stat(filename, &statbuf) == 0)
- X strcpy(pathname, filename);
- X#endif /* USE_DEBUGGING_EXEC */
- X else {
- X char *path;
- X int m, n, len;
- X
- X for (path = getenv("PATH"); path && *path; path += m) {
- X if (strchr(path, ':')) {
- X n = strchr(path, ':') - path;
- X m = n + 1;
- X }
- X else
- X m = n = strlen(path);
- X if (n == 0) {
- X getcwd(pathname, MAXPATHLEN);
- X len = strlen(pathname);
- X }
- X else {
- X strncpy(pathname, path, n);
- X len = n;
- X }
- X if (len && pathname[len - 1] != '/')
- X pathname[len++] = '/';
- X strcpy(pathname + len, filename);
- X if (stat(pathname, &statbuf) == 0)
- X break;
- X }
- X }
- X if (stat(pathname, &statbuf) < 0) {
- X fprintf(stderr, "%s: %s: command not found\n",
- X progname, filename);
- X exit(1);
- X }
- X switch (pid = fork()) {
- X case -1:
- X perror("strace: fork");
- X cleanup();
- X exit(1);
- X break;
- X case 0: {
- X#ifdef SVR4
- X pause();
- X#else /* !SVR4 */
- X if (ptrace(PTRACE_TRACEME, 0, (char *) 1, 0) < 0) {
- X perror("strace: ptrace(PTRACE_TRACEME, ...)");
- X return -1;
- X }
- X if (debug)
- X kill(getpid(), SIGSTOP);
- X#endif /* !SVR4 */
- X execv(pathname, &argv[optind]);
- X perror("strace: exec");
- X _exit(1);
- X break;
- X }
- X default:
- X if ((tcp = alloctcb(pid)) == NULL) {
- X fprintf(stderr, "tcb table full\n");
- X cleanup();
- X exit(1);
- X }
- X#ifdef SVR4
- X if (proc_open(tcp, 0) < 0) {
- X fprintf(stderr, "trouble opening proc file\n");
- X cleanup();
- X exit(1);
- X }
- X#endif /* SVR4 */
- X break;
- X }
- X }
- X else if (pflag_seen == 0)
- X usage(stderr, 1);
- X
- X sigemptyset(&empty_set);
- X sigemptyset(&blocked_set);
- X sa.sa_handler = SIG_IGN;
- X sigemptyset(&sa.sa_mask);
- X sa.sa_flags = 0;
- X sigaction(SIGTTOU, &sa, NULL);
- X sigaction(SIGTTIN, &sa, NULL);
- X if (interactive) {
- X sigaddset(&blocked_set, SIGHUP);
- X sigaddset(&blocked_set, SIGINT);
- X sigaddset(&blocked_set, SIGQUIT);
- X sigaddset(&blocked_set, SIGTERM);
- X sa.sa_handler = interrupt;
- X#ifdef SUNOS4
- X /* POSIX signals on sunos4.1 are a little broken. */
- X sa.sa_flags = SA_INTERRUPT;
- X#endif /* SUNOS4 */
- X }
- X sigaction(SIGHUP, &sa, NULL);
- X sigaction(SIGINT, &sa, NULL);
- X sigaction(SIGQUIT, &sa, NULL);
- X sigaction(SIGTERM, &sa, NULL);
- X#ifdef SVR4
- X sa.sa_handler = reaper;
- X sigaction(SIGCHLD, &sa, NULL);
- X#endif /* SVR4 */
- X
- X if (trace() < 0)
- X exit(1);
- X cleanup();
- X exit(0);
- X}
- X
- Xvoid
- Xnewoutf(tcp)
- Xstruct tcb *tcp;
- X{
- X char name[MAXPATHLEN];
- X FILE *fp;
- X
- X if (outfname && followfork > 1) {
- X sprintf(name, "%s.%u", outfname, tcp->pid);
- X if ((fp = fopen(name, "w")) == NULL) {
- X perror("fopen");
- X return;
- X }
- X tcp->outf = fp;
- X }
- X return;
- X}
- X
- Xstruct tcb *
- Xalloctcb(pid)
- Xint pid;
- X{
- X int i;
- X struct tcb *tcp;
- X
- X for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
- X if ((tcp->flags & TCB_INUSE) == 0) {
- X tcp->pid = pid;
- X tcp->parent = NULL;
- X tcp->nchildren = 0;
- X tcp->flags = TCB_INUSE | TCB_STARTUP;
- X tcp->outf = outf; /* Initialise to current out file */
- X tcp->stime.tv_sec = 0;
- X tcp->stime.tv_usec = 0;
- X tcp->pfd = -1;
- X nprocs++;
- X return tcp;
- X }
- X }
- X return NULL;
- X}
- X
- X#ifdef SVR4
- X
- Xint
- Xproc_open(tcp, attaching)
- Xstruct tcb *tcp;
- Xint attaching;
- X{
- X char proc[32];
- X long arg;
- X sysset_t sc_enter, sc_exit;
- X sigset_t signals;
- X fltset_t faults;
- X prrun_t run;
- X#ifndef HAVE_POLLABLE_PROCFS
- X static int last_pfd;
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X
- X /* Open the process pseudo-file in /proc. */
- X sprintf(proc, "/proc/%d", tcp->pid);
- X if ((tcp->pfd = open(proc, O_RDWR|O_EXCL)) < 0) {
- X perror("strace: open(\"/proc/...\", ...)");
- X return -1;
- X }
- X rebuild_pollv();
- X if (!attaching) {
- X /*
- X * Wait for the child to pause. Because of a race
- X * condition we have to poll for the event.
- X */
- X for (;;) {
- X if (ioctl(tcp->pfd, PIOCSTATUS, &tcp->status) < 0) {
- X perror("strace: PIOCSTATUS");
- X return -1;
- X }
- X if (tcp->status.pr_flags & PR_ASLEEP)
- X break;
- X }
- X }
- X /* Stop the process so that we own the stop. */
- X if (ioctl(tcp->pfd, PIOCSTOP, &tcp->status) < 0) {
- X perror("strace: PIOCSTOP");
- X return -1;
- X }
- X if ((arg = fcntl(tcp->pfd, F_GETFD)) < 0) {
- X perror("F_GETFD");
- X return -1;
- X }
- X if (fcntl(tcp->pfd, F_SETFD, arg|FD_CLOEXEC) < 0) {
- X perror("F_SETFD");
- X return -1;
- X }
- X#ifdef PIOCSET
- X /* Set Run-on-Last-Close. */
- X arg = PR_RLC;
- X if (ioctl(tcp->pfd, PIOCSET, &arg) < 0) {
- X perror("PIOCSET PR_RLC");
- X return -1;
- X }
- X /* Set or Reset Inherit-on-Fork. */
- X arg = PR_FORK;
- X if (ioctl(tcp->pfd, followfork ? PIOCSET : PIOCRESET, &arg) < 0) {
- X perror("PIOC{SET,RESET} PR_FORK");
- X return -1;
- X }
- X#else /* !PIOCSET */
- X if (ioctl(tcp->pfd, PIOCSRLC) < 0) {
- X perror("PIOCSRLC");
- X return -1;
- X }
- X if (ioctl(tcp->pfd, followfork ? PIOCSFORK : PIOCRFORK) < 0) {
- X perror("PIOC{S,R}FORK");
- X return -1;
- X }
- X#endif /* !PIOCSET */
- X /* Enable all syscall enties. */
- X prfillset(&sc_enter);
- X if (ioctl(tcp->pfd, PIOCSENTRY, &sc_enter) < 0) {
- X perror("PIOCSENTRY");
- X return -1;
- X }
- X /* Enable all syscall exits. */
- X prfillset(&sc_exit);
- X if (ioctl(tcp->pfd, PIOCSEXIT, &sc_exit) < 0) {
- X perror("PIOSEXIT");
- X return -1;
- X }
- X /* Enable all signals. */
- X prfillset(&signals);
- X if (ioctl(tcp->pfd, PIOCSTRACE, &signals) < 0) {
- X perror("PIOCSTRACE");
- X return -1;
- X }
- X /* Enable all faults. */
- X prfillset(&faults);
- X if (ioctl(tcp->pfd, PIOCSFAULT, &faults) < 0) {
- X perror("PIOCSFAULT");
- X return -1;
- X }
- X if (!attaching) {
- X /* The child is in a pause(), abort it. */
- X run.pr_flags = PRSABORT;
- X if (ioctl(tcp->pfd, PIOCRUN, &run) < 0) {
- X perror("PIOCRUN");
- X return -1;
- X }
- X /* Wait for the child to come out of the system call. */
- X if (ioctl(tcp->pfd, PIOCWSTOP, &tcp->status) < 0) {
- X perror("PIOCWSTOP");
- X return -1;
- X }
- X /* Then set it running: execve should be next. */
- X if (ioctl(tcp->pfd, PIOCRUN, NULL) < 0) {
- X perror("PIOCRUN");
- X return -1;
- X }
- X }
- X#ifndef HAVE_POLLABLE_PROCFS
- X if (proc_poll_pipe[0] != -1)
- X proc_poller(tcp->pfd);
- X else if (nprocs > 1) {
- X proc_poll_open();
- X proc_poller(last_pfd);
- X proc_poller(tcp->pfd);
- X }
- X last_pfd = tcp->pfd;
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X return 0;
- X}
- X
- X#endif /* SVR4 */
- X
- Xstatic struct tcb *
- Xpid2tcb(pid)
- Xint pid;
- X{
- X int i;
- X struct tcb *tcp;
- X
- X for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
- X if (pid && tcp->pid != pid)
- X continue;
- X if (tcp->flags & TCB_INUSE)
- X return tcp;
- X }
- X return NULL;
- X}
- X
- X#ifdef SVR4
- X
- Xstatic struct tcb *
- Xpfd2tcb(pfd)
- Xint pfd;
- X{
- X int i;
- X struct tcb *tcp;
- X
- X for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
- X if (tcp->pfd != pfd)
- X continue;
- X if (tcp->flags & TCB_INUSE)
- X return tcp;
- X }
- X return NULL;
- X}
- X
- X#endif /* SVR4 */
- X
- Xvoid
- Xdroptcb(tcp)
- Xstruct tcb *tcp;
- X{
- X if (tcp->pid == 0)
- X return;
- X nprocs--;
- X tcp->pid = 0;
- X tcp->flags = 0;
- X if (tcp->pfd != -1) {
- X close(tcp->pfd);
- X tcp->pfd = -1;
- X#ifdef SVR4
- X rebuild_pollv();
- X#endif /* SVR4 */
- X }
- X if (tcp->parent != NULL) {
- X tcp->parent->nchildren--;
- X tcp->parent = NULL;
- X }
- X#if 0
- X if (tcp->outf != stderr)
- X fclose(tcp->outf);
- X#endif
- X tcp->outf = stderr;
- X}
- X
- X#ifndef SVR4
- X
- Xstatic int
- Xresume(tcp)
- Xstruct tcb *tcp;
- X{
- X if (tcp == NULL)
- X return -1;
- X
- X if (!(tcp->flags & TCB_SUSPENDED)) {
- X fprintf(stderr, "PANIC: pid %u not suspended\n", tcp->pid);
- X return -1;
- X }
- X tcp->flags &= ~TCB_SUSPENDED;
- X
- X if (ptrace(PTRACE_SYSCALL, tcp->pid, (char *) 1, 0) < 0) {
- X perror("resume: ptrace(PTRACE_SYSCALL, ...)");
- X return -1;
- X }
- X
- X if (!qflag)
- X fprintf(stderr, "Process %u resumed\n", tcp->pid);
- X return 0;
- X}
- X
- X#endif /* !SVR4 */
- X
- Xstatic int
- Xdetach(tcp, sig)
- Xstruct tcb *tcp;
- Xint sig;
- X{
- X /* detach traced process; continue with sig */
- X int error;
- X int status;
- X
- X if (tcp->flags & TCB_BPTSET)
- X sig = SIGKILL;
- X
- X#ifdef LINUX
- X /*
- X * Linux wrongly insists the child be stopped
- X * before detaching. Arghh. We go through hoops
- X * to make a clean break of things.
- X */
- X if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) == 0) {
- X /* On a clear day, you can see forever. */
- X }
- X else if (errno != ESRCH) {
- X /* Shouldn't happen. */
- X perror("detach: ptrace(PTRACE_DETACH, ...)");
- X }
- X else if (kill(tcp->pid, 0) < 0) {
- X if (errno != ESRCH)
- X perror("detach: checking sanity");
- X }
- X else if (kill(tcp->pid, SIGSTOP) < 0) {
- X if (errno != ESRCH)
- X perror("detach: stopping child");
- X }
- X else {
- X for (;;) {
- X if (waitpid(tcp->pid, &status, 0) < 0) {
- X if (errno != ECHILD)
- X perror("detach: waiting");
- X break;
- X }
- X if (!WIFSTOPPED(status)) {
- X /* Au revoir, mon ami. */
- X break;
- X }
- X if (WSTOPSIG(status) == SIGSTOP) {
- X if ((error = ptrace(PTRACE_DETACH,
- X tcp->pid, (char *) 1, sig)) < 0) {
- X if (errno != ESRCH)
- X perror("detach: ptrace(PTRACE_DETACH, ...)");
- X /* I died trying. */
- X }
- X break;
- X }
- X if ((error = ptrace(PTRACE_CONT, tcp->pid, (char *) 1,
- X WSTOPSIG(status) == SIGTRAP ?
- X 0 : WSTOPSIG(status))) < 0) {
- X if (errno != ESRCH)
- X perror("detach: ptrace(PTRACE_CONT, ...)");
- X break;
- X }
- X }
- X }
- X#endif /* LINUX */
- X
- X#ifdef SUNOS4
- X /* PTRACE_DETACH won't respect `sig' argument, so we post it here. */
- X if (sig && kill(tcp->pid, sig) < 0)
- X perror("detach: kill");
- X sig = 0;
- X if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) < 0)
- X perror("detach: ptrace(PTRACE_DETACH, ...)");
- X#endif /* SUNOS4 */
- X
- X#ifndef SVR4
- X if (waiting_parent(tcp))
- X error = resume(tcp->parent);
- X#endif /* !SVR4 */
- X
- X if (!qflag)
- X fprintf(stderr, "Process %u detached\n", tcp->pid);
- X
- X droptcb(tcp);
- X return error;
- X}
- X
- X#ifdef SVR4
- X
- Xstatic void
- Xreaper(sig)
- Xint sig;
- X{
- X int pid;
- X int status;
- X
- X while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
- X#if 0
- X struct tcb *tcp;
- X
- X tcp = pid2tcb(pid);
- X if (tcp)
- X droptcb(tcp);
- X#endif
- X }
- X}
- X
- X#endif /* SVR4 */
- X
- Xstatic void
- Xcleanup()
- X{
- X int i;
- X struct tcb *tcp;
- X
- X for (i = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
- X if (!(tcp->flags & TCB_INUSE))
- X continue;
- X if (debug)
- X fprintf(stderr,
- X "cleanup: looking at pid %u\n", tcp->pid);
- X if (tcp_last &&
- X (!outfname || followfork < 2 || tcp_last == tcp)) {
- X tprintf(" <unfinished ...>\n");
- X tcp_last = NULL;
- X }
- X if (tcp->flags & TCB_ATTACHED)
- X detach(tcp, 0);
- X else
- X kill(tcp->pid, SIGTERM);
- X }
- X if (cflag)
- X call_summary(outf);
- X}
- X
- Xstatic void
- Xinterrupt(sig)
- Xint sig;
- X{
- X interrupted = 1;
- X}
- X
- X#ifndef HAVE_STRSIGNAL
- X
- Xchar *
- Xstrsignal(sig)
- Xint sig;
- X{
- X static char buf[64];
- X#ifdef HAVE__SYS_SIGLIST
- X extern char *_sys_siglist[];
- X#else
- X extern char *sys_siglist[];
- X#endif
- X
- X if (sig < 1 || sig >= NSIG) {
- X sprintf(buf, "Unknown signal %d", sig);
- X return buf;
- X }
- X#ifdef HAVE__SYS_SIGLIST
- X return _sys_siglist[sig];
- X#else
- X return sys_siglist[sig];
- X#endif
- X}
- X
- X#endif /* HAVE_STRSIGNAL */
- X
- X#ifdef SVR4
- X
- Xstatic void
- Xrebuild_pollv()
- X{
- X int i, j;
- X struct tcb *tcp;
- X
- X for (i = j = 0, tcp = tcbtab; i < MAX_PROCS; i++, tcp++) {
- X if (!(tcp->flags & TCB_INUSE))
- X continue;
- X pollv[j].fd = tcp->pfd;
- X pollv[j].events = POLLPRI;
- X j++;
- X }
- X if (j != nprocs) {
- X fprintf(stderr, "strace: proc miscount\n");
- X exit(1);
- X }
- X}
- X
- X#ifndef HAVE_POLLABLE_PROCFS
- X
- Xstatic void
- Xproc_poll_open()
- X{
- X int arg;
- X int i;
- X
- X if (pipe(proc_poll_pipe) < 0) {
- X perror("pipe");
- X exit(1);
- X }
- X for (i = 0; i < 2; i++) {
- X if ((arg = fcntl(proc_poll_pipe[i], F_GETFD)) < 0) {
- X perror("F_GETFD");
- X exit(1);
- X }
- X if (fcntl(proc_poll_pipe[i], F_SETFD, arg|FD_CLOEXEC) < 0) {
- X perror("F_SETFD");
- X exit(1);
- X }
- X }
- X}
- X
- Xstatic int
- Xproc_poll(pollv, nfds, timeout)
- Xstruct pollfd *pollv;
- Xint nfds;
- Xint timeout;
- X{
- X int i;
- X int n;
- X struct proc_pollfd pollinfo;
- X
- X if ((n = read(proc_poll_pipe[0], &pollinfo, sizeof(pollinfo))) < 0)
- X return n;
- X if (n != sizeof(struct proc_pollfd)) {
- X fprintf(stderr, "panic: short read: %d\n", n);
- X exit(1);
- X }
- X for (i = 0; i < nprocs; i++) {
- X if (pollv[i].fd == pollinfo.fd)
- X pollv[i].revents = pollinfo.revents;
- X else
- X pollv[i].revents = 0;
- X }
- X poller_pid = pollinfo.pid;
- X return 1;
- X}
- X
- Xstatic void
- Xwakeup_handler(sig)
- Xint sig;
- X{
- X}
- X
- Xstatic void
- Xproc_poller(pfd)
- Xint pfd;
- X{
- X struct proc_pollfd pollinfo;
- X struct sigaction sa;
- X sigset_t blocked_set, empty_set;
- X int i;
- X int n;
- X struct rlimit rl;
- X
- X switch (fork()) {
- X case -1:
- X perror("fork");
- X _exit(0);
- X case 0:
- X break;
- X default:
- X return;
- X }
- X
- X sa.sa_handler = interactive ? SIG_DFL : SIG_IGN;
- X sa.sa_flags = 0;
- X sigemptyset(&sa.sa_mask);
- X sigaction(SIGHUP, &sa, NULL);
- X sigaction(SIGINT, &sa, NULL);
- X sigaction(SIGQUIT, &sa, NULL);
- X sigaction(SIGTERM, &sa, NULL);
- X sa.sa_handler = wakeup_handler;
- X sigaction(SIGUSR1, &sa, NULL);
- X sigemptyset(&blocked_set);
- X sigaddset(&blocked_set, SIGUSR1);
- X sigprocmask(SIG_BLOCK, &blocked_set, NULL);
- X sigemptyset(&empty_set);
- X
- X if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
- X perror("getrlimit(RLIMIT_NOFILE, ...)");
- X _exit(0);
- X }
- X n = rl.rlim_cur;
- X for (i = 0; i < n; i++) {
- X if (i != pfd && i != proc_poll_pipe[1])
- X close(i);
- X }
- X
- X pollinfo.fd = pfd;
- X pollinfo.pid = getpid();
- X for (;;) {
- X if (ioctl(pfd, PIOCWSTOP, NULL) < 0) {
- X switch (errno) {
- X case EINTR:
- X continue;
- X case EBADF:
- X pollinfo.revents = POLLERR;
- X break;
- X case ENOENT:
- X pollinfo.revents = POLLHUP;
- X break;
- X default:
- X perror("proc_poller: PIOCWSTOP");
- X }
- X write(proc_poll_pipe[1], &pollinfo, sizeof(pollinfo));
- X _exit(0);
- X }
- X pollinfo.revents = POLLPRI;
- X write(proc_poll_pipe[1], &pollinfo, sizeof(pollinfo));
- X sigsuspend(&empty_set);
- X }
- X}
- X
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X
- Xstatic int
- Xchoose_pfd()
- X{
- X int i, j;
- X struct tcb *tcp;
- X
- X static int last;
- X
- X if (followfork < 2 &&
- X last < nprocs && (pollv[last].revents & POLLPRI)) {
- X /*
- X * The previous process is ready to run again. We'll
- X * let it do so if it is currently in a syscall. This
- X * heuristic improves the readability of the trace.
- X */
- X tcp = pfd2tcb(pollv[last].fd);
- X if (tcp && (tcp->flags & TCB_INSYSCALL))
- X return pollv[last].fd;
- X }
- X
- X for (i = 0; i < nprocs; i++) {
- X /* Let competing children run round robin. */
- X j = (i + last + 1) % nprocs;
- X if (pollv[j].revents & (POLLHUP | POLLERR)) {
- X tcp = pfd2tcb(pollv[j].fd);
- X if (!tcp) {
- X fprintf(stderr, "strace: lost proc\n");
- X exit(1);
- X }
- X droptcb(tcp);
- X return -1;
- X }
- X if (pollv[j].revents & POLLPRI) {
- X last = j;
- X return pollv[j].fd;
- X }
- X }
- X fprintf(stderr, "strace: nothing ready\n");
- X exit(1);
- X}
- X
- Xstatic int
- Xtrace()
- X{
- X struct tcb *tcp;
- X int pfd;
- X int what;
- X int ioctl_result, ioctl_errno;
- X
- X for (;;) {
- X if (interactive)
- X sigprocmask(SIG_SETMASK, &empty_set, NULL);
- X
- X switch (nprocs) {
- X case 0:
- X return 0;
- X case 1:
- X#ifndef HAVE_POLLABLE_PROCFS
- X if (proc_poll_pipe[0] == -1) {
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X tcp = pid2tcb(0);
- X if (!tcp)
- X continue;
- X pfd = tcp->pfd;
- X if (pfd == -1)
- X continue;
- X break;
- X#ifndef HAVE_POLLABLE_PROCFS
- X }
- X /* fall through ... */
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X default:
- X#ifdef HAVE_POLLABLE_PROCFS
- X if (poll(pollv, nprocs, INFTIM) < 0) {
- X if (interrupted)
- X return 0;
- X continue;
- X }
- X#else /* !HAVE_POLLABLE_PROCFS */
- X if (proc_poll(pollv, nprocs, INFTIM) < 0) {
- X if (interrupted)
- X return 0;
- X continue;
- X }
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X pfd = choose_pfd();
- X if (pfd == -1)
- X continue;
- X break;
- X }
- X
- X /* Look up `pfd' in our table. */
- X if ((tcp = pfd2tcb(pfd)) == NULL) {
- X fprintf(stderr, "unknown pfd: %u\n", pfd);
- X exit(1);
- X }
- X /* Get the status of the process. */
- X if (!interrupted) {
- X ioctl_result = ioctl(tcp->pfd, PIOCWSTOP,
- X &tcp->status);
- X ioctl_errno = errno;
- X#ifndef HAVE_POLLABLE_PROCFS
- X if (proc_poll_pipe[0] != -1) {
- X if (ioctl_result < 0)
- X kill(poller_pid, SIGKILL);
- X else
- X kill(poller_pid, SIGUSR1);
- X }
- X#endif /* !HAVE_POLLABLE_PROCFS */
- X }
- X if (interrupted)
- X return 0;
- X
- X if (interactive)
- X sigprocmask(SIG_BLOCK, &blocked_set, NULL);
- X
- X if (ioctl_result < 0) {
- X /* Find out what happened if it failed. */
- X switch (ioctl_errno) {
- X case EINTR:
- X case EBADF:
- X continue;
- X case ENOENT:
- X droptcb(tcp);
- X continue;
- X default:
- X perror("PIOCWSTOP");
- X exit(1);
- X }
- X }
- X
- X /* clear the just started flag */
- X tcp->flags &= ~TCB_STARTUP;
- X
- X /* set current output file */
- X outf = tcp->outf;
- X
- X if (cflag) {
- X struct timeval stime;
- X
- X stime.tv_sec = tcp->status.pr_stime.tv_sec;
- X stime.tv_usec = tcp->status.pr_stime.tv_nsec/1000;
- X tv_sub(&tcp->dtime, &stime, &tcp->stime);
- X tcp->stime = stime;
- X }
- X
- X what = tcp->status.pr_what;
- X switch (tcp->status.pr_why) {
- X case PR_REQUESTED:
- X if (tcp->status.pr_flags & PR_ASLEEP) {
- X tcp->status.pr_why = PR_SYSENTRY;
- X if (syscall(tcp) < 0) {
- X fprintf(stderr, "syscall trouble\n");
- X exit(1);
- X }
- X }
- X break;
- X case PR_SYSENTRY:
- X case PR_SYSEXIT:
- X if (syscall(tcp) < 0) {
- X fprintf(stderr, "syscall trouble\n");
- X exit(1);
- X }
- X break;
- X case PR_SIGNALLED:
- X if (!cflag && (qual_flags[what] & QUAL_SIGNAL)) {
- X printleader(tcp);
- X tprintf("--- %s (%s) ---",
- X signalent[what], strsignal(what));
- X printtrailer(tcp);
- X }
- X break;
- X case PR_FAULTED:
- X if (!cflag && (qual_flags[what] & QUAL_FAULT)) {
- X printleader(tcp);
- X tprintf("=== FAULT %d ===", what);
- X printtrailer(tcp);
- X }
- X break;
- X default:
- X fprintf(stderr, "odd stop %d\n", tcp->status.pr_why);
- X exit(1);
- X break;
- X }
- X if (ioctl(tcp->pfd, PIOCRUN, NULL) < 0) {
- X perror("PIOCRUN");
- X exit(1);
- X }
- X }
- X return 0;
- X}
- X
- X#else /* !SVR4 */
- X
- Xstatic int
- Xtrace()
- X{
- X int pid;
- X int wait_errno;
- X int status;
- X struct tcb *tcp;
- X#ifdef LINUX
- X struct rusage ru;
- X#endif /* LINUX */
- X
- X for (;;) {
- X if (interactive)
- X sigprocmask(SIG_SETMASK, &empty_set, NULL);
- X#ifdef LINUX
- X pid = wait4(-1, &status, 0, cflag ? &ru : NULL);
- X#endif /* LINUX */
- X#ifdef SUNOS4
- X pid = wait(&status);
- X#endif /* SUNOS4 */
- X wait_errno = errno;
- X if (interactive)
- X sigprocmask(SIG_BLOCK, &blocked_set, NULL);
- X
- X if (interrupted)
- X return 0;
- X
- X if (pid == -1) {
- X switch (wait_errno) {
- X case EINTR:
- X continue;
- X case ECHILD:
- X /*
- X * We would like to verify this case
- X * but sometimes a race in Solbourne's
- X * version of SunOS sometimes reports
- X * ECHILD before sending us SIGCHILD.
- X */
- X#if 0
- X if (nprocs == 0)
- X return 0;
- X fprintf(stderr, "strace: proc miscount\n");
- X exit(1);
- X#endif
- X return 0;
- X default:
- X errno = wait_errno;
- X perror("strace: wait");
- X return -1;
- X }
- X }
- X if (debug)
- X fprintf(stderr, " [wait(%#x) = %u]\n", status, pid);
- X
- X /* Look up `pid' in our table. */
- X if ((tcp = pid2tcb(pid)) == NULL) {
- X fprintf(stderr, "unknown pid: %u\n", pid);
- X if (WIFSTOPPED(status))
- X ptrace(PTRACE_CONT, pid, (char *) 1, 0);
- X exit(1);
- X }
- X /* set current output file */
- X outf = tcp->outf;
- X if (cflag) {
- X#ifdef LINUX
- X tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime);
- X tcp->stime = ru.ru_stime;
- X#endif /* !LINUX */
- X }
- X
- X if (tcp->flags & TCB_SUSPENDED) {
- X /*
- X * Apparently, doing any ptrace() call on a stopped
- X * process, provokes the kernel to report the process
- X * status again on a subsequent wait(), even if the
- X * process has not been actually restarted.
- X * Since we have inspected the arguments of suspended
- X * processes we end up here testing for this case.
- X */
- X continue;
- X }
- X if (WIFSIGNALED(status)) {
- X if (!cflag
- X && (qual_flags[WTERMSIG(status)] & QUAL_SIGNAL)) {
- X printleader(tcp);
- X tprintf("+++ killed by %s +++",
- X signalent[WTERMSIG(status)]);
- X printtrailer(tcp);
- X }
- X droptcb(tcp);
- X continue;
- X }
- X if (WIFEXITED(status)) {
- X if (debug)
- X fprintf(stderr, "pid %u exited\n", pid);
- X if (tcp->flags & TCB_ATTACHED)
- X fprintf(stderr,
- X "PANIC: attached pid %u exited\n",
- X pid);
- X droptcb(tcp);
- X continue;
- X }
- X if (!WIFSTOPPED(status)) {
- X fprintf(stderr, "PANIC: pid %u not stopped\n", pid);
- X droptcb(tcp);
- X continue;
- X }
- X if (debug)
- X fprintf(stderr, "pid %u stopped, [%s]\n",
- X pid, signalent[WSTOPSIG(status)]);
- X
- X if (tcp->flags & TCB_STARTUP) {
- X /*
- X * This flag is there to keep us in sync
- X * Next time this process stops it should
- X * really be entering a system call.
- X */
- X tcp->flags &= ~TCB_STARTUP;
- X if (tcp->flags & TCB_ATTACHED) {
- X /*
- X * Interestingly, the process may stop
- X * with STOPSIG equal to some other signal
- X * than SIGSTOP if we happend to attach
- X * just before the process takes a signal.
- X */
- X if (!WIFSTOPPED(status)) {
- X fprintf(stderr,
- X "pid %u not stopped\n", pid);
- X detach(tcp, WSTOPSIG(status));
- X continue;
- X }
- X }
- X else {
- X#ifdef SUNOS4
- X /* A child of us stopped at exec */
- X if (WSTOPSIG(status) == SIGTRAP && followvfork)
- X fixvfork(tcp);
- X#endif /* SUNOS4 */
- X }
- X if (tcp->flags & TCB_BPTSET) {
- X if (clearbpt(tcp) < 0) /* Pretty fatal */ {
- X droptcb(tcp);
- X cleanup();
- X return -1;
- X }
- X }
- X goto tracing;
- X }
- X
- X if (WSTOPSIG(status) != SIGTRAP) {
- X if (WSTOPSIG(status) == SIGSTOP &&
- X (tcp->flags & TCB_SIGTRAPPED)) {
- X /*
- X * Trapped attempt to block SIGTRAP
- X * Hope we are back in control now.
- X */
- X tcp->flags &= ~(TCB_INSYSCALL | TCB_SIGTRAPPED);
- X if (ptrace(PTRACE_SYSCALL,
- X pid, (char *) 1, 0) < 0) {
- X perror("trace: ptrace(PTRACE_SYSCALL, ...)");
- X cleanup();
- X return -1;
- X }
- X continue;
- X }
- X if (!cflag
- X && (qual_flags[WSTOPSIG(status)] & QUAL_SIGNAL)) {
- X printleader(tcp);
- X tprintf("--- %s (%s) ---",
- X signalent[WSTOPSIG(status)],
- X strsignal(WSTOPSIG(status)));
- X printtrailer(tcp);
- X }
- X if ((tcp->flags & TCB_ATTACHED) &&
- X !sigishandled(tcp, WSTOPSIG(status))) {
- X detach(tcp, WSTOPSIG(status));
- X continue;
- X }
- X if (ptrace(PTRACE_SYSCALL, pid, (char *) 1,
- X WSTOPSIG(status)) < 0) {
- X perror("trace: ptrace(PTRACE_SYSCALL, ...)");
- X cleanup();
- X return -1;
- X }
- X tcp->flags &= ~TCB_SUSPENDED;
- X continue;
- X }
- X if (syscall(tcp) < 0) {
- X if (tcp->flags & TCB_ATTACHED)
- X detach(tcp, 0);
- X else {
- X ptrace(PTRACE_KILL,
- X tcp->pid, (char *) 1, SIGTERM);
- X droptcb(tcp);
- X }
- X continue;
- X }
- X if (tcp->flags & TCB_EXITING) {
- X if (tcp->flags & TCB_ATTACHED)
- X detach(tcp, 0);
- X else if (ptrace(PTRACE_CONT, pid, (char *) 1, 0) < 0) {
- X perror("strace: ptrace(PTRACE_CONT, ...)");
- X cleanup();
- X return -1;
- X }
- X continue;
- X }
- X if (tcp->flags & TCB_SUSPENDED) {
- X if (!qflag)
- X fprintf(stderr, "Process %u suspended\n", pid);
- X continue;
- X }
- X tracing:
- X if (ptrace(PTRACE_SYSCALL, pid, (char *) 1, 0) < 0) {
- X perror("trace: ptrace(PTRACE_SYSCALL, ...)");
- X cleanup();
- X return -1;
- X }
- X }
- X return 0;
- X}
- X
- X#endif /* !SVR4 */
- X
- Xstatic int curcol;
- X
- X#ifdef __STDC__
- X#include <stdarg.h>
- X#define VA_START(a, b) va_start(a, b)
- X#else
- X#include <varargs.h>
- X#define VA_START(a, b) va_start(a)
- X#endif
- X
- Xvoid
- X#ifdef __STDC__
- Xtprintf(const char *fmt, ...)
- X#else
- Xtprintf(fmt, va_alist)
- Xchar *fmt;
- Xva_dcl
- X#endif
- X{
- X va_list args;
- X
- X VA_START(args, fmt);
- X curcol += vfprintf(outf, fmt, args);
- X va_end(args);
- X return;
- X}
- X
- Xvoid
- Xprintleader(tcp)
- Xstruct tcb *tcp;
- X{
- X if (tcp_last && (!outfname || followfork < 2 || tcp_last == tcp)) {
- X tcp_last->flags |= TCB_REPRINT;
- X tprintf(" <unfinished ...>\n");
- X }
- X curcol = 0;
- X if (followfork == 1 && outfname)
- X tprintf("%-5d ", tcp->pid);
- X else if (nprocs > 1 && !outfname)
- X tprintf("[pid %5u] ", tcp->pid);
- X if (tflag) {
- X char str[sizeof("HH:MM:SS")];
- X struct timeval tv, dtv;
- X static struct timeval otv;
- X
- X gettimeofday(&tv, NULL);
- X if (rflag) {
- X if (otv.tv_sec == 0)
- X otv = tv;
- X tv_sub(&dtv, &tv, &otv);
- X tprintf("%6ld.%06ld ", dtv.tv_sec, dtv.tv_usec);
- X otv = tv;
- X }
- X else if (tflag > 2)
- X tprintf("%ld.%06ld ", tv.tv_sec, tv.tv_usec);
- X else {
- X strftime(str, sizeof(str), "%T", localtime(&tv.tv_sec));
- X if (tflag > 1)
- X tprintf("%s.%06ld ", str, tv.tv_usec);
- X else
- X tprintf("%s ", str);
- X }
- X }
- X if (iflag)
- X printcall(tcp);
- X}
- X
- Xvoid
- Xtabto(col)
- Xint col;
- X{
- X if (curcol < col)
- X tprintf("%*s", col - curcol, "");
- X}
- X
- Xvoid
- Xprinttrailer(tcp)
- Xstruct tcb *tcp;
- X{
- X tprintf("\n");
- X tcp_last = NULL;
- X}
- END_OF_FILE
- if test 31363 -ne `wc -c <'strace-3.0/strace.c'`; then
- echo shar: \"'strace-3.0/strace.c'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/strace.c'
- fi
- if test -f 'strace-3.0/sunos4/ioctlent.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/sunos4/ioctlent.h'\"
- else
- echo shar: Extracting \"'strace-3.0/sunos4/ioctlent.h'\" \(22969 characters\)
- sed "s/^X//" >'strace-3.0/sunos4/ioctlent.h' <<'END_OF_FILE'
- X{"sun/audioio.h", "AUDIO_DRAIN", 0x20004103},
- X{"sun/isdnio.h", "ISDN_PH_ACTIVATE_REQ", 0x2000410a},
- X{"sun/isdnio.h", "ISDN_MPH_DEACTIVATE_REQ", 0x2000410b},
- X{"sun/fbio.h", "FBIO_WID_DBL_SET", 0x20004625},
- X{"pixrect/gp1var.h", "GP1IO_SCMAP", 0x20004766},
- X{"sun/mem.h", "MM_HRCNT", 0x20004d02},
- X{"sundev/openpromio.h", "OPROMGETOPT", 0x20004f01},
- X{"sundev/openpromio.h", "OPROMSETOPT", 0x20004f02},
- X{"sundev/openpromio.h", "OPROMNXTOPT", 0x20004f03},
- X{"sundev/openpromio.h", "OPROMSETOPT2", 0x20004f04},
- X{"sundev/openpromio.h", "OPROMNEXT", 0x20004f05},
- X{"sundev/openpromio.h", "OPROMCHILD", 0x20004f06},
- X{"sundev/openpromio.h", "OPROMGETPROP", 0x20004f07},
- X{"sundev/openpromio.h", "OPROMNXTPROP", 0x20004f08},
- X{"sundev/openpromio.h", "OPROMU2P", 0x20004f09},
- X{"sundev/openpromio.h", "OPROMGETCONS", 0x20004f0a},
- X{"stropts.h", "I_POP", 0x20005303},
- X{"sys/stropts.h", "I_POP", 0x20005303},
- X{"stropts.h", "I_FLUSH", 0x20005305},
- X{"sys/stropts.h", "I_FLUSH", 0x20005305},
- X{"sys/stropts.h", "I_SRDOPT", 0x20005306},
- X{"stropts.h", "I_SRDOPT", 0x20005306},
- X{"sys/stropts.h", "I_SETSIG", 0x20005309},
- X{"stropts.h", "I_SETSIG", 0x20005309},
- X{"sys/stropts.h", "I_LINK", 0x2000530c},
- X{"stropts.h", "I_LINK", 0x2000530c},
- X{"sys/stropts.h", "I_UNLINK", 0x2000530d},
- X{"stropts.h", "I_UNLINK", 0x2000530d},
- X{"sys/stropts.h", "I_SENDFD", 0x20005311},
- X{"stropts.h", "I_SENDFD", 0x20005311},
- X{"sys/stropts.h", "I_PLINK", 0x20005313},
- X{"stropts.h", "I_PLINK", 0x20005313},
- X{"stropts.h", "I_PUNLINK", 0x20005314},
- X{"sys/stropts.h", "I_PUNLINK", 0x20005314},
- X{"termio.h", "TCSBRK", 0x20005405},
- X{"sys/termio.h", "TCSBRK", 0x20005405},
- X{"termios.h", "TCXONC", 0x20005406},
- X{"sys/termios.h", "TCXONC", 0x20005406},
- X{"sys/termios.h", "TCFLSH", 0x20005407},
- X{"termios.h", "TCFLSH", 0x20005407},
- X{"sun/tvio.h", "TVIOGRAB", 0x2000581d},
- X{"sun/tvio.h", "TVIORELEASE", 0x2000581e},
- X{"sun/tvio.h", "TVIOREDIRECT", 0x20005822},
- X{"sun/tvio.h", "TVIOSYNC", 0x20005825},
- X{"sun/tvio.h", "TVIOVWAIT", 0x2000582d},
- X{"sun/tvio.h", "TVIOSLOOPBACKCAL", 0x2000583d},
- X{"sbusdev/bpp_io.h", "BPPIOC_TESTIO", 0x20006206},
- X{"scsi/targets/srdef.h", "CDROMPAUSE", 0x2000630a},
- X{"sundev/srreg.h", "CDROMPAUSE", 0x2000630a},
- X{"sundev/srreg.h", "CDROMRESUME", 0x2000630b},
- X{"sundev/srreg.h", "CDROMSTOP", 0x20006369},
- X{"scsi/targets/srdef.h", "CDROMSTOP", 0x20006369},
- X{"scsi/targets/srdef.h", "CDROMSTART", 0x2000636a},
- X{"sundev/srreg.h", "CDROMSTART", 0x2000636a},
- X{"scsi/targets/srdef.h", "CDROMEJECT", 0x2000636b},
- X{"sundev/srreg.h", "CDROMEJECT", 0x2000636b},
- X{"sun/dkio.h", "FDKEJECT", 0x20006470},
- X{"sys/filio.h", "FIOCLEX", 0x20006601},
- X{"sys/filio.h", "FIONCLEX", 0x20006602},
- X{"sys/filio.h", "FIOLFS", 0x20006640},
- X{"sys/filio.h", "FIOLFSS", 0x20006641},
- X{"sys/filio.h", "FIOFFS", 0x20006642},
- X{"sys/filio.h", "FIOAI", 0x20006643},
- X{"sys/filio.h", "FIODUTIMES", 0x20006644},
- X{"sys/filio.h", "FIODIO", 0x20006645},
- X{"sys/filio.h", "FIODIOS", 0x20006646},
- X{"sunwindow/win_ioctl.h", "WININSERT", 0x20006703},
- X{"sunwindow/win_ioctl.h", "WINREMOVE", 0x20006704},
- X{"sunwindow/win_ioctl.h", "WINCOMPUTECLIPPING", 0x20006712},
- X{"sunwindow/win_ioctl.h", "WINLOCKDATA", 0x20006715},
- X{"sunwindow/win_ioctl.h", "WINUNLOCKDATA", 0x20006716},
- X{"sunwindow/win_ioctl.h", "WINGRABIO", 0x20006717},
- X{"sunwindow/win_ioctl.h", "WINRELEASEIO", 0x20006718},
- X{"sunwindow/win_ioctl.h", "WINUNLOCKEVENT", 0x2000671c},
- X{"sunwindow/win_ioctl.h", "WINUNLOCKSCREEN", 0x2000671e},
- X{"sunwindow/win_ioctl.h", "WINSCREENDESTROY", 0x2000672a},
- X{"sunwindow/win_ioctl.h", "WINPRINT", 0x2000672c},
- X{"sunwindow/win_ioctl.h", "WINREFUSEKBDFOCUS", 0x2000673a},
- X{"sunwindow/win_ioctl.h", "WINDBLACCESS", 0x20006747},
- X{"sunwindow/win_ioctl.h", "WINDBLFLIP", 0x20006748},
- X{"sunwindow/win_ioctl.h", "WINDBLABSORB", 0x20006749},
- X{"sunwindow/win_ioctl.h", "WINDBLRLSE", 0x2000674a},
- X{"sunwindow/win_ioctl.h", "WINSHAREQUEUE", 0x20006750},
- X{"sunwindow/win_ioctl.h", "WINDISCONNECT", 0x20006798},
- X{"sunwindow/win_ioctl.h", "WINRECONNECT", 0x20006799},
- X{"sun/ndio.h", "NDIOCSON", 0x20006e00},
- X{"sun/ndio.h", "NDIOCSOFF", 0x20006e01},
- X{"sun/ndio.h", "NDIOCCLEAR", 0x20006e05},
- X{"net/nit_buf.h", "NIOCCTIME", 0x20007008},
- X{"sys/ttold.h", "TIOCHPCL", 0x20007402},
- X{"sbusdev/gtreg.h", "FB_SETSERVER", 0x20007407},
- X{"sys/ttold.h", "TIOCEXCL", 0x2000740d},
- X{"sys/ttold.h", "TIOCNXCL", 0x2000740e},
- X{"sbusdev/gtreg.h", "FB_DISCONNECT", 0x20007410},
- X{"sbusdev/gtreg.h", "FB_UNGRABHW", 0x20007414},
- X{"sys/ttycom.h", "TIOCCONS", 0x20007424},
- X{"sys/ttold.h", "_O_TIOCCONS", 0x20007468},
- X{"sys/ttold.h", "TIOCSTART", 0x2000746e},
- X{"sys/ttold.h", "TIOCSTOP", 0x2000746f},
- X{"sys/ttycom.h", "TIOCNOTTY", 0x20007471},
- X{"sys/ttold.h", "TIOCCDTR", 0x20007478},
- X{"sys/ttold.h", "TIOCSDTR", 0x20007479},
- X{"sys/ttold.h", "TIOCCBRK", 0x2000747a},
- X{"sys/ttold.h", "TIOCSBRK", 0x2000747b},
- X{"sys/ttycom.h", "TIOCSCTTY", 0x20007484},
- X{"sun/gpio.h", "GP1IO_GET_TRUMINORDEV", 0x40014708},
- X{"sundev/kbio.h", "KIOCGLED", 0x40016b0f},
- X{"sundev/ppreg.h", "PPIOCGETS", 0x40017000},
- X{"sundev/ppreg.h", "PPIOCGETC", 0x40017001},
- X{"sun/gpio.h", "GP1IO_GET_REQDEV", 0x40024707},
- X{"sun/tvio.h", "TVIOGBIND", 0x4002581f},
- X{"sbusdev/bpp_io.h", "BPPIOC_GETOUTPINS", 0x40026204},
- X{"sundev/srreg.h", "CDROMREADTOCHDR", 0x40026367},
- X{"sbusdev/bpp_io.h", "BPPIOC_GETERR", 0x40036205},
- X{"sun/audioio.h", "AUDIO_GETDEV", 0x40044104},
- X{"sun/fbio.h", "FBIOGVIDEO", 0x40044608},
- X{"sun/fbio.h", "GRABPAGEALLOC", 0x4004460a},
- X{"sun/fbio.h", "FBIOGPLNGRP", 0x4004460d},
- X{"sun/fbio.h", "FBIOGCMSIZE", 0x4004460e},
- X{"sun/fbio.h", "FBIOAVAILPLNGRP", 0x40044611},
- X{"sun/fbio.h", "FBIOSWINFD", 0x40044614},
- X{"sun/fbio.h", "FBIOSAVWINFD", 0x40044615},
- X{"sun/fbio.h", "FBIORESWINFD", 0x40044616},
- X{"sun/fbio.h", "FBIOSRWINFD", 0x40044617},
- X{"sun/fbio.h", "FBIOGCURMAX", 0x4004461c},
- X{"sun/fbio.h", "GRABLOCKINFO", 0x4004461d},
- X{"sun/fbio.h", "FBIO_DEVID", 0x40044622},
- X{"sun/fbio.h", "FBIO_FULLSCREEN_ELIMINATION_GROUPS", 0x40044624},
- X{"sun/fbio.h", "FBIOVRTOFFSET", 0x40044626},
- X{"sun/gpio.h", "GP1IO_GET_STATIC_BLOCK", 0x40044701},
- X{"sun/gpio.h", "GP1IO_GET_GBUFFER_STATE", 0x40044703},
- X{"sun/gpio.h", "GP1IO_GET_RESTART_COUNT", 0x40044705},
- X{"sun/gpio.h", "GP1IO_CHK_FOR_GBUFFER", 0x40044709},
- X{"stropts.h", "I_NREAD", 0x40045301},
- X{"sys/stropts.h", "I_NREAD", 0x40045301},
- X{"sys/stropts.h", "I_GRDOPT", 0x40045307},
- X{"stropts.h", "I_GRDOPT", 0x40045307},
- X{"sys/stropts.h", "I_GETSIG", 0x4004530a},
- X{"stropts.h", "I_GETSIG", 0x4004530a},
- X{"sun/tvio.h", "TVIOGFORMAT", 0x40045801},
- X{"sun/tvio.h", "TVIOGCOMPOUT", 0x40045803},
- X{"sun/tvio.h", "TVIOGSYNC", 0x40045805},
- X{"pixrect/cg8var.h", "PIPIO_G_PIP_ON_OFF", 0x40045805},
- X{"sun/tvio.h", "TVIOGOUT", 0x40045807},
- X{"sun/tvio.h", "TVIOGCOMPRESS", 0x40045809},
- X{"pixrect/cg8var.h", "PIPIO_G_PIP_ON_OFF_RESUME", 0x40045809},
- X{"pixrect/cg8var.h", "PIPIO_G_PIP_ON_OFF_SUSPEND", 0x4004580a},
- X{"sun/tvio.h", "TVIOGCHROMAGAIN", 0x4004580b},
- X{"sun/tvio.h", "TVIOGREDGAIN", 0x4004580d},
- X{"sun/tvio.h", "TVIOGREDBLACK", 0x4004580f},
- X{"sun/tvio.h", "TVIOGGREENGAIN", 0x40045811},
- X{"sun/tvio.h", "TVIOGGREENBLACK", 0x40045813},
- X{"sun/tvio.h", "TVIOGBLUEGAIN", 0x40045815},
- X{"sun/tvio.h", "TVIOGBLUEBLACK", 0x40045817},
- X{"sun/tvio.h", "TVIOGLUMAGAIN", 0x40045819},
- X{"sun/tvio.h", "TVIOGBTYPE", 0x40045821},
- X{"sun/tvio.h", "TVIOGLIVE", 0x40045823},
- X{"sun/tvio.h", "TVIOGCHROMASEP", 0x40045827},
- X{"pixrect/cg8var.h", "PIPIO_G_CURSOR_COLOR_FREEZE", 0x40045828},
- X{"sun/tvio.h", "TVIOGCHROMADEMOD", 0x40045829},
- X{"pixrect/cg8var.h", "PIPIO_G_TEST", 0x4004582b},
- X{"sun/tvio.h", "TVIOGGENLOCK", 0x4004582b},
- X{"sun/tvio.h", "TVIOGSYNCABSENT", 0x4004582e},
- X{"sun/tvio.h", "TVIOGBURSTABSENT", 0x4004582f},
- X{"sun/tvio.h", "TVIOGIBSTATE", 0x40045837},
- X{"sun/tvio.h", "TVIOGABSTATE", 0x40045839},
- X{"sun/tvio.h", "TVIOGCONTROL", 0x4004583b},
- X{"sun/dkio.h", "FDKGETCHANGE", 0x4004646f},
- X{"sys/filio.h", "FIOGETOWN", 0x4004667b},
- X{"sys/filio.h", "FIONREAD", 0x4004667f},
- X{"sunwindow/win_ioctl.h", "WINGETUSERFLAGS", 0x4004670e},
- X{"sunwindow/win_ioctl.h", "WINGETOWNER", 0x40046710},
- X{"sunwindow/win_ioctl.h", "WINGETBUTTONORDER", 0x40046724},
- X{"sunwindow/win_ioctl.h", "WINGETNEXTINPUT", 0x40046739},
- X{"sunwindow/win_ioctl.h", "WINGETPLANEGROUP", 0x40046740},
- X{"sunwindow/win_ioctl.h", "WINGETNOTIFYALL", 0x40046751},
- X{"sundev/kbio.h", "KIOCGTRANS", 0x40046b05},
- X{"sundev/kbio.h", "KIOCGTRANSABLE", 0x40046b07},
- X{"sundev/kbio.h", "KIOCTYPE", 0x40046b09},
- X{"sundev/kbio.h", "KIOCGDIRECT", 0x40046b0b},
- X{"sundev/kbio.h", "KIOCGCOMPAT", 0x40046b11},
- X{"sundev/kbio.h", "KIOCLAYOUT", 0x40046b14},
- X{"sys/sockio.h", "SIOCGHIWAT", 0x40047301},
- X{"sys/sockio.h", "SIOCGLOWAT", 0x40047303},
- X{"sys/sockio.h", "SIOCATMARK", 0x40047307},
- X{"sys/sockio.h", "SIOCGPGRP", 0x40047309},
- X{"sys/ttold.h", "TIOCGETD", 0x40047400},
- X{"sys/ttold.h", "TIOCMODG", 0x40047403},
- X{"sbusdev/gtreg.h", "FB_GETWPART", 0x4004740a},
- X{"sbusdev/gtreg.h", "FB_GETMONITOR", 0x4004740c},
- X{"sbusdev/gtreg.h", "FB_GRABHW", 0x40047413},
- X{"sbusdev/gtreg.h", "FB_GETCLUTPART", 0x40047418},
- X{"sys/ttold.h", "TIOCGETX", 0x40047423},
- X{"sys/ttycom.h", "TIOCGSOFTCAR", 0x40047464},
- X{"sys/ttycom.h", "TIOCMGET", 0x4004746a},
- X{"sys/ttycom.h", "TIOCOUTQ", 0x40047473},
- X{"sys/ttycom.h", "TIOCGPGRP", 0x40047477},
- X{"sys/ttold.h", "TIOCLGET", 0x4004747c},
- X{"sys/ttycom.h", "TIOCISPACE", 0x40047480},
- X{"sys/ttycom.h", "TIOCISIZE", 0x40047481},
- X{"sys/ttycom.h", "TIOCGETPGRP", 0x40047483},
- X{"sys/vcmd.h", "VGETSTATE", 0x40047600},
- X{"sundev/vuid_event.h", "VUIDGFORMAT", 0x40047602},
- X{"sun/dkio.h", "DKIOCGTYPE", 0x4006647c},
- X{"sys/ttold.h", "TIOCGETP", 0x40067408},
- X{"sys/ttold.h", "TIOCGETC", 0x40067412},
- X{"sys/ttold.h", "TIOCGLTC", 0x40067474},
- X{"sun/tvio.h", "TVIOGPOS", 0x4008581b},
- X{"sun/dkio.h", "DKIOCGPART", 0x40086404},
- X{"sun/dkio.h", "FDKGETSEARCH", 0x4008646c},
- X{"sunwindow/win_ioctl.h", "WINNEXTFREE", 0x40086705},
- X{"sunwindow/win_ioctl.h", "WINGETRECT", 0x4008670a},
- X{"sunwindow/win_ioctl.h", "WINGETSAVEDRECT", 0x4008670d},
- X{"sunwindow/win_ioctl.h", "WINGETEVENTTIMEOUT", 0x4008673c},
- X{"sunwindow/win_ioctl.h", "WINDBLCURRENT", 0x4008674d},
- X{"sun/sqz.h", "SQZGET", 0x40087102},
- X{"sbusdev/gtreg.h", "FB_GETLIGHTPENPARAM", 0x4008741b},
- X{"sbusdev/gtreg.h", "FB_GETGAMMA", 0x40087420},
- X{"sys/ttycom.h", "TIOCGSIZE", 0x40087426},
- X{"sys/ttold.h", "_O_TIOCGSIZE", 0x40087466},
- X{"sys/ttycom.h", "TIOCGWINSZ", 0x40087468},
- X{"sun/dkio.h", "DKIOCINFO", 0x400c6408},
- X{"sun/dkio.h", "DKIOCGDIAG", 0x400c6474},
- X{"sun/dkio.h", "DKIOCGLOG", 0x400c6476},
- X{"sunwindow/win_ioctl.h", "WINGETFOCUSEVENT", 0x400c6747},
- X{"sunwindow/win_ioctl.h", "WINGETSWALLOWEVENT", 0x400c6749},
- X{"pixrect/cg8var.h", "PIPIO_G_EMULATION_MODE", 0x400e5803},
- X{"sun/fbio.h", "FBIOGXINFO", 0x40104627},
- X{"sys/stropts.h", "I_RECVFD", 0x40105312},
- X{"stropts.h", "I_RECVFD", 0x40105312},
- X{"sunwindow/win_ioctl.h", "WINGETSCREENPOSITIONS", 0x4010672d},
- X{"scsi/targets/stdef.h", "STIOCGET", 0x40106d02},
- X{"sundev/streg.h", "STIOCGET", 0x40106d02},
- X{"sys/termio.h", "TCGETA", 0x40125401},
- X{"termio.h", "TCGETA", 0x40125401},
- X{"sunwindow/win_ioctl.h", "WINGETAVAILPLANEGROUPS", 0x40146742},
- X{"sun/fbio.h", "FBIOGTYPE", 0x40184600},
- X{"sun/fbio.h", "FBIOGINFO", 0x40184602},
- X{"sun/fbio.h", "FBIODBLGINFO", 0x40184612},
- X{"sys/mtio.h", "MTIOCGET", 0x40186d02},
- X{"sun/dkio.h", "FDKIOGCHAR", 0x401c6472},
- X{"sun/fbio.h", "FBIOMONINFO", 0x40204628},
- X{"sbusdev/bpp_io.h", "BPPIOC_GETPARMS", 0x40206202},
- X{"sbusdev/gtreg.h", "FB_GT_GETVERSION", 0x40207429},
- X{"sys/termios.h", "TCGETS", 0x40245408},
- X{"termios.h", "TCGETS", 0x40245408},
- X{"sun/dkio.h", "DKIOCGGEOM", 0x40266402},
- X{"sunwindow/win_ioctl.h", "WINGETKBDMASK", 0x40346734},
- X{"sunwindow/win_ioctl.h", "WINGETPICKMASK", 0x40346735},
- X{"sun/dkio.h", "FDKGETDRIVECHAR", 0x4038646e},
- X{"sun/dkio.h", "DKIOCGCONF", 0x403c647e},
- X{"sun/tvio.h", "TVIOGVIDEOCAL", 0x40405831},
- X{"sun/tvio.h", "TVIONVREAD", 0x40405833},
- X{"sun/dkio.h", "DKIOCGAPART", 0x4040647a},
- X{"sunwindow/win_ioctl.h", "WINGETSCALING", 0x40406726},
- X{"sun/fbio.h", "FBIOGATTR", 0x40584606},
- X{"sunwindow/win_ioctl.h", "WINSCREENGET", 0x40646729},
- X{"sunwindow/win_ioctl.h", "WINGETINPUTMASK", 0x406c6713},
- X{"sun/audioio.h", "AUDIO_GETINFO", 0x40844101},
- X{"pixrect/cg8var.h", "PIPIO_G_FB_INFO", 0x40d05801},
- X{"sundev/kbio.h", "KIOCSLED", 0x80016b0e},
- X{"sundev/ppreg.h", "PPIOCSETC", 0x80017002},
- X{"sys/ttycom.h", "TIOCSTI", 0x80017472},
- X{"sun/tvio.h", "TVIOSBIND", 0x80025820},
- X{"sbusdev/bpp_io.h", "BPPIOC_SETOUTPINS", 0x80026203},
- X{"sun/isdnio.h", "ISDN_MESSAGE_SET", 0x8004410c},
- X{"sun/fbio.h", "FBIOSVIDEO", 0x80044607},
- X{"sun/fbio.h", "FBIOVERTICAL", 0x80044609},
- X{"sun/fbio.h", "GRABPAGEFREE", 0x8004460b},
- X{"sun/fbio.h", "GRABATTACH", 0x8004460c},
- X{"sun/fbio.h", "FBIOSCMSIZE", 0x8004460f},
- X{"sun/fbio.h", "FBIOSCMS", 0x80044610},
- X{"sun/fbio.h", "FBIOSCURPOS", 0x8004461a},
- X{"sun/fbio.h", "FBIOGCURPOS", 0x8004461b},
- X{"sun/fbio.h", "FBIO_U_RST", 0x80044623},
- X{"sun/gpio.h", "GP1IO_FREE_STATIC_BLOCK", 0x80044702},
- X{"sun/gpio.h", "GP1IO_CHK_GP", 0x80044704},
- X{"sun/gpio.h", "GP1IO_REDIRECT_DEVFB", 0x80044706},
- X{"sun/gpio.h", "GP1IO_SET_USING_GBUFFER", 0x8004470a},
- X{"sun/mem.h", "MM_CCRW", 0x80044d03},
- X{"sun/mem.h", "MM_PCNT0", 0x80044d04},
- X{"sun/mem.h", "MM_PCNT1", 0x80044d05},
- X{"sun/vddrv.h", "VDFREEVADDR", 0x80045604},
- X{"sun/tvio.h", "TVIOSFORMAT", 0x80045802},
- X{"sun/tvio.h", "TVIOSCOMPOUT", 0x80045804},
- X{"sun/tvio.h", "TVIOSSYNC", 0x80045806},
- X{"pixrect/cg8var.h", "PIPIO_S_PIP_ON_OFF", 0x80045807},
- X{"sun/tvio.h", "TVIOSOUT", 0x80045808},
- X{"sun/tvio.h", "TVIOSCOMPRESS", 0x8004580a},
- X{"sun/tvio.h", "TVIOSCHROMAGAIN", 0x8004580c},
- X{"sun/tvio.h", "TVIOSREDGAIN", 0x8004580e},
- X{"sun/tvio.h", "TVIOSREDBLACK", 0x80045810},
- X{"sun/tvio.h", "TVIOSGREENGAIN", 0x80045812},
- X{"sun/tvio.h", "TVIOSGREENBLACK", 0x80045814},
- X{"sun/tvio.h", "TVIOSBLUEGAIN", 0x80045816},
- X{"sun/tvio.h", "TVIOSBLUEBLACK", 0x80045818},
- X{"sun/tvio.h", "TVIOSLUMAGAIN", 0x8004581a},
- X{"sun/tvio.h", "TVIOSLIVE", 0x80045824},
- X{"sun/tvio.h", "TVIOSCHROMASEP", 0x80045828},
- X{"pixrect/cg8var.h", "PIPIO_S_CURSOR_COLOR_FREEZE", 0x80045829},
- X{"pixrect/cg8var.h", "PIPIO_S_MAP_SLOT", 0x8004582a},
- X{"sun/tvio.h", "TVIOSCHROMADEMOD", 0x8004582a},
- X{"pixrect/cg8var.h", "PIPIO_S_TEST", 0x8004582c},
- X{"sun/tvio.h", "TVIOSGENLOCK", 0x8004582c},
- X{"sun/tvio.h", "TVIOSIBADVANCE", 0x80045835},
- X{"sun/tvio.h", "TVIOSABSTATE", 0x80045838},
- X{"sun/tvio.h", "TVIOSCONTROL", 0x8004583c},
- X{"sundev/srreg.h", "CDROMPLAYTRKIND", 0x8004630d},
- X{"scsi/targets/srdef.h", "CDROMPLAYTRKIND", 0x8004630d},
- X{"sundev/srreg.h", "CDROMVOLCTRL", 0x8004630e},
- X{"sun/dkio.h", "DKIOCGBAD", 0x80046478},
- X{"sun/dkio.h", "DKIOCSBAD", 0x80046479},
- X{"sys/filio.h", "FIOSETOWN", 0x8004667c},
- X{"sys/filio.h", "FIOASYNC", 0x8004667d},
- X{"sys/filio.h", "FIONBIO", 0x8004667e},
- X{"sunwindow/win_ioctl.h", "WINSETMOUSE", 0x80046706},
- X{"sunwindow/win_ioctl.h", "WINSETUSERFLAGS", 0x8004670f},
- X{"sunwindow/win_ioctl.h", "WINSETOWNER", 0x80046711},
- X{"sunwindow/win_ioctl.h", "WINDONEDAMAGED", 0x80046721},
- X{"sunwindow/win_ioctl.h", "WINSETBUTTONORDER", 0x80046725},
- X{"sunwindow/win_ioctl.h", "WINSETNEXTINPUT", 0x80046738},
- X{"sunwindow/win_ioctl.h", "WINSETKBDFOCUS", 0x8004673d},
- X{"sunwindow/win_ioctl.h", "WINSETPLANEGROUP", 0x8004673f},
- X{"sunwindow/win_ioctl.h", "WINSETNOTIFYALL", 0x80046752},
- X{"sunwindow/win_ioctl.h", "WINSETRECQUE", 0x800467c8},
- X{"sunwindow/win_ioctl.h", "WINSETRECORD", 0x800467c9},
- X{"sunwindow/win_ioctl.h", "WINSETPLAYBACK", 0x800467cb},
- X{"sys/sockio.h", "SIOCSPROMISC", 0x80046930},
- X{"sundev/kbio.h", "KIOCTRANS", 0x80046b00},
- X{"sundev/kbio.h", "KIOCTRANSABLE", 0x80046b06},
- X{"sundev/kbio.h", "KIOCCMD", 0x80046b08},
- X{"sundev/kbio.h", "KIOCSDIRECT", 0x80046b0a},
- X{"sundev/kbio.h", "KIOCSCOMPAT", 0x80046b10},
- X{"sun/ndio.h", "NDIOCSAT", 0x80046e04},
- X{"sun/ndio.h", "NDIOCVER", 0x80046e07},
- X{"net/nit_if.h", "NIOCSFLAGS", 0x80047004},
- X{"net/nit_if.h", "NIOCSSNAP", 0x80047006},
- X{"net/nit_buf.h", "NIOCSCHUNK", 0x80047009},
- X{"sun/sqz.h", "SQZSET", 0x80047101},
- X{"sys/sockio.h", "SIOCSHIWAT", 0x80047300},
- X{"sys/sockio.h", "SIOCSLOWAT", 0x80047302},
- X{"sys/sockio.h", "SIOCSPGRP", 0x80047308},
- X{"sys/ttold.h", "TIOCSETD", 0x80047401},
- X{"sys/ttold.h", "TIOCMODS", 0x80047404},
- X{"sbusdev/gtreg.h", "FB_FCSFREE", 0x80047406},
- X{"sbusdev/gtreg.h", "FB_SETDIAGMODE", 0x80047408},
- X{"sbusdev/gtreg.h", "FB_SETWPART", 0x80047409},
- X{"sbusdev/gtreg.h", "FB_SETMONITOR", 0x8004740b},
- X{"sys/ttold.h", "TIOCFLUSH", 0x80047410},
- X{"sbusdev/gtreg.h", "FB_LOADKMCB", 0x80047411},
- X{"sbusdev/gtreg.h", "FB_SETCLUTPART", 0x80047417},
- X{"sbusdev/gtreg.h", "FB_LIGHTPENENABLE", 0x80047419},
- X{"sys/ttycom.h", "TIOCTCNTL", 0x80047420},
- X{"sys/ttycom.h", "TIOCSIGNAL", 0x80047421},
- X{"sys/ttold.h", "TIOCSETX", 0x80047422},
- X{"sys/ttycom.h", "TIOCSSOFTCAR", 0x80047465},
- X{"sys/ttycom.h", "TIOCUCNTL", 0x80047466},
- X{"sys/ttycom.h", "TIOCREMOTE", 0x80047469},
- X{"sys/ttycom.h", "TIOCMBIC", 0x8004746b},
- X{"sys/ttycom.h", "TIOCMBIS", 0x8004746c},
- X{"sys/ttycom.h", "TIOCMSET", 0x8004746d},
- X{"sys/ttycom.h", "TIOCPKT", 0x80047470},
- X{"sys/ttycom.h", "TIOCSPGRP", 0x80047476},
- X{"sys/ttold.h", "TIOCLSET", 0x8004747d},
- X{"sys/ttold.h", "TIOCLBIC", 0x8004747e},
- X{"sys/ttold.h", "TIOCLBIS", 0x8004747f},
- X{"sys/ttycom.h", "TIOCSETPGRP", 0x80047482},
- X{"sundev/vuid_event.h", "VUIDSFORMAT", 0x80047601},
- X{"sys/vcmd.h", "VSETSTATE", 0x80047601},
- X{"sundev/vuid_event.h", "VUIDSADDR", 0x80047603},
- X{"scsi/targets/srdef.h", "CDROMPLAYMSF", 0x8006630c},
- X{"sundev/srreg.h", "CDROMPLAYMSF", 0x8006630c},
- X{"sun/dkio.h", "DKIOCSTYPE", 0x8006647d},
- X{"sys/ttold.h", "TIOCSETP", 0x80067409},
- X{"sys/ttold.h", "TIOCSETN", 0x8006740a},
- X{"sys/ttold.h", "TIOCSETC", 0x80067411},
- X{"sys/ttold.h", "TIOCSLTC", 0x80067475},
- X{"sun/isdnio.h", "ISDN_SET_LOOPBACK", 0x8008410e},
- X{"sun/isdnio.h", "ISDN_RESET_LOOPBACK", 0x8008410f},
- X{"sundev/lightpenreg.h", "LIGHTPEN_CALIBRATE", 0x80084c01},
- X{"sun/tvio.h", "TVIOSPOS", 0x8008581c},
- X{"sun/dkio.h", "DKIOCSPART", 0x80086405},
- X{"sun/dkio.h", "FDKSETSEARCH", 0x8008646b},
- X{"sunwindow/win_ioctl.h", "WINSETLINK", 0x80086701},
- X{"sunwindow/win_ioctl.h", "WINSETRECT", 0x8008670b},
- X{"sunwindow/win_ioctl.h", "WINSETSAVEDRECT", 0x8008670c},
- X{"sunwindow/win_ioctl.h", "WINPARTIALREPAIR", 0x8008672b},
- X{"sunwindow/win_ioctl.h", "WINSETEVENTTIMEOUT", 0x8008673b},
- X{"sunwindow/win_ioctl.h", "WINDBLSET", 0x8008674b},
- X{"sunwindow/win_ioctl.h", "WINSETPLAYINTR", 0x800867cc},
- X{"sys/mtio.h", "MTIOCTOP", 0x80086d01},
- X{"net/nit_buf.h", "NIOCSTIME", 0x80087006},
- X{"sbusdev/gtreg.h", "FB_VMBACK", 0x80087415},
- X{"sbusdev/gtreg.h", "FB_VMUNBACK", 0x80087416},
- X{"sbusdev/gtreg.h", "FB_SETLIGHTPENPARAM", 0x8008741a},
- X{"sbusdev/gtreg.h", "FB_SETGAMMA", 0x8008741f},
- X{"sys/ttycom.h", "TIOCSSIZE", 0x80087425},
- X{"sys/ttold.h", "_O_TIOCSSIZE", 0x80087467},
- X{"sys/ttycom.h", "TIOCSWINSZ", 0x80087467},
- X{"sun/isdnio.h", "ISDN_SET_PARAM", 0x800c4110},
- X{"sun/fbio.h", "FBIO_WID_FREE", 0x800c461f},
- X{"sun/fbio.h", "FBIO_WID_PUT", 0x800c4620},
- X{"sun/fbio.h", "FBIO_WID_GET", 0x800c4621},
- X{"sundev/lightpenreg.h", "LIGHTPEN_FILTER", 0x800c4c02},
- X{"sundev/fdreg.h", "V_FORMAT", 0x800c5605},
- X{"sundev/srreg.h", "CDROMREADMODE2", 0x800c636e},
- X{"sundev/srreg.h", "CDROMREADMODE1", 0x800c636f},
- X{"sunwindow/win_ioctl.h", "WINSETCURSOR", 0x800c6707},
- X{"sunwindow/win_ioctl.h", "WINSETFOCUSEVENT", 0x800c6746},
- X{"sunwindow/win_ioctl.h", "WINSETSWALLOWEVENT", 0x800c6748},
- X{"sundev/msio.h", "MSIOSETPARMS", 0x800c6d03},
- X{"sbusdev/gtreg.h", "FB_CLUTFREE", 0x800c7402},
- X{"sbusdev/gtreg.h", "FB_VMCTL", 0x800c741e},
- X{"pixrect/cg8var.h", "PIPIO_S_EMULATION_MODE", 0x800e5804},
- X{"sunwindow/win_ioctl.h", "WINSCREENPOSITIONS", 0x8010672b},
- X{"sundev/kbio.h", "KIOCSETKEY", 0x80106b01},
- X{"sun/ndio.h", "NDIOCETHER", 0x80106e08},
- X{"sys/termio.h", "TCSETA", 0x80125402},
- X{"termio.h", "TCSETA", 0x80125402},
- X{"sys/termio.h", "TCSETAW", 0x80125403},
- X{"termio.h", "TCSETAW", 0x80125403},
- X{"sys/termio.h", "TCSETAF", 0x80125404},
- X{"termio.h", "TCSETAF", 0x80125404},
- X{"sun/fbio.h", "FBIOPUTCMAP", 0x80144603},
- X{"sun/fbio.h", "FBIOGETCMAP", 0x80144604},
- X{"sunwindow/win_ioctl.h", "WINSETAVAILPLANEGROUPS", 0x80146741},
- X{"sunwindow/win_ioctl.h", "WINSETSYNCPT", 0x801467cd},
- X{"sundev/kbio.h", "KIOCSKEY", 0x80146b0c},
- X{"sun/fbio.h", "FBIODBLSINFO", 0x80184613},
- X{"sun/gpio.h", "GP1IO_PUT_INFO", 0x80184700},
- X{"sun/dkio.h", "DKIOCSCMD", 0x80186477},
- X{"sunwindow/win_ioctl.h", "WINSETINPUTDEV", 0x80186732},
- X{"sun/ndio.h", "NDIOCUSER", 0x80186e03},
- X{"sun/fbio.h", "FBIOPUTCMAPI", 0x801c4629},
- X{"sun/fbio.h", "FBIOGETCMAPI", 0x801c462a},
- X{"sun/dkio.h", "FDKIOSCHAR", 0x801c6471},
- X{"sbusdev/gtreg.h", "FB_CLUTPOST", 0x801c7404},
- X{"sbusdev/bpp_io.h", "BPPIOC_SETPARMS", 0x80206201},
- X{"sys/sockio.h", "SIOCSIFADDR", 0x8020690c},
- X{"sys/sockio.h", "SIOCSIFDSTADDR", 0x8020690e},
- X{"sys/sockio.h", "SIOCSIFFLAGS", 0x80206910},
- X{"sys/sockio.h", "SIOCSIFMEM", 0x80206912},
- X{"sys/sockio.h", "SIOCSIFMTU", 0x80206915},
- X{"sys/sockio.h", "SIOCSIFBRDADDR", 0x80206918},
- X{"sys/sockio.h", "SIOCSIFNETMASK", 0x8020691a},
- X{"sys/sockio.h", "SIOCSIFMETRIC", 0x8020691c},
- X{"sys/sockio.h", "SIOCUPPER", 0x80206928},
- X{"sys/sockio.h", "SIOCLOWER", 0x80206929},
- X{"sys/sockio.h", "SIOCSETSYNC", 0x8020692c},
- X{"sys/sockio.h", "SIOCADDMULTI", 0x80206931},
- X{"sys/sockio.h", "SIOCDELMULTI", 0x80206932},
- X{"sys/sockio.h", "SIOCFDRESET", 0x80206933},
- X{"sys/sockio.h", "SIOCFDSLEEP", 0x80206934},
- X{"sys/sockio.h", "SIOCLDNSTRTFW", 0x80206936},
- X{"sys/sockio.h", "SIOCGETFDSTAT", 0x80206937},
- X{"sys/sockio.h", "SIOCFDNMIINT", 0x80206938},
- X{"sys/sockio.h", "SIOCFDEXUSER", 0x80206939},
- X{"sys/sockio.h", "SIOCFDGNETMAP", 0x8020693a},
- X{"sys/sockio.h", "SIOCFDGIOCTL", 0x8020693b},
- X{"net/nit_if.h", "NIOCBIND", 0x80207003},
- X{"sbusdev/gtreg.h", "FB_GT_SETVERSION", 0x80207428},
- X{"sys/stropts.h", "I_FDINSERT", 0x80245310},
- X{"stropts.h", "I_FDINSERT", 0x80245310},
- X{"termios.h", "TCSETS", 0x80245409},
- X{"sys/termios.h", "TCSETS", 0x80245409},
- X{"termios.h", "TCSETSW", 0x8024540a},
- X{"sys/termios.h", "TCSETSW", 0x8024540a},
- X{"termios.h", "TCSETSF", 0x8024540b},
- X{"sys/termios.h", "TCSETSF", 0x8024540b},
- X{"sys/sockio.h", "SIOCSARP", 0x8024691e},
- X{"sys/sockio.h", "SIOCDARP", 0x80246920},
- X{"sys/sockio.h", "SIOCSNIT", 0x80247000},
- X{"sun/dkio.h", "DKIOCSGEOM", 0x80266403},
- X{"sun/fbio.h", "FBIOSATTR", 0x80284605},
- X{"sun/fbio.h", "FBIOSCURSOR", 0x802c4618},
- X{"sunwindow/win_ioctl.h", "WINSETLOCATOR", 0x80306730},
- X{"sunwindow/win_ioctl.h", "WINSETCPCURSOR", 0x80306796},
- X{"sbusdev/audio_79C30.h", "AUDIOSETREG", 0x80306902},
- X{"sys/sockio.h", "SIOCADDRT", 0x8030720a},
- X{"sys/sockio.h", "SIOCDELRT", 0x8030720b},
- X{"sunwindow/win_ioctl.h", "WINSETKBDMASK", 0x80346736},
- X{"sunwindow/win_ioctl.h", "WINSETPICKMASK", 0x80346737},
- X{"sun/dkio.h", "FDKSETDRIVECHAR", 0x8038646d},
- X{"sun/tvio.h", "TVIOSVIDEOCAL", 0x80405832},
- X{"sun/tvio.h", "TVIONVWRITE", 0x80405834},
- X{"sun/dkio.h", "DKIOCSAPART", 0x8040647b},
- X{"sunwindow/win_ioctl.h", "WINSETSCALING", 0x80406727},
- X{"net/nit_pf.h", "NIOCSETF", 0x80527002},
- X{"pixrect/gp1var.h", "GP1IO_SATTR", 0x80584765},
- X{"sunwindow/win_ioctl.h", "WINSETINPUTMASK", 0x806c6714},
- X{"sunwindow/win_ioctl.h", "WINSCREENNEW", 0x80706728},
- X{"sunwindow/win_ioctl.h", "WINSETKBD", 0x8070672e},
- X{"sunwindow/win_ioctl.h", "WINSETMS", 0x8070672f},
- END_OF_FILE
- if test 22969 -ne `wc -c <'strace-3.0/sunos4/ioctlent.h'`; then
- echo shar: \"'strace-3.0/sunos4/ioctlent.h'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/sunos4/ioctlent.h'
- fi
- if test -f 'strace-3.0/syscallent.sh' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'strace-3.0/syscallent.sh'\"
- else
- echo shar: Extracting \"'strace-3.0/syscallent.sh'\" \(2733 characters\)
- sed "s/^X//" >'strace-3.0/syscallent.sh' <<'END_OF_FILE'
- X#!/bin/sh
- 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# syscallent.sh,v 2.18 1994/03/12 23:11:59 jrs Exp
- X
- Xcat $* |
- X sed -n 's/^#[ ]*define[ ][ ]*SYS_\([^ ]*\)[ ]*\([0-9]*\)/\1 \2/p' |
- X sort +1n |
- X awk '
- X BEGIN {
- X tabs = "\t\t\t\t\t\t\t\t"
- X call = -1;
- X }
- X {
- X while (++call < $2) {
- X f = "printargs"
- X n = "SYS_" call
- X s = "\t{ -1,\t"
- X s = s f ","
- X s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
- X s = s "\"" n "\""
- X s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
- X s = s "},\t/* " call " */"
- X print s
- X }
- X f = "sys_" $1
- X n = $1
- X s = "\t{ -1,\t"
- X s = s f ","
- X s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
- X s = s "\"" n "\""
- X s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
- X s = s "},\t/* " call " */"
- X print s
- X }
- X END {
- X limit = call + 100
- X while (++call < limit) {
- X f = "printargs"
- X n = "SYS_" call
- X s = "\t{ -1,\t"
- X s = s f ","
- X s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8))
- X s = s "\"" n "\""
- X s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8))
- X s = s "},\t/* " call " */"
- X print s
- X }
- X }
- X '
- END_OF_FILE
- if test 2733 -ne `wc -c <'strace-3.0/syscallent.sh'`; then
- echo shar: \"'strace-3.0/syscallent.sh'\" unpacked with wrong size!
- fi
- # end of 'strace-3.0/syscallent.sh'
- fi
- echo shar: End of archive 2 \(of 10\).
- cp /dev/null ark2isdone
- 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...
-