Hi,

thanks for looking at this bug.

Alle martedì 31 gennaio 2012, KURASHIKI Satoru ha scritto:
> At Sun, 13 Nov 2011 21:56:41 +0100,
> Pino Toscano wrote:
> > The problem is due to the fact that the msync() POSIX function is
> > not implemented on Hurd yet, thus returns -1 and sets ENOSYS as
> > errno. On the other hand, even without it qdbm seems to work fine
> > on Hurd, and the various tests succeed with the attached patch
> > (which ignores msync() failures when errno is ENOSYS).
> 
> I'm unsure about other architectures/kernels which doesn't comply
> POSIX specification for msync().
> Anyway, I will apply this because on GNU/Linux and kFreeBSD qdbm
> seems to be built successfully (tested on amd64).

Unfortunately gnumach (the current microkernel of Hurd) does not 
implement a vm_msync() RPC, so the msync() glibc function basically gets 
an ENOSYS as result of the failing RPC call. Theorically it's something 
that should be implemented, but it isn't the only thing that needs such 
in Hurd, unfortunately...
Anyway, I'm attaching now a slightly different version of the patch (why 
didn't I think about it earlier...) which instead makes the errno check 
conditional on GNU/HUrd only, so there should be no behaviour change for 
any other OS. (Successfully tested on linux-amd64 and hurd-i386.)

> > I'm not sure whether the patch could be suitable for upstream
> > though, although it can work for the Debian packaging (and it
> > won't need any change when msync() is implemented).
> 
> Upstream development has been dead for long time, and at least
> this modification fix issues only for debian (hurd distributor).
> So, I will treat this as debian specific patch.

Thanks!

-- 
Pino Toscano
--- a/depot.c
+++ b/depot.c
@@ -19,6 +19,8 @@
 #include "depot.h"
 #include "myconf.h"
 
+#include <errno.h>
+
 #define DP_FILEMODE    00644             /* permission of a creating file */
 #define DP_MAGICNUMB   "[DEPOT]\n\f"     /* magic number on environments of big endian */
 #define DP_MAGICNUML   "[depot]\n\f"     /* magic number on environments of little endian */
@@ -761,7 +763,11 @@ int dpsync(DEPOT *depot){
   }
   *((int *)(depot->map + DP_FSIZOFF)) = depot->fsiz;
   *((int *)(depot->map + DP_RNUMOFF)) = depot->rnum;
-  if(msync(depot->map, depot->msiz, MS_SYNC) == -1){
+  if(msync(depot->map, depot->msiz, MS_SYNC) == -1
+#ifdef __GNU__
+     && errno != ENOSYS
+#endif
+    ){
     dpecodeset(DP_EMAP, __FILE__, __LINE__);
     depot->fatal = TRUE;
     return FALSE;
@@ -1473,7 +1479,11 @@ int dpmemsync(DEPOT *depot){
   }
   *((int *)(depot->map + DP_FSIZOFF)) = depot->fsiz;
   *((int *)(depot->map + DP_RNUMOFF)) = depot->rnum;
-  if(msync(depot->map, depot->msiz, MS_SYNC) == -1){
+  if(msync(depot->map, depot->msiz, MS_SYNC) == -1 
+#ifdef __GNU__
+     && errno != ENOSYS
+#endif
+    ){
     dpecodeset(DP_EMAP, __FILE__, __LINE__);
     depot->fatal = TRUE;
     return FALSE;

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to