From: Wichert Akkerman Date: Sun, 18 Apr 1999 19:35:42 +0000 (+0000) Subject: Fix stat structures for Linux once again X-Git-Tag: v4.5.18~1217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25d0c4fdf25b7a2c1132b46a5753e3308a50a3a2;p=strace Fix stat structures for Linux once again --- diff --git a/ChangeLog b/ChangeLog index 76069ad0..5468bcd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ Fri Apr 16 02:18:05 CEST 1999 Wichert Akkerman - * 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 14f6beb2..458cb1af 100644 --- a/file.c +++ b/file.c @@ -33,10 +33,13 @@ #include -#include #ifdef linux +#define stat libc_stat +#include +#undef stat #include #endif +#include #include #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) {