Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Reportbug-Version: 3.48
X-Debbugs-Cc: philipp.ma...@emerion.com
Package: libgdbm3
Version: 1.8.3-4
Severity: normal


gdbm uses fsync() on gdbm_close(), although GDMB_FAST is turned on and
GDBM_SYNMODE is turned off.

I've attached a simple C program, and a Makefile.
"make" will compile the program and run it via strace, so that this
is easy to see.

Looking into the sources there is the unconditional fsync() in gdbmclose.c:47;
but simply removing that might break the expected behaviour, so it might be
necessary to define an additional flag to be used with gdbm_setopt().


Regards,

Phil



-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/1 CPU core)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libgdbm3 depends on:
ii  libc6                         2.9-0exp2  GNU C Library: Shared libraries

libgdbm3 recommends no packages.

libgdbm3 suggests no packages.

-- no debconf information

CFLAGS += -Wall -g
LDFLAGS	+= -lgdbm -g

all: gdbm-t
		strace ./gdbm-t

gdbm-t: gdbm-t.c

#include <stdio.h>
#include <gdbm.h>

int main(int argc, char *args[])
{
	GDBM_FILE db;
	datum key={ .dptr="a", .dsize=1};
	datum val={ .dptr="b", .dsize=1};

	db=gdbm_open( args[1] ? args[1] : "test.db", 0, 
			GDBM_WRCREAT | GDBM_FAST, 0777, NULL);
	if (!db) return 1;

	gdbm_store(db, key, val, GDBM_REPLACE);
	gdbm_close(db);
	return 0;
}

Reply via email to