[openib-general] win related [was: Re: [PATCH 1/2] opensm: sigusr1: syslog() fixes]

Sasha Khapyorsky sashak at voltaire.com
Wed Jan 10 15:19:17 PST 2007


Hi Yevgeny,

On 09:47 Wed 10 Jan     , Yevgeny Kliteynik wrote:
> Hi Sasha,
> 
> Sasha Khapyorsky wrote:
> > Hi Yevgeny,
> > 
> > On 12:05 Tue 09 Jan     , Yevgeny Kliteynik wrote:
> >> Hi Sasha.
> >> Thanks for spotting this issue - I missed it when I reviewed the patch.
> >> Here's how things look in windows:
> >>  * openlog() and closelog() are redefined to nothing in windows config header
> >>  * cl_log_event() implementation on windows does all the work - gets handler
> >>    to event log, logs the message, and closes the handler.
> >>    It does *not* uses syslog().
> >>
> >> To use syslog/sysopen/sysclose on windows, a user have to install some 
> >> package (e.g. "Interix") that provides various daemons (such as syslogd), 
> >> similar to Linux/Unix:
> >> 	http://msdn2.microsoft.com/en-us/library/ms811897.aspx#ucmgch10_topic12
> >> 	http://www.interix.com/
> > 
> > And this is not done for WinOpenSM now. Is this would be useful option? I
> > guess this could solve a lot of compatibility problems and simplify the
> > porting dramatically, right?
> 
> I'll address this question to the windows guys. But I seriously doubt that
> they would want to make OSM depend on some third-party product, whether it
> is commercial or free.

I doubt too :(. But ask them if it is not too hard. Interesting, how
WinOSM development works? AFAIK it is open source and published on the
net. Who is the maintainer? Is there any active mailing list?

> >> So replacing cl_log_event() with syslog() would definitely cause a problem.
> >>
> >> A (pretty ugly) solution can be writing a wrapper function to cl_log_event() 
> >> on windows and redefining syslog() to use this wrapper.
> > 
> > Like #define syslog() cl_log_event() ? Not so ugly (better than
> > combination of openlog()/closelog() and "unrelated" cl_log_event()),
> > and perfectly simple IMO.
> 
> "#define syslog() cl_log_event()" will not do the job, since these functions 
> have different definitios:
> 	syslog(int priority, char *message, ...);
> 	cl_log_event(char*, cl_log_type_t, char*, void*, uint32_t);
> so there should be wrapper just for windows that will prepare the message
> for cl_log_event() as a single string.

Understood.

And what the purpose of:

  #ifdef WIN32
        OsmReportState(buffer);
  #endif /* WIN32 */

in osm_log() (right after cl_log_event()/syslog())?

Sasha




More information about the general mailing list