Subject: standards/21402: XPG4.2: struct datum has wrong type
To: None <>
From: Ben Harris <>
List: netbsd-bugs
Date: 04/30/2003 13:30:04
>Number:         21402
>Category:       standards
>Synopsis:       XPG4.2: <ndbm.h> struct datum has wrong type
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 30 12:31:00 UTC 2003
>Originator:     Ben Harris
>Release:        2003-04-30

X/Open System Interfaces and Headers (XSH), Issue 4, Version 2, and its
successors, define struct datum in <ndbm.h> to contain:

void	*dptr
size_t	dsize

NetBSD's <ndbm.h>, though, makes dsize an int.  This could be a problem on
systems where int and size_t are different sizes.

Inspection of the definition of struct datum in <ndbm.h>, and comparison
with <>.

dbm_delete(), dbm_fetch(), and dbm_store() will need to be versioned.