Subject: Re: An errno for all seasons
To: Christoph Badura <flatlin.ka.sub.org!bad@werple.net.au>
From: John Birrell <cimaxp1!jb@werple.net.au>
List: tech-userlevel
Date: 10/31/1995 08:10:44
>
> John Birrel writes:
> >We're living with a threaded version of NetBSD's libc where errno is thread
> >specific. By changing errno.h to define errno as:
>
> >extern int *__error();
> >#define errno (*__error())
>
> I believe POSIX requires errno to be writeable in order to detect the
> indeterminate cases of sysconf()/pathconf().
The non-threaded version of __error() just returns &errno, whereas the
threaded version returns &pthread_run->error. In either case these _must_ be
writeable for errno to work (because the cerror asm code calls __errno() to
change the value of errno).
> --
> Christoph Badura bad@flatlin.ka.sub.org +49 721 606137
>
> Es genuegt nicht, keine Gedanken zu haben;
> man muss auch unfaehig sein, sie auszudruecken. - Karl Kraus
>
In my original post on this subject (thread? 8-), I referred to stdio.h. I
should have referred to signal.h (which has 'extern int errno' in macros).
--
John Birrell CIMlogic Pty Ltd
jb@cimlogic.com.au 119 Cecil Street
Ph +61 3 9690 9600 South Melbourne Vic 3205
Fax +61 3 9690 6650 Australia
Mob +61 18 353 137