aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/linux-gnu/mksyscallent
diff options
context:
space:
mode:
authorJuan Cespedes <cespedes@debian.org>1999-08-30 19:34:50 +0200
committerJuan Cespedes <cespedes@debian.org>1999-08-30 19:34:50 +0200
commit1b9cfd6ad305ad909e8ff17139111a7c78f01464 (patch)
tree352a033cfd2ab78eab367c81f30b46ec5b886947 /sysdeps/linux-gnu/mksyscallent
parente3eb9aa37086f16c0c8c2778dcd8020a39a92564 (diff)
downloadltrace-1b9cfd6ad305ad909e8ff17139111a7c78f01464.tar.gz
Version: 0.3.8
* glibc-2.1 does no longer need `_GNU_SOURCE' defined to use <getopt.h> * Changed description of package; adopted Red Hat's one (thanks to whoever wrote it) * Close all the file descriptors used before executing program (close-on-exec) * Updated copyright file for new location /usr/share/common-licenses/GPL. * Used GNU autoconf instead of "uname" to guess host system type * Install man page in /usr/share/man instead of /usr/man * Added a few functions to /etc/ltrace.conf * Updated list of syscalls and signals to linux-2.2.12 * Fixed bugs in C++ demangle (Morten Eriksen <mortene@sim.no>) * New Standards-Version: 3.0.1 (but keeping docs in /usr/doc)
Diffstat (limited to 'sysdeps/linux-gnu/mksyscallent')
-rwxr-xr-xsysdeps/linux-gnu/mksyscallent43
1 files changed, 43 insertions, 0 deletions
diff --git a/sysdeps/linux-gnu/mksyscallent b/sysdeps/linux-gnu/mksyscallent
new file mode 100755
index 0000000..59ba474
--- /dev/null
+++ b/sysdeps/linux-gnu/mksyscallent
@@ -0,0 +1,43 @@
+#!/usr/bin/awk -f
+
+# hack expression to generate arch/syscallent.h from <asm/unistd.h>
+# It reads from stdin and writes to stdout
+# Currently (linux-2.2.3), it works OK on i386,m68k
+# It does NOT work in arm,mips
+# It is untested in other architectures
+
+BEGIN {
+ max=0;
+ FS="[ \t\n()\+]+";
+}
+
+{
+# printf("/%s/%s/%s/%s/\n", $1, $2, $3, $4);
+ if (($1 ~ /^#define$/) && ($2 ~ /^__NR_/)) {
+ if (($3>=0) && ($3<=1000)) {
+ SYSCALL[$3]=substr($2,6);
+ if ($3 > max) {
+ max=$3;
+ }
+ } else if (($3 ~ /^__NR_SYSCALL_BASE$/) && ($4>=0) && ($4<=1000)) {
+ SYSCALL[$4]=substr($2,6);
+ if ($4 > max) {
+ max=$4;
+ }
+ }
+ }
+}
+
+END {
+ for(i=0; i<=max; i++) {
+ if (!SYSCALL[i]) {
+ SYSCALL[i] = i;
+ }
+ pad = 32 - length(SYSCALL[i]);
+ if (pad<1) {
+ pad=1;
+ }
+ printf("\t\"%s\",%*s/* %d */\n", SYSCALL[i], pad, "", i);
+ }
+}
+