From owner-freebsd-hackers Tue Nov 25 14:28:20 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA09477 for hackers-outgoing; Tue, 25 Nov 1997 14:28:20 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id OAA09457 for ; Tue, 25 Nov 1997 14:28:16 -0800 (PST) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id IAA00304; Tue, 25 Nov 1997 08:43:15 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp01.primenet.com, id smtpd000288; Tue Nov 25 08:43:11 1997 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id PAA28520; Tue, 25 Nov 1997 15:27:30 -0700 (MST) From: Terry Lambert Message-Id: <199711252227.PAA28520@usr05.primenet.com> Subject: Re: pthread_cond_timedwait returning wrong error? To: cmott@srv.net (Charles Mott) Date: Tue, 25 Nov 1997 22:27:30 +0000 (GMT) Cc: tlambert@primenet.com, freebsd-hackers@freebsd.org In-Reply-To: from "Charles Mott" at Nov 25, 97 12:24:36 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > 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.