Per OpenGroup.org, syslog -- and, hence, nonstandard vsyslog, and debug wrappers -- does not return a value. Rename _vsyslog to nx_vsyslog. Use internal nx_vsyslog in the few cases where a return value is required.

This commit is contained in:
Gregory Nutt
2018-03-04 08:07:07 -06:00
parent 8cd80e2d47
commit de6b13b3ab
28 changed files with 123 additions and 107 deletions
+6 -4
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* arch/arm/src/arm/up_assert.c
*
* Copyright (C) 2007-2010, 2012-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2010, 2012-2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -48,6 +49,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -148,12 +150,12 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
return OK;
}
static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv6-m/up_assert.c
*
* Copyright (C) 2013-2015, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2015, 2016, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -190,10 +191,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_assert.c
*
* Copyright (C) 2013-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2016, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -183,10 +184,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+5 -3
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* arch/arm/src/armv7-m/up_assert.c
*
* Copyright (C) 2009-2010, 2012-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2009-2010, 2012-2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +48,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -196,10 +198,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-r/arm_assert.c
*
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2015-2016, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -183,10 +184,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+5 -3
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* arch/avr/src/common/up_assert.c
*
* Copyright (C) 2010-2011, 2013-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2011, 2013-2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +48,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -106,10 +108,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/hc/src/m9s12/m9s12_assert.c
*
* Copyright (C) 2011-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2016, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -141,10 +142,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/mips/src/mips32/up_assert.c
*
* Copyright (C) 2011-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2015, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -106,10 +107,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/misoc/src/lm32/lm32_assert.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Ramtin Amin <keytwo@gmail.com>
*
@@ -48,6 +48,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -107,10 +108,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+5 -3
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* arch/renesas/src/common/up_assert.c
*
* Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2012-2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +48,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <nuttx/usb/usbdev_trace.h>
@@ -107,10 +109,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/risc-v/src/rv32im/up_assert.c
*
* Copyright (C) 2011-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2015, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -106,10 +107,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/x86/src/common/up_assert.c
*
* Copyright (C) 2011-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2016, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <arch/arch.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -100,10 +101,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/xtensa/src/common/xtensa_assert.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2016, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -77,10 +78,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+5 -3
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* common/up_assert.c
*
* Copyright (C) 2008-2009, 2012-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2012-2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +48,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <arch/board/board.h>
@@ -106,10 +108,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+5 -3
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* arch/z80/src/common/up_assert.c
*
* Copyright (C) 2007-2009, 2012-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2012-2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +48,7 @@
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include "chip.h"
@@ -105,10 +107,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_EMERG, fmt, ap);
ret = nx_vsyslog(LOG_EMERG, fmt, &ap);
va_end(ap);
return ret;
}
+3 -3
View File
@@ -54,10 +54,10 @@
****************************************************************************/
/****************************************************************************
* Name: _vsyslog
* Name: nx_vsyslog
*
* Description:
* _vsyslog() handles the system logging system calls. It is functionally
* nx_vsyslog() handles the system logging system calls. It is functionally
* equivalent to vsyslog() except that (1) the per-process priority
* filtering has already been performed and the va_list parameter is
* passed by reference. That is because the va_list is a structure in
@@ -66,7 +66,7 @@
*
****************************************************************************/
int _vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
{
struct lib_syslogstream_s stream;
int ret;
+5 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/usbdev/usbdev_trace.c
*
* Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2010, 2012, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,9 @@
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#undef usbtrace
/****************************************************************************
@@ -100,10 +102,10 @@ static int usbtrace_syslog(const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_INFO, fmt, ap);
ret = nx_vsyslog(LOG_INFO, fmt, &ap);
va_end(ap);
return ret;
}
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/usbmonitor/usbmonitor.c
*
* Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,7 @@
#include <nuttx/signal.h>
#include <nuttx/kthread.h>
#include <nuttx/syslog/syslog.h>
#include <nuttx/usb/usbdev_trace.h>
#include <nuttx/usb/usbhost_trace.h>
@@ -144,10 +145,10 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
va_list ap;
int ret;
/* Let vsyslog do the real work */
/* Let nx_vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_INFO, fmt, ap);
ret = nx_vsyslog(LOG_INFO, fmt, &ap);
va_end(ap);
return ret;
}
+4 -4
View File
@@ -1572,19 +1572,19 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
#ifndef CONFIG_CPP_HAVE_VARARGS
#ifdef CONFIG_DEBUG_ALERT
int _alert(const char *format, ...);
void _alert(const char *format, ...);
#endif
#ifdef CONFIG_DEBUG_ERROR
int _err(const char *format, ...);
void _err(const char *format, ...);
#endif
#ifdef CONFIG_DEBUG_WARN
int _warn(const char *format, ...);
void _warn(const char *format, ...);
#endif
#ifdef CONFIG_DEBUG_INFO
int _info(const char *format, ...);
void _info(const char *format, ...);
#endif
#endif /* CONFIG_CPP_HAVE_VARARGS */
+3 -3
View File
@@ -263,10 +263,10 @@ int syslog_flush(void);
#endif
/****************************************************************************
* Name: _vsyslog
* Name: nx_vsyslog
*
* Description:
* _vsyslog() handles the system logging system calls. It is functionally
* nx_vsyslog() handles the system logging system calls. It is functionally
* equivalent to vsyslog() except that (1) the per-process priority
* filtering has already been performed and the va_list parameter is
* passed by reference. That is because the va_list is a structure in
@@ -275,7 +275,7 @@ int syslog_flush(void);
*
****************************************************************************/
int _vsyslog(int priority, FAR const IPTR char *src, FAR va_list *ap);
int nx_vsyslog(int priority, FAR const IPTR char *src, FAR va_list *ap);
/****************************************************************************
* Name: syslog_register
+1 -1
View File
@@ -263,7 +263,7 @@
/* Unconditional system logging */
#define SYS__vsyslog (__SYS_syslog+0)
#define SYS_nx_vsyslog (__SYS_syslog+0)
#define __SYS_descriptors (__SYS_syslog+1)
/* The following are defined if either file or socket descriptor are
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/syslog.h
*
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2014, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -212,8 +212,8 @@ void closelog(void);
*
****************************************************************************/
int syslog(int priority, FAR const IPTR char *fmt, ...);
int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap);
void syslog(int priority, FAR const IPTR char *fmt, ...);
void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap);
/****************************************************************************
* Name: setlogmask
+10 -21
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* libc/misc/lib_err.c
*
* Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2011-2012, 2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -60,58 +61,46 @@
****************************************************************************/
#ifdef CONFIG_DEBUG_ALERT
int _alert(const char *format, ...)
void _alert(const char *format, ...)
{
va_list ap;
int ret;
va_start(ap, format);
ret = vsyslog(LOG_EMERG, format, ap);
vsyslog(LOG_EMERG, format, ap);
va_end(ap);
return ret;
}
#endif /* CONFIG_DEBUG_ALERT */
#ifdef CONFIG_DEBUG_ERROR
int _err(const char *format, ...)
void _err(const char *format, ...)
{
va_list ap;
int ret;
va_start(ap, format);
ret = vsyslog(LOG_ERR, format, ap);
vsyslog(LOG_ERR, format, ap);
va_end(ap);
return ret;
}
#endif /* CONFIG_DEBUG_ERROR */
#ifdef CONFIG_DEBUG_WARN
int _warn(const char *format, ...)
void _warn(const char *format, ...)
{
va_list ap;
int ret;
va_start(ap, format);
ret = vsyslog(LOG_WARNING, format, ap);
vsyslog(LOG_WARNING, format, ap);
va_end(ap);
return ret;
}
#endif /* CONFIG_DEBUG_WARN */
#ifdef CONFIG_DEBUG_INFO
int _info(const char *format, ...)
void _info(const char *format, ...)
{
va_list ap;
int ret;
va_start(ap, format);
ret = vsyslog(LOG_INFO, format, ap);
vsyslog(LOG_INFO, format, ap);
va_end(ap);
return ret;
}
#endif /* CONFIG_DEBUG_INFO */
+5 -2
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* libc/stdio/lib_printf.c
*
* Copyright (C) 2007-2008, 2011-2012, 2014, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2008, 2011-2012, 2014, 2016, 2018 Gregory Nutt. All
* rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,6 +41,8 @@
#include <stdio.h>
#include <syslog.h>
#include <nuttx/syslog/syslog.h>
#include "libc.h"
/****************************************************************************
@@ -59,7 +62,7 @@ int printf(FAR const IPTR char *fmt, ...)
#if CONFIG_NFILE_STREAMS > 0
ret = vfprintf(stdout, fmt, ap);
#else
ret = vsyslog(LOG_INFO, fmt, ap);
ret = nx_vsyslog(LOG_INFO, fmt, &ap);
#endif
va_end(ap);
+13 -13
View File
@@ -1,7 +1,8 @@
/****************************************************************************
* libc/syslog/lib_syslog.c
*
* Copyright (C) 2007-2009, 2011-2014, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2011-2014, 2016, 2018 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -57,27 +58,26 @@
* difference that it takes a set of arguments which have been obtained
* using the stdarg variable argument list macros.
*
* Returned Value:
* None.
*
****************************************************************************/
int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap)
void vsyslog(int priority, FAR const IPTR char *fmt, va_list ap)
{
int ret = 0;
/* Check if this priority is enabled */
if ((g_syslog_mask & LOG_MASK(priority)) != 0)
{
/* Yes.. Perform the _vsyslog system call.
/* Yes.. Perform the nx_vsyslog system call.
*
* NOTE: The va_list parameter is passed by reference. That is
* because the va_list is a structure in some compilers and passing
* of structures in the NuttX sycalls does not work.
*/
ret = _vsyslog(priority, fmt, &ap);
(void)nx_vsyslog(priority, fmt, &ap);
}
return ret;
}
/****************************************************************************
@@ -92,18 +92,18 @@ int vsyslog(int priority, FAR const IPTR char *fmt, va_list ap)
* The NuttX implementation does not support any special formatting
* characters beyond those supported by printf.
*
* Returned Value:
* None.
*
****************************************************************************/
int syslog(int priority, FAR const IPTR char *fmt, ...)
void syslog(int priority, FAR const IPTR char *fmt, ...)
{
va_list ap;
int ret;
/* Let vsyslog do the work */
va_start(ap, fmt);
ret = vsyslog(priority, fmt, ap);
vsyslog(priority, fmt, ap);
va_end(ap);
return ret;
}
+1 -1
View File
@@ -56,6 +56,7 @@
"mq_timedreceive","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","ssize_t","mqd_t","char*","size_t","int*","const struct timespec*"
"mq_timedsend","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const char*","size_t","int","const struct timespec*"
"mq_unlink","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","const char*"
"nx_vsyslog","nuttx/syslog/syslog.h","","int","int","FAR const IPTR char*","FAR va_list*"
"on_exit","stdlib.h","defined(CONFIG_SCHED_ONEXIT)","int","CODE void (*)(int, FAR void *)","FAR void *"
"open","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","int","..."
"opendir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR DIR*","FAR const char*"
@@ -168,7 +169,6 @@
"up_assert","assert.h","","void","FAR const uint8_t*","int"
#"up_assert","assert.h","","void"
"vfork","unistd.h","defined(CONFIG_ARCH_HAVE_VFORK)","pid_t"
"_vsyslog","nuttx/syslog/syslog.h","","int","int","FAR const IPTR char*","FAR va_list*"
"wait","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","pid_t","int*"
"waitid","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","int","idtype_t","id_t"," FAR siginfo_t *","int"
"waitpid","sys/wait.h","defined(CONFIG_SCHED_WAITPID)","pid_t","pid_t","int*","int"
Can't render this file because it contains an unexpected character in line 152 and column 2.
+2 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* syscall/syscall_lookup.h
*
* Copyright (C) 2011, 2013-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -184,7 +184,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
/* System logging */
SYSCALL_LOOKUP(_vsyslog, 3, STUB__vsyslog)
SYSCALL_LOOKUP(nx_vsyslog, 3, STUB_nx_vsyslog)
/* The following are defined if either file or socket descriptor are
* enabled.
+2 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* syscall/syscall_stublookup.c
*
* Copyright (C) 2011-2013, 2015-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2013, 2015-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -178,7 +178,7 @@ uintptr_t STUB_timer_settime(int nbr, uintptr_t parm1, uintptr_t parm2,
/* System logging */
uintptr_t STUB__vsyslog(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t STUB_nx_vsyslog(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
/* The following are defined if either file or socket descriptor are