Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Dec 2006 15:03:26 -0800
From:      Clint Olsen <clint@0lsen.net>
To:        Christopher Hilton <chris@vindaloo.com>
Cc:        freebsd-stable@freebsd.org, Dan Nelson <dnelson@allantgroup.com>, freebsd-ports@freebsd.org
Subject:   Re: Is syslog() reentrant? Was: OpenBSD's spamd.
Message-ID:  <20061219230326.GG48347@0lsen.net>
In-Reply-To: <458862B8.5060709@vindaloo.com>
References:  <45844912.7070103@vindaloo.com> <45884075.50108@vindaloo.com> <20061219201110.GB87992@dan.emsphone.com> <458862B8.5060709@vindaloo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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                                              ` -- '  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061219230326.GG48347>