From owner-freebsd-questions@FreeBSD.ORG Tue Apr 8 15:34:48 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5544E37B407 for ; Tue, 8 Apr 2003 15:34:48 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id C36A243FBF for ; Tue, 8 Apr 2003 15:34:44 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h38MYh5e058698; Tue, 8 Apr 2003 17:34:43 -0500 (CDT) (envelope-from dan) Date: Tue, 8 Apr 2003 17:34:43 -0500 From: Dan Nelson To: Christopher Nehren Message-ID: <20030408223443.GA30909@dan.emsphone.com> References: <1049840007.685.79.camel@prophecy.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1049840007.685.79.camel@prophecy.dyndns.org> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: freebsd-questions@freebsd.org Subject: Re: Return values of the syslog(3) family X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 22:34:49 -0000 In the last episode (Apr 08), Christopher Nehren said: > ... or rather, lack thereof. I'm not quite sure whom to ask about > this, so please redirect me if this isn't the appropriate forum. > > I've looked at the prototypes of various BSD and Linux systems' > syslog(3) calls, and they all have 'void' as the return type. Now, > logically, since a log file is being written, wouldn't it be nice to > know whether that call executed successfully? Yes, I've already > thought of the "If you can't write to syslog, then you have larger > problems than this" ... but how would one -know- they have these > problems? I admit that I'm probably missing something about the > Nature of Programming; but at least to this newbie, it seems like it > defeats part of the point of calling the functions in the first > place. TIA for any information about this. Syslogging is done by writing to the /var/run/log pipe. If the write succeeds, the app continues. That just means that the data is in the pipe, though. Syslogd can take its time emptying the pipe (within reasonable limits, or the other end will block), so it many not be able to return an error until long after the syslog() call has returned at the client's side. Syslogd can also forward to a remote server via UDP packets, so even though a log entry may eventually get written, there's no guarantee that it's even on the same machine or that the packets made it. -- Dan Nelson dnelson@allantgroup.com