From owner-freebsd-questions Thu Jan 14 00:53:27 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA10295 for freebsd-questions-outgoing; Thu, 14 Jan 1999 00:53:27 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from alice.gba.oz.au (gba-254.tmx.com.au [203.9.155.254]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id AAA10288 for ; Thu, 14 Jan 1999 00:53:23 -0800 (PST) (envelope-from gjb@acm.org) Received: (qmail 5033 invoked by uid 1001); 14 Jan 1999 08:49:29 -0000 Message-ID: <19990114084929.5032.qmail@alice.gba.oz.au> X-Posted-By: GBA-Post 1.03 20-Sep-1998 X-PGP-Fingerprint: 5A91 6942 8CEA 9DAB B95B C249 1CE1 493B 2B5A CE30 Date: Thu, 14 Jan 1999 18:49:28 +1000 From: Greg Black To: "Mehta, Hiren" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: reentrant code References: In-reply-to: of Wed, 13 Jan 1999 13:27:10 PST Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > This question is not specific to Freebsd. It is a very general question. So it probably doesn't belong here ... > What is the meaning of reentrant function ? I'll use C terminology here. A function that accesses a static object is not re-entrant. A function that calls a function that accesses a static object is not re-entrant. And so on. > What do I do to make a function reentrant ? Don't use static objects. Only call functions that are themselves re-entrant. This second one is difficult, because documentation often lies about this -- to be sure, you have to read the source :-( And don't write to addresses handed in by callers, because this is the same as accessing static objects. In other words, it's harder than it looks to get it right. -- Greg Black To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message