Subject: Re: An errno for all seasons
To: None <tech-net@NetBSD.ORG>
From: Ty Sarna <email@example.com>
Date: 10/30/1995 18:15:47
In article <m0t9v5Y-00005tC@flatlin.ka.sub.org>,
Christoph Badura <firstname.lastname@example.org> wrote:
> 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 above does makes errno writable, since the function returns a
pointer to it, not the value. The question is, is this safe in other
cases, and do POSIX or other standards allow errno to be a macro?
(I've done something like this before, which is why this interests me.
Worked fine for what I was doing, but it was much less pervasive and
potentially dangerous as changing the whole C library)