syslog.h: implement LOG_PERROR.
This is the one openlog() flag that toybox uses. We should probably try
to unify toybox's POSIX logger and Android-specific log at some point,
and this will help.
Also fix our behavior with an empty format string, noticed while adding
tests.
Test: treehugger
Test: adb shell logger -s foo
Change-Id: Ic027e78a460be3db83cc4c6f9946c9efa22be6e1
diff --git a/libc/include/syslog.h b/libc/include/syslog.h
index d89d769..90ea76e 100644
--- a/libc/include/syslog.h
+++ b/libc/include/syslog.h
@@ -112,17 +112,21 @@
*/
#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1)
-/** openlog() options are currently ignored on Android. */
+/** openlog() option ignored on Android. */
#define LOG_PID 0x01
-/** openlog() options are currently ignored on Android. */
+/** openlog() option ignored on Android. */
#define LOG_CONS 0x02
-/** openlog() options are currently ignored on Android. */
+/** openlog() option ignored on Android. */
#define LOG_ODELAY 0x04
-/** openlog() options are currently ignored on Android. */
+/** openlog() option ignored on Android. */
#define LOG_NDELAY 0x08
-/** openlog() options are currently ignored on Android. */
+/** openlog() option ignored on Android. */
#define LOG_NOWAIT 0x10
-/** openlog() options are currently ignored on Android. */
+/**
+ * openlog() option to log to stderr as well as the system log.
+ *
+ * Available since API level 34 (ignored before then).
+ */
#define LOG_PERROR 0x20
/**