Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/systrace aenable linux systrace only on platforms that s...



details:   https://anonhg.NetBSD.org/src/rev/c24cfbb61b01
branches:  trunk
changeset: 534663:c24cfbb61b01
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Aug 01 08:47:03 2002 +0000

description:
aenable linux systrace only on platforms that support it.
noted by hannken%eis.cs.tu-bs.de@localhost

diffstat:

 bin/systrace/register.c           |   4 +++-
 bin/systrace/systrace-translate.c |  12 +++++++-----
 bin/systrace/systrace.h           |   6 +++++-
 3 files changed, 15 insertions(+), 7 deletions(-)

diffs (76 lines):

diff -r ad42b10ed399 -r c24cfbb61b01 bin/systrace/register.c
--- a/bin/systrace/register.c   Thu Aug 01 08:41:32 2002 +0000
+++ b/bin/systrace/register.c   Thu Aug 01 08:47:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: register.c,v 1.1 2002/07/30 16:29:31 itojun Exp $      */
+/*     $NetBSD: register.c,v 1.2 2002/08/01 08:47:03 itojun Exp $      */
 /*     $OpenBSD: register.c,v 1.8 2002/07/30 06:07:06 itojun Exp $     */
 /*
  * Copyright 2002 Niels Provos <provos%citi.umich.edu@localhost>
@@ -248,6 +248,7 @@
        intercept_register_translation("native", "setegid", 0, &gidt);
 #endif
 
+#if !(defined(__NetBSD__) && !defined(HAVE_LINUX_FCNTL_H))
        X(intercept_register_sccb("linux", "open", trans_cb, NULL));
        tl = intercept_register_translink("linux", "open", 0);
        intercept_register_translation("linux", "open", 1, &linux_oflags);
@@ -296,6 +297,7 @@
        X(intercept_register_sccb("linux", "chmod", trans_cb, NULL));
        intercept_register_translink("linux", "chmod", 0);
        intercept_register_translation("linux", "chmod", 1, &modeflags);
+#endif
 
        X(intercept_register_execcb(execres_cb, NULL));
 }
diff -r ad42b10ed399 -r c24cfbb61b01 bin/systrace/systrace-translate.c
--- a/bin/systrace/systrace-translate.c Thu Aug 01 08:41:32 2002 +0000
+++ b/bin/systrace/systrace-translate.c Thu Aug 01 08:47:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: systrace-translate.c,v 1.3 2002/07/30 16:29:31 itojun Exp $    */
+/*     $NetBSD: systrace-translate.c,v 1.4 2002/08/01 08:47:04 itojun Exp $    */
 /*     $OpenBSD: systrace-translate.c,v 1.9 2002/07/30 06:07:06 itojun Exp $   */
 /*
  * Copyright 2002 Niels Provos <provos%citi.umich.edu@localhost>
@@ -43,10 +43,7 @@
 #include <pwd.h>
 #include <err.h>
 
-#ifdef __NetBSD__
-#include "../../sys/compat/linux/common/linux_types.h"
-#include "../../sys/compat/linux/common/linux_fcntl.h"
-#else
+#ifdef __OpenBSD__
 #include "../../sys/compat/linux/linux_types.h"
 #include "../../sys/compat/linux/linux_fcntl.h"
 #endif
@@ -54,6 +51,11 @@
 #include "intercept.h"
 #include "systrace.h"
 
+#if defined(__NetBSD__) && defined(HAVE_LINUX_FCNTL_H)
+#include "../../sys/compat/linux/common/linux_types.h"
+#include "../../sys/compat/linux/common/linux_fcntl.h"
+#endif
+
 #define FL(w,c)        do { \
        if (flags & (w)) \
                *p++ = (c); \
diff -r ad42b10ed399 -r c24cfbb61b01 bin/systrace/systrace.h
--- a/bin/systrace/systrace.h   Thu Aug 01 08:41:32 2002 +0000
+++ b/bin/systrace/systrace.h   Thu Aug 01 08:47:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: systrace.h,v 1.2 2002/07/30 16:29:31 itojun Exp $      */
+/*     $NetBSD: systrace.h,v 1.3 2002/08/01 08:47:04 itojun Exp $      */
 /*     $OpenBSD: systrace.h,v 1.12 2002/07/30 06:07:06 itojun Exp $    */
 /*
  * Copyright 2002 Niels Provos <provos%citi.umich.edu@localhost>
@@ -187,4 +187,8 @@
 
 extern struct intercept_translate linux_oflags;
 
+#if defined(__i386__) || defined(__m68k__) || defined(__alpha__) || defined(__powerpc__) || defined(__mips__) || defined(__arm__)
+#define HAVE_LINUX_FCNTL_H
+#endif
+
 #endif /* _SYSTRACE_H_ */



Home | Main Index | Thread Index | Old Index