Is syslog() reentrant? Was: OpenBSD's spamd.

Clint Olsen clint at 0lsen.net
Tue Dec 19 15:18:36 PST 2006


On Dec 19, Christopher Hilton wrote:
> Awesome. Then all I have to do to get the fresher code is either wrap the
> openlog_r and syslog_r calls in the spamd.c or write local functions
> which do the same. From the point of style which is preferable? Is it
> even possible to #define a C function to get around an argument? E.g.
> The openbsd syslog_r function has this call sequence:
> 
>      void
>      syslog_r(int priority, struct syslog_data *data,
>               const char *message,
>               ...);
> 
> 
> 
> IIRC there isn't a way to get around the '...' argument with #define and
> deal with the extra argument.

Only C99 allows macros with variable arguments.  But you can attempt to
just replace the function identifier (name) if the function's arguments are
otherwise in the same order.

-Clint
-- 
Clint Olsen                                                        . -- .  
clint at NULlsen dot net                                         .'  ,-. `.
                                                                 ;_,' (   ;
"I am Dick Lexic of Borg.  Prepare to be ass-laminated."         `.    ``;'
        -- Styx Allum                                              ` -- '  


More information about the freebsd-ports mailing list