Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Nov 1997 22:27:30 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        cmott@srv.net (Charles Mott)
Cc:        tlambert@primenet.com, freebsd-hackers@freebsd.org
Subject:   Re: pthread_cond_timedwait returning wrong error?
Message-ID:  <199711252227.PAA28520@usr05.primenet.com>
In-Reply-To: <Pine.BSF.3.96.971125122102.25012A-100000@darkstar.home> from "Charles Mott" at Nov 25, 97 12:24:36 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > > From what I can tell by looking at an old DEC OSF/1 reference on
> > > pthreads, returning -1 an setting errno is the way things used to work.
> > > Apparently POSIX has changed that.
> > 
> > Given that "errno" is a global variable, this is actually a good thing.
> > 
> 
> I was wondering whether maybe errno could be a thread-specific variable
> rather than global -- mabye via use of a macro.  I was looking through
> libc_r sources, but I couldn't discern what was being done in this regard. 

It's really thread specific, not global.  But this means that it's
useless for returning status between threads.

The old POSIX had it as a global, and not per thread.

It seems they fixed the problem two ways.


> To me, having all the *_r reentrant functions is a big nuisance.

Sorry; blame POSIX again, for mandating static user data areas
for function returns.  The *_r functions are supposed to fix that
by  making the functions use user buffers, etc..

POSIX needs to unify itself.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711252227.PAA28520>