
On Sat, 17 May 2008 00:15:23 +1000, Nick Coghlan <ncoghlan@gmail.com> wrote:
Alexander Belopolsky wrote:
Yannick Gingras <ygingras <at> ygingras.net> writes:
2) Where can I find the symbolic name in C?
Use standard C library char* strerror(int errnum) function. You can see an example usage in Modules/posixmodule.c (posix_strerror).
I don't believe that would provide adequate Windows support.
It's not C, but maybe it's interesting to look at anyway: http://twistedmatrix.com/trac/browser/trunk/twisted/python/win32.py?rev=2168... However, neither strerror nor the linked code gives out symbolic names for errnos. They both produce messages like "Interrupted system call", whereas the symbolic name would be "EINTR". Modules/errnomodule.c might be worth looking at, although its solution is somewhat disappointing. Jean-Paul