From df5afa4fcd9725380f94ca6476248d4cc24f889a Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Sun, 29 Nov 2015 08:22:13 -0800 Subject: v2.4.4 audit sources Change-Id: I9315a7408817db51edf084fb4d27fbb492785084 Signed-off-by: Ashlee Young --- framework/src/audit/tools/ausyscall/ausyscall.c | 155 ++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 framework/src/audit/tools/ausyscall/ausyscall.c (limited to 'framework/src/audit/tools/ausyscall/ausyscall.c') diff --git a/framework/src/audit/tools/ausyscall/ausyscall.c b/framework/src/audit/tools/ausyscall/ausyscall.c new file mode 100644 index 00000000..361afd99 --- /dev/null +++ b/framework/src/audit/tools/ausyscall/ausyscall.c @@ -0,0 +1,155 @@ +/* + * ausysvcall.c - A program that lets you map syscall names and numbers + * Copyright (c) 2008 Red Hat Inc., Durham, North Carolina. + * All Rights Reserved. + * + * This software may be freely redistributed and/or modified under the + * terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to the + * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Authors: + * Steve Grubb + */ + +#include +#include +#include +#include +#include "libaudit.h" + +#define LAST_SYSCALL 1400 // IA64 is in the 1300's right now + +void usage(void) +{ + fprintf(stderr, "usage: ausyscall [arch] name | number | --dump | --exact\n"); + exit(1); +} + +int main(int argc, char *argv[]) +{ + int i, rc; + int machine=-1, syscall_num=-1, dump=0, exact=0; + const char *name = NULL; + + if (argc > 4) { + fputs("Too many arguments\n", stderr); + usage(); + } else if (argc < 2) + usage(); + + for (i=1; i