about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128ibm-compat/test-syslog-chk-ldbl-compat.c
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabrielftg@linux.ibm.com>2019-07-11 11:47:51 -0300
committerGabriel F. T. Gomes <gabrielftg@linux.ibm.com>2019-11-27 15:52:41 -0300
commit381b76d7a3511e152675018457bd432fa2657928 (patch)
tree1f7ba32975ef1ed80fb2f6615c26b1ba91327a7d /sysdeps/ieee754/ldbl-128ibm-compat/test-syslog-chk-ldbl-compat.c
parent590ef889bc7afe42d4feec94e1c4fbd4ddd65226 (diff)
downloadglibc-381b76d7a3511e152675018457bd432fa2657928.tar.gz
glibc-381b76d7a3511e152675018457bd432fa2657928.tar.xz
glibc-381b76d7a3511e152675018457bd432fa2657928.zip
ldbl-128ibm-compat: Add syslog functions
Similarly to __vfprintf_internal and __vfscanf_internal, the internal
implementation of syslog functions (__vsyslog_internal) takes a
'mode_flags' parameter used to select the format of long double
parameters.  This patch adds variants of the syslog functions that set
'mode_flags' to PRINTF_LDBL_USES_FLOAT128, thus enabling the correct
printing of long double values on powerpc64le, when long double has IEEE
binary128 format (-mabi=ieeelongdouble).

Tested for powerpc64le.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Joseph Myers <joseph@codesourcery.com>
Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm-compat/test-syslog-chk-ldbl-compat.c')
-rw-r--r--sysdeps/ieee754/ldbl-128ibm-compat/test-syslog-chk-ldbl-compat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-syslog-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-syslog-chk-ldbl-compat.c
new file mode 100644
index 0000000000..513b2d2064
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-syslog-chk-ldbl-compat.c
@@ -0,0 +1,6 @@
+#define _FORTIFY_SOURCE 2
+#define SYSLOG_FUNCTION __syslog_chk
+#define SYSLOG_FUNCTION_PARAMS (LOG_DEBUG, 1, "%Lf\n", ld)
+#define VSYSLOG_FUNCTION __vsyslog_chk
+#define VSYSLOG_FUNCTION_PARAMS (LOG_DEBUG, 1, "%Lf\n", ap)
+#include <test-syslog-ldbl-compat-template.c>