]> granicus.if.org Git - strace/commitdiff
Fix stat structures for Linux once again
authorWichert Akkerman <wichert@deephackmode.org>
Sun, 18 Apr 1999 19:35:42 +0000 (19:35 +0000)
committerWichert Akkerman <wichert@deephackmode.org>
Sun, 18 Apr 1999 19:35:42 +0000 (19:35 +0000)
ChangeLog
file.c

index 76069ad06c41ce5a92861139e78ee4c620a9e2ae..5468bcd1dad1ab0700621ddf7c164d330df31168 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 Fri Apr 16 02:18:05 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
 
-  * Add support for old_*stat functions for Linux. Note to self:
-    check osf_*stat functions for Linux alpha.
+  * Add support for old_*stat functions for Linux. Please note you need
+    to use reasonably recent kernel headers to compile strace now.
   * Change references to LINUX into linux in file.c
   * Fix include for LDT in mem.c
 
diff --git a/file.c b/file.c
index 14f6beb26f5fcfe4f2b74d279f4b222c411664ef..458cb1af14ef4a72d1fc442a7637bc2dfeb27941 100644 (file)
--- a/file.c
+++ b/file.c
 
 #include <dirent.h>
 
-#include <sys/stat.h>
 #ifdef linux
+#define stat libc_stat
+#include <statbuf.h>
+#undef stat
 #include <asm/stat.h>
 #endif
+#include <sys/stat.h>
 #include <fcntl.h>
 
 #ifdef SVR4
@@ -459,11 +462,7 @@ int addr;
 static void
 realprintstat(tcp, statbuf)
 struct tcb *tcp;
-#ifdef linux
-struct new_stat *statbuf;
-#else
 struct stat *statbuf;
-#endif
 {
     if (!abbrev(tcp)) {
            tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
@@ -515,11 +514,7 @@ printstat(tcp, addr)
 struct tcb *tcp;
 int addr;
 {
-#ifdef linux
-       struct new_stat statbuf;
-#else
        struct stat statbuf;
-#endif
 
 #ifdef LINUXSPARC
        if (current_personality == 1) {
@@ -547,8 +542,8 @@ int addr;
 #ifdef linux
 static void
 convertoldstat(oldbuf, newbuf)
-const struct old_stat *oldbuf;
-struct new_stat *newbuf;
+const struct __old_kernel_stat *oldbuf;
+struct stat *newbuf;
 {
     newbuf->st_dev=oldbuf->st_dev;
     newbuf->st_ino=oldbuf->st_ino;
@@ -573,8 +568,8 @@ printoldstat(tcp, addr)
 struct tcb *tcp;
 int addr;
 {
-       struct old_stat statbuf;
-       struct new_stat newstatbuf;
+       struct __old_kernel_stat statbuf;
+       struct stat newstatbuf;
 
 #ifdef LINUXSPARC
        if (current_personality == 1) {