diff options
author | Paul Moore <pmoore@redhat.com> | 2013-01-24 15:37:25 -0500 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2013-01-24 16:35:04 -0500 |
commit | bb3cc144d5ef50788094828ceedebf3b8a073c27 (patch) | |
tree | 26f53d78d346e3580bf101ea46e8f5f013dc0aa7 | |
parent | 6c8fdd0eef7b59d81e3cdee376831b4c9cdb0134 (diff) | |
download | libseccomp-bb3cc144d5ef50788094828ceedebf3b8a073c27.tar.gz |
tools: remove the old syscall resolver script
The new syscall resolver program which leverages the internal syscall
tables is much better suited to our mult-arch capabilities so were
just going to drop this script.
Signed-off-by: Paul Moore <pmoore@redhat.com>
-rwxr-xr-x | tools/sys_resolver.sh | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/tools/sys_resolver.sh b/tools/sys_resolver.sh deleted file mode 100755 index e0657c2..0000000 --- a/tools/sys_resolver.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -# -# Syscall resolver -# -# Copyright (c) 2012 Red Hat <pmoore@redhat.com> -# Author: Paul Moore <pmoore@redhat.com> -# - -# -# This library is free software; you can redistribute it and/or modify it -# under the terms of version 2.1 of the GNU Lesser General Public License as -# published by the Free Software Foundation. -# -# This 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 this library; if not, see <http://www.gnu.org/licenses>. -# - -syscall_h="/usr/include/asm/unistd.h" - -#### -# functions - -function verify_deps() { - [[ -z "$1" ]] && return - if ! which "$1" >& /dev/null; then - echo "error: install \"$1\" and include it in your \$PATH" - exit 1 - fi -} - -#### -# main - -# verify script dependencies -verify_deps gcc -verify_deps grep -verify_deps awk -verify_deps sed - -# verify the command line -if [[ "$#" -ne 1 || -z "$1" ]]; then - echo "usage: $0 <syscall_name>" - exit 1 -fi - -# inspect the syscall header file and do the resolution -sys_def="$(gcc $CFLAGS -E -dM "$syscall_h" | grep " __NR_$1 ")" -if [[ -n "$sys_def" ]]; then - if [[ $sys_def =~ .*__NR_[a-zA-Z_]+" "*\+" "*[0-9]+ ]]; then - # the value is calculated using an offset from another syscall - base="$(echo $sys_def | - sed -e 's/\(.*\)__NR_\([a-zA-Z_]\+\)\(.*\)/\2/;')" - offset="$(echo $sys_def | - sed -e 's/\(.*+ *\)\([0-9]*\)\(.*\)/\2/;')" - echo $(($($0 $base) + $offset)) - else - echo "$sys_def" | awk '{ print $3 }' - fi -else - echo "error: unknown syscall \"$1\"" - exit 1 -fi - -exit 0 |