This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
RE: Double definition of errno?
- From: "Banit Agrawal" <banit at cse dot iitkgp dot ernet dot in>
- To: "KJK::Hyperion" <noog at libero dot it>
- Cc: <newlib at sources dot redhat dot com>
- Date: Sun, 18 Aug 2002 09:59:26 +0530
- Subject: RE: Double definition of errno?
Hi,
extern int errno;
this is declared because we can set the different error number if
any system call is not implemented. we can define this error in
errno.h file. Later we can examine the value of "errno" to find out
what has happened?
and the macro for _errno I guess may be to implement a function call
where you can do other target-specific error-handling and also
setting the appropriate errno number.
Best Regards,
Banit Agrawal
-----Original Message-----
From: newlib-owner@sources.redhat.com
[mailto:newlib-owner@sources.redhat.com]On Behalf Of KJK::Hyperion
Sent: Sunday, August 18, 2002 2:20 AM
To: newlib@sources.redhat.com
Subject: Double definition of errno?
Hi all. I'm not very familiar with C library implementations, so I'm
wondering what's the purpose of a double definition of errno, both as
"extern int" and as a macro, but, correct me if I'm wrong, it seems that
some calls (namely, "system calls") are assumed to use the "extern int
errno", while all the others will use the errno macro. I'd like to use an
unified definition of errno, would this break something? (except the
reentrant system calls provided by newlib, which I can override)