Date: Wed, 9 Apr 2003 11:14:08 -0500 From: Mike Meyer <mwm-dated-1050336848.0c448f@mired.org> To: Christopher Nehren <apeiron@comcast.net> Cc: freebsd-questions@freebsd.org Subject: Re: Return values of the syslog(3) family Message-ID: <16020.18128.304955.796904@guru.mired.org> In-Reply-To: <1049840007.685.79.camel@prophecy.dyndns.org> References: <1049840007.685.79.camel@prophecy.dyndns.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In <1049840007.685.79.camel@prophecy.dyndns.org>, Christopher Nehren <apeiron@comcast.net> typed: > 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. Just out of curiosity, exactly what do you expect a program that has just found out that it's logging facility to do? You obviously can't log the fact - though I've seen systems that tried. You don't want to exit without notifying someone of the fact, and the facility you'd most likely use to do that is no longer functioning. You might quit logging and queue the messages to log later, but then you'd have to try logging the first one and see if it works. Besides, that would put false timestamps on each message. If many daemons did this, you'd risk running the system out of virtual, which is a bad idea. All in all, I'd say the best thing to do after a failing syslog is ignore it. <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16020.18128.304955.796904>