errno handling in nonreentrant syscalls (fwd)

Dmitry Timoshkov
Thu May 24 22:41:00 GMT 2001

"Joachim Falk" <> wrote:

> there seam to be 3 cases for syscall dispatching in newlib

[big snip]

I'm sorry to not answer your question. I asked a similar question
on the Cygwin mailing list, but unfortunately it seemed that my
question was leaved unanswered. You can inspect the whole thread
of questions/answers in the archives of mailing
list (subjects: "__errno_location() like functionality in Cygwin" and
"oldhand cygwinner needed: RE: __errno_location() like functionality in Cygwin".

Basically I need to define my own function that will return a pointer
to my own errno variable. That approach works fine under other Unix OSes,
but doesn't work with newlib (Cygwin's libc).
Linux uses for that functionality __errno_location(), FreeBSD - __error(),
Solaris - ___errno(), UnixWare - __thr_errno().

Perhaps jointly we could work out a way to bypass that limitation of newlib?

More information about the Newlib mailing list