From owner-freebsd-hackers Fri Jan 8 14:27:09 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA04312 for freebsd-hackers-outgoing; Fri, 8 Jan 1999 14:27:09 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA04303 for ; Fri, 8 Jan 1999 14:27:06 -0800 (PST) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.9.1/8.9.1) id JAA00644; Sat, 9 Jan 1999 09:29:09 +1100 (EST) (envelope-from jb) From: John Birrell Message-Id: <199901082229.JAA00644@cimlogic.com.au> Subject: Re: Strange warnings when compiling Berkeley DB on FreeBSD 3.0 In-Reply-To: <199901082218.RAA29040@abyssinian.sleepycat.com> from Sleepycat Software at "Jan 8, 1999 5:18:19 pm" To: db@abyssinian.sleepycat.com (Sleepycat Software) Date: Sat, 9 Jan 1999 09:29:09 +1100 (EST) Cc: jb@cimlogic.com.au, freebsd-hackers@FreeBSD.ORG, openldap-devel@openldap.org, yusufg@huge.net X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sleepycat Software wrote: > We were told that, for thread-safe programs under FreeBSD, > we should add -D_THREAD_SAFE to the C pre-processor flags, > and load against -lc_r. Is that not correct? Linking against both libc and libc_r will cause strange results. Using gcc -pthread is the correct way. > Is there a > preferred method of guaranteeing thread safety within the > Berkeley DB library? Other than compiling with -D_THREAD_SAFE on FreeBSD, normal thread safety rules apply. Don't use global variables. Make all functions re-entrant. -- John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/ CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message