[Box Backup] Patch for raidfile test on NetBSD 4/5

Jose Luis Rodriguez Garcia joseyluis at gmail.com
Tue Apr 6 03:36:21 BST 2010


1- I have created a patch for raidfile test. I copy the patch at the
end of the email.

If I must create a trac ticket, please create a account trac. Login: joseyluis

With this patch NetBSD pass the raidfile test. I have tested it on NetBSD 4.

The problem is that in NetBSD 4/5 the readdir and openddir functions
are called in libc: __readdir30 and __closedir30.
readdir and closedir exist for compatibility with NetBSD 3 and before.

There was a change in the ABI between the 3 and 4 version for enable
64 bits types.

2- What is the purpose of intercept these function calls in the
intercept.cpp file?


--- intercept.h.orig    2010-04-04 01:58:54.000000000 +0200
+++ intercept.h 2010-04-04 02:00:33.000000000 +0200
@@ -13,6 +13,18 @@

 #include <dirent.h>

+#ifdef __NetBSD__  //__NetBSD_Version__ is defined in sys/param.h
+#include <sys/param.h>
+#endif
+
+#if defined __NetBSD_Version__ && __NetBSD_Version__ >= 399000800
//3.99.8 vers.
+#define FUNC_OPENDIR "__opendir30"
+#define FUNC_READDIR "__readdir30"
+#else
+#define FUNC_OPENDIR "opendir"
+#define FUNC_READDIR "readdir"
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>

--- intercept.cpp.orig  2010-04-04 01:58:54.000000000 +0200
+++ intercept.cpp       2010-04-04 02:00:34.000000000 +0200
@@ -514,7 +514,7 @@
 {
        if (opendir_real == NULL)
        {
-               opendir_real = (opendir_t*)find_function("opendir");
+               opendir_real = (opendir_t*)find_function(FUNC_OPENDIR);
        }

        if (opendir_real == NULL)
@@ -547,7 +547,7 @@

        if (readdir_real == NULL)
        {
-               readdir_real = (readdir_t*)find_function("readdir");
+               readdir_real = (readdir_t*)find_function(FUNC_READDIR);
        }

        if (readdir_real == NULL)



More information about the Boxbackup mailing list