Ticket #72 (new defect)
Patch intercept.h and intercept.c for NetBSD 4 and 5
| Reported by: | joseyluis | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | test suite | Version: | trunk |
| Keywords: | Cc: |
Description
With this test the test suite works with NetBSD 4 and 5 probably, I have tested it with NetBSD 4. Previously raidfile and bbackupd test didn't work.
The problem is that in NetBSD 4/5 the readdir and openddir functions in libc library are called: readdir30 and opendir30. readdir and closedir exist for compatibility with these functions in NetBSD 3 and previous versions.
There was a change in the ABI between the 3 and 4 version for use 64 bits inodes in kernel instead of 32 bits.
--- 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)

