From owner-freebsd-threads@FreeBSD.ORG Sun Mar 14 06:00:48 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA39B16A4CE; Sun, 14 Mar 2004 06:00:48 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F26443D1F; Sun, 14 Mar 2004 06:00:48 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i2EE0lW7023872; Sun, 14 Mar 2004 09:00:47 -0500 (EST) Date: Sun, 14 Mar 2004 09:00:47 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Tim Robbins In-Reply-To: <20040314090324.GA23093@cat.robbins.dropbear.id.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: RFC: getc() and putc() as macros X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2004 14:00:49 -0000 On Sun, 14 Mar 2004, Tim Robbins wrote: > On Sun, Mar 14, 2004 at 12:53:55AM -0500, Daniel Eischen wrote: > > > On Sun, 14 Mar 2004, Tim Robbins wrote: > > > > > Can you think of a better way? > > > > I think it was I that got rid of the macros for getc() et al. > > I did it when libc_r was divorced from libc, and the macro > > _THREAD_SAFE was no longer necessary. > > > > Solaris uses _REENTRANT to toggle between macros and functions. > > For the macro versions, it accesses the FILE directly instead > > of making a function call. > > > > I think the _unlocked versions of the functions are there for > > a reason. If an application isn't going to be threaded, then > > it can always use the unlocked versions... > > Perhaps they could in theory, but in practice, single threaded applications > don't use the _unlocked functions. They haven't needed to, since most > serious operating systems except FreeBSD 5 provide getc() and putc() macros. Yes, like I said at least Solaris uses macros but that forces threaded applications to use -D_REENTRANT. If the only thing you are exporting is __isthreaded, then I'll table my slight dislike of this change. But we reserve the right to change __isthreaded. -- Dan Eischen