This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]