2 # This file is part of ltrace.
3 # Copyright (C) 2006 Ian Wienand
4 # Copyright (C) 1999 Juan Cespedes
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; either version 2 of the
9 # License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 # hack expression to generate arch/syscallent.h from <asm/unistd.h>
22 # It reads from stdin and writes to stdout
23 # It should work OK on i386,m68k,arm,ia64
24 # It does NOT work in mips, s390
25 # It is untested in other architectures
34 #printf("/%s/%s/%s/%s/\n", $1, $2, $3, $4);
35 if (($1 ~ /^#define$/) && ($2 ~ /^__NR_/)) {
36 #ia64 syscalls are > 1000 (lower for x86 compat)
37 if (($3>=0) && ($3<=2000)) {
38 SYSCALL[$3]=substr($2,6);
42 } else if (($3 ~ /^__NR_SYSCALL_BASE$/) && ($4>=0) && ($4<=1000)) {
43 SYSCALL[$4]=substr($2,6);
52 for(i=0; i<=max; i++) {
56 pad = 32 - length(SYSCALL[i]);
60 printf("\t\"%s\",%*s/* %d */\n", SYSCALL[i], pad, "", i);