From 8db42f5b54c5de080969a41e5d8363a0821bf986 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Oct 2014 10:48:47 -0600 Subject: [PATCH] Update ChangeLog --- ChangeLog | 4 ++-- include/syslog.h | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58d97c4337..f57e379120 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8799,6 +8799,6 @@ compliant (also modify non-standard syslog functions for compatibility). This will break a lot of things until ALL usage of syslog is updated to use the modified interfaces (2014-10-8). - * drivers/: Correct everything under nuttx/drivers to use the corrected - syslog interfaces (2014-10-8). + * drivers/: Correct everything under nuttx/drivers and nuttx/net to + use the corrected syslog interfaces (2014-10-8). diff --git a/include/syslog.h b/include/syslog.h index 1773159a4c..b9fe547eee 100644 --- a/include/syslog.h +++ b/include/syslog.h @@ -132,8 +132,28 @@ int syslog(int priority, FAR const char *format, ...); int vsyslog(int priority, FAR const char *src, va_list ap); #ifdef CONFIG_ARCH_LOWPUTC /* Non-standard */ +/* These are non-standard, low-level system logging interface. The + * difference between syslog() and lowsyslog() is that the syslog() + * interface writes to the syslog device (usually fd=1, stdout) whereas + * lowsyslog() uses a lower level interface that works even from interrupt + * handlers. + */ + int lowsyslog(int priority, FAR const char *format, ...); -int lowvsyslog(int priority, FAR const char *src, va_list ap); +int lowvsyslog(int priority, FAR const char *format, va_list ap); +#else +/* If the platform cannot support lowsyslog, then we will substitute the + * standard syslogging functions. These will, however, probably cause + * problems if called from interrupt handlers, depending upon the nature of + * the underlying syslog device. + */ + +# ifdef CONFIG_CPP_HAVE_VARARGS +# define lowsyslog(p,f,...) syslog(p,f,##__VA_ARGS__) +# else +# define lowsyslog (void) +# endif +# define lowvsyslog(p,f,a) vsyslog(p,f,a) #endif /* Enable or disable syslog output */