#! @BASH@ # Copyright (C) 2011-2016 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # The GNU C Library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with the GNU C Library; if not, see # . # We should be able to find the translation right at the beginning. setglobal TEXTDOMAIN = 'libc' setglobal TEXTDOMAINDIR = '@TEXTDOMAINDIR@' unset SOTRUSS_FROMLIST unset SOTRUSS_TOLIST unset SOTRUSS_OUTNAME unset SOTRUSS_EXIT unset SOTRUSS_NOINDENT setglobal SOTRUSS_WHICH = $Pid setglobal lib = ''@PREFIX@/$LIB/audit/sotruss-lib.so'' proc do_help { echo $"Usage: sotruss [OPTION...] [--] EXECUTABLE [EXECUTABLE-OPTION...] -F, --from FROMLIST Trace calls from objects on FROMLIST -T, --to TOLIST Trace calls to objects on TOLIST -e, --exit Also show exits from the function calls -f, --follow Trace child processes -o, --output FILENAME Write output to FILENAME (or FILENAME.$PID in case -f is also used) instead of standard error -?, --help Give this help list --usage Give a short usage message --version Print program version" echo printf $"Mandatory arguments to long options are also mandatory for any corresponding\nshort options.\n" echo printf $"For bug reporting instructions, please see:\\n%s.\\n" \ "@REPORT_BUGS_TO@" exit 0 } proc do_missing_arg { printf >&2 $"%s: option requires an argument -- '%s'\n" sotruss $1> !2 $"%s: option requires an argument -- '%s'\n" sotruss "$1" printf >&2 $"Try \`%s --help' or \`%s --usage' for more information.\n" sotruss sotruss> !2 $"Try \`%s --help' or \`%s --usage' for more information.\n" sotruss sotruss exit 1 } proc do_ambiguous { printf >&2 $"%s: option is ambiguous; possibilities:> !2 $"%s: option is ambiguous; possibilities:" while test $Argc -gt 0 { printf >&2 " '%s'" $1> !2 " '%s'" $1 shift } printf >&2 "\n> !2 "\n" printf >&2 $"Try \`%s --help' or \`%s --usage' for more information.\n" sotruss sotruss> !2 $"Try \`%s --help' or \`%s --usage' for more information.\n" sotruss sotruss exit 1 } while test $Argc -gt 0 { match $1 { with --v | --ve | --ver | --vers | --versi | --versio | --version echo "sotruss @PKGVERSION@@VERSION@" printf $"Copyright (C) %s Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. " "2016" printf $"Written by %s.\n" "Ulrich Drepper" exit 0 with -\? | --h | --he | --hel | --help do_help with --u | --us | --usa | --usag | --usage printf $"Usage: %s [-ef] [-F FROMLIST] [-o FILENAME] [-T TOLIST] [--exit] [--follow] [--from FROMLIST] [--output FILENAME] [--to TOLIST] [--help] [--usage] [--version] [--] EXECUTABLE [EXECUTABLE-OPTION...]\n" sotruss exit 0 with -F | --fr | --fro | --from if test $Argc -eq 1 { do_missing_arg $1 } shift setglobal SOTRUSS_FROMLIST = $1 with -T | --t | --to if test $Argc -eq 1 { do_missing_arg $1 } shift setglobal SOTRUSS_TOLIST = $1 with -o | --o | --ou | --out | --outp | --outpu | --output if test $Argc -eq 1 { do_missing_arg $1 } shift setglobal SOTRUSS_OUTNAME = $1 with -f | --fo | --fol | --foll | --follo | --follow unset SOTRUSS_WHICH with -l | --l | --li | --lib if test $Argc -eq 1 { do_missing_arg $1 } shift setglobal lib = $1 with -e | --e | --ex | --exi | --exit setglobal SOTRUSS_EXIT = '1' with --f do_ambiguous '--from' '--follow' with -- shift break with -* printf >&2 $"%s: unrecognized option '%c%s'\n" sotruss '-' $(1#-)> !2 $"%s: unrecognized option '%c%s'\n" sotruss '-' ${1#-} printf >&2 $"Try \`%s --help' or \`%s --usage' for more information.\n" sotruss sotruss> !2 $"Try \`%s --help' or \`%s --usage' for more information.\n" sotruss sotruss exit 1 with * break } shift } export SOTRUSS_FROMLIST export SOTRUSS_TOLIST export SOTRUSS_OUTNAME export SOTRUSS_WHICH export SOTRUSS_EXIT export LD_AUDIT="$lib" exec @Argv