1. Reading errno from msvcrt.dll
- Posted by Jason Gade <jaygade at yahoo.com> Feb 12, 2006
- 526 views
How do I get the value of errno and _doserrno from msvcrt.dll? I'm using define_c_var()(using "_errno" and "__doserrno") to get the addresses. I then use peek4s() to see what their values are. No matter what, I am getting 28075240 and 28071656 decimal respectively. These are invalid error numbers (I've verified that by using strerror). I know I am getting the error that I am intentionally causing because I can use perror to print the error message. I might not need this, but I would like to rely on more information than just -1 returned from an IO function. Anyone have experience in this?
2. Re: Reading errno from msvcrt.dll
- Posted by Jonas Temple <jtemple at yhti.net> Feb 12, 2006
- 533 views
It's been a while, but isn't "_errno" a function, not a value? I seem to remember having to figure that out once long ago... Jonas Temple http://www.yhti.net/~jktemple
3. Re: Reading errno from msvcrt.dll
- Posted by Jason Gade <jaygade at yahoo.com> Feb 12, 2006
- 534 views
Jonas Temple wrote: > > It's been a while, but isn't "_errno" a function, not a value? I seem to > remember > having to figure that out once long ago... > > Jonas Temple > <a href="http://www.yhti.net/~jktemple">http://www.yhti.net/~jktemple</a> I've been referring to both the glibc and the msvcrt documentation and they both say that errno is declared as an external int. -- "Any programming problem can be solved by adding a level of indirection." --anonymous "Any performance problem can be solved by removing a level of indirection." --M. Haertel j.
4. Re: Reading errno from msvcrt.dll
- Posted by ags <eu at 531pi.co.nz> Feb 12, 2006
- 530 views
Jason Gade wrote: > I've been referring to both the glibc and the msvcrt documentation and they > both say that errno is declared as an external int. I don't know if this is relevant: http://support.microsoft.com/default.aspx?scid=kb;en-us;94248 See section 4, it is about accessing errno in MSVCRT from a another C Runtime Library not doing what you expect. I can't see that being the issue though because you are referencing the variable in MSVCRT presumably. Gary
5. Re: Reading errno from msvcrt.dll
- Posted by Jason Gade <jaygade at yahoo.com> Feb 12, 2006
- 570 views
ags wrote: > > Jason Gade wrote: > > I've been referring to both the glibc and the msvcrt documentation and they > > both say that errno is declared as an external int. > > I don't know if this is relevant: > > <a > href="http://support.microsoft.com/default.aspx?scid=kb">http://support.microsoft.com/default.aspx?scid=kb</a>;en-us;94248 > > See section 4, it is about accessing errno in MSVCRT from a another > C Runtime Library not doing what you expect. > > I can't see that being the issue though because you are referencing the > variable in MSVCRT presumably. > > Gary Thanks for the link. It looks like it might be related but I didn't get a clear solution from it. The thing that gets me is that the perror() function works, but I would like to get errno so I can pass it back to the user of the library. I may have to try this on Linux to see what result I get. -- "Any programming problem can be solved by adding a level of indirection." --anonymous "Any performance problem can be solved by removing a level of indirection." --M. Haertel j.