Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Mar 2004 09:00:47 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Tim Robbins <tjr@freebsd.org>
Cc:        threads@freebsd.org
Subject:   Re: RFC: getc() and putc() as macros
Message-ID:  <Pine.GSO.4.10.10403140847010.19558-100000@pcnet5.pcnet.com>
In-Reply-To: <20040314090324.GA23093@cat.robbins.dropbear.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10403140847010.19558-100000>