[olsr-dev] [PATCH] Improvements in dot_draw plugin

Thomas Lopatic (spam-protected)
Tue Nov 8 13:49:08 CET 2005

> On Tue, 2005-11-08 at 12:43 +0100, Thomas Lopatic wrote:
>> > Is "%m" in printf()s and the like considered portable?
>> This doesn't work on Windows. So I am afraid, no.
> Hmm, do you ever plan to implement olsr_syslog (e.g. to write something
> into the Win* event log)?

Hmm, no, not yet. Would that help us with the "%m" issue?

"%m" on Linux is easy, as every API function that we use in olsrd sets
errno. To implement "%m" the C library can thus simply take errno, run it
through strerror() and display the message.

On Windows it's bit more complicated. The Windows port currently uses two
sources of error information instead of the single "errno" macro known
from Linux: WSAGetLastError() and GetLastError(). The former is used to
obtain error messages supplied by the Windows socket implementation, the
latter is used for all other API functions. I could imagine that this is
also one of the reasons why "%m" is not supported by msvcrt.dll. Too many
sources of error information on the OS.


More information about the Olsr-dev mailing list