Re: Berkely db and _RENTRANT

Tim Howes (howes@netscape.com)
Wed, 19 Jun 1996 21:30:47 -0700

Russell Fulton wrote:
>
> Greetings All.
> Firstly, apologies for bringing this up here. It isn't
> strictly LDAP, but arose while I was following directions for
> installing SLAPD so I expect some of you have tripped over this
> particular rock already.
>
> I have decided to have a try with the Berkeley db Btree. So I tried
> installing db and having noted the warning in the manual for Solaris
> 2.x users I altered the Makefile to add -D_REENTRANT to all
> compiles. Unfortunately this causes syntax errors in the build
> relating to places in the db code where values are assigned to errno.
>
> The effect of defining _REENTRANT is to make errno a function
> returning an int rather than an int. Hence errno = 0 comes out as
> __errno() = 0 and the compiler rightly bitches.
>
> Any way around this one?
>
> Ldap 3.3, db 1.85, on solaris 2.5 compiler gcc.
>
> I have compiled it without the _REENTRANT flag and everything seems to
> run OK but that may be because the server is extreamly lightly
> loaded. i.e. just me doing queries.

Yep, you should have kept reading a little further. ;-) From
the admin guide, same section:

NOTES TO SOLARIS USERS: If you are running under Solaris 2.x and
linking in an external database package (e.g., db or gdbm) it is very
important that you compile the package with the -D_REENTRANT flag. If
you do not, bad things will happen. If you are using version 1.85 or
earlier of the Berkeley db package, you will need to apply the patch
found in build/db.1.85.patch to the db source before compiling it. You
can do this with a command like this from the db source area:

patch -p < ldap-source-directory/build/db.1.85.patch

That's what this patch fixes. -- Tim