Ticket #72 (new defect)

Opened 22 months ago

Last modified 22 months ago

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)

Attachments

patch.intercept Download (1.0 KB) - added by joseyluis 22 months ago.

Change History

Changed 22 months ago by joseyluis

comment:1 Changed 22 months ago by joseyluis

I have attached the patch as a file. Trac seems to have joined a lot of lines of the patch when you paste the patch in the case

Note: See TracTickets for help on using tickets.