From owner-freebsd-ports@FreeBSD.ORG Tue Dec 19 22:07:59 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7B1A16A412; Tue, 19 Dec 2006 22:07:59 +0000 (UTC) (envelope-from chris@vindaloo.com) Received: from corellia.vindaloo.com (corellia.vindaloo.com [64.51.148.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8781443CB5; Tue, 19 Dec 2006 22:07:54 +0000 (GMT) (envelope-from chris@vindaloo.com) Received: from yavin.vindaloo.com (yavin.vindaloo.com [172.24.144.34]) by corellia.vindaloo.com (Postfix) with ESMTP id 9C0895C47; Tue, 19 Dec 2006 17:07:53 -0500 (EST) Received: from [172.24.145.69] (endor.vindaloo.com [172.24.145.69]) by yavin.vindaloo.com (Postfix) with ESMTP id 39DE325395; Tue, 19 Dec 2006 17:07:53 -0500 (EST) Message-ID: <458862B8.5060709@vindaloo.com> Date: Tue, 19 Dec 2006 17:07:52 -0500 From: Christopher Hilton User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: Dan Nelson References: <45844912.7070103@vindaloo.com> <45884075.50108@vindaloo.com> <20061219201110.GB87992@dan.emsphone.com> In-Reply-To: <20061219201110.GB87992@dan.emsphone.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org, freebsd-ports@freebsd.org Subject: Re: Is syslog() reentrant? Was: OpenBSD's spamd. X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2006 22:07:59 -0000 Dan Nelson wrote: > In the last episode (Dec 19), Christopher Hilton said: >> A casual attempt to compile a fresher copy of the software shows that >> spamd is using the OpenBSD's reentrant syslog functions (syslog_r, >> openlog_r, etc) Is FreeBSD's syslog already reentrant? > > It is, as of FreeBSD 5.4. In previous versions only openlog() and > syslog("%m") with an invalid errno were non-reentrant. > 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. -- Chris