2 # syscall reporting example for seccomp
4 # Copyright (c) 2012 The Chromium OS Authors <chromium-os-dev@chromium.org>
6 # Kees Cook <keescook@chromium.org>
8 # Use of this source code is governed by a BSD-style license that can be
9 # found in the LICENSE file.
12 [ -n "$TARGET_CC_NOCACHE" ] && CC
=$TARGET_CC_NOCACHE
14 echo "#include <asm/unistd.h>"
15 echo "static const char *syscall_names[] = {"
16 echo "#include <sys/syscall.h>" |
${CC} -E -dM - |
grep '^#define __NR_' | \
17 LC_ALL
=C
sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([ ()+0-9a-zNR_Linux]+)(.*)/ [\2] = "\1",/p'