new file mode 100644
@@ -0,0 +1 @@
+#include <misc/bits/err-ldbl.h>
@@ -1,6 +1,15 @@
#ifndef _ERR_H
#include <misc/err.h>
+/* Prototypes for internal err.h functions. */
+void
+__vwarnx_internal (const char *format, __gnuc_va_list ap,
+ unsigned int mode_flags);
+
+void
+__vwarn_internal (const char *format, __gnuc_va_list ap,
+ unsigned int mode_flags);
+
# ifndef _ISOMAC
libc_hidden_proto (warn)
@@ -36,7 +36,8 @@ headers := sys/uio.h bits/uio-ext.h bits/uio_lim.h \
syslog.h sys/syslog.h \
bits/syslog.h bits/syslog-ldbl.h bits/syslog-path.h bits/error.h \
bits/select2.h bits/hwcap.h sys/auxv.h \
- sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h
+ sys/sysmacros.h bits/sysmacros.h bits/types/struct_iovec.h \
+ bits/err-ldbl.h
routines := brk sbrk sstk ioctl \
readv writev preadv preadv64 pwritev pwritev64 \
new file mode 100644
@@ -0,0 +1,30 @@
+/* Redirections for err.h functions for -mlong-double-64.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _ERR_H
+# error "Never include <bits/err-ldbl.h> directly; use <err.h> instead."
+#endif
+
+__LDBL_REDIR_DECL (warn)
+__LDBL_REDIR_DECL (vwarn)
+__LDBL_REDIR_DECL (warnx)
+__LDBL_REDIR_DECL (vwarnx)
+__LDBL_REDIR_DECL (err)
+__LDBL_REDIR_DECL (verr)
+__LDBL_REDIR_DECL (errx)
+__LDBL_REDIR_DECL (verrx)
@@ -52,6 +52,10 @@ extern void errx (int __status, const char *__format, ...)
extern void verrx (int __status, const char *, __gnuc_va_list)
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
+#ifdef __LDBL_COMPAT
+# include <bits/err-ldbl.h>
+#endif
+
__END_DECLS
#endif /* err.h */
@@ -80,6 +80,8 @@ libc {
}
GLIBC_2.29 {
__nldbl_argp_error; __nldbl_argp_failure;
+ __nldbl_warn; __nldbl_vwarn; __nldbl_warnx; __nldbl_vwarnx;
+ __nldbl_err; __nldbl_verr; __nldbl_errx; __nldbl_verrx;
}
}
libm {
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <argp.h>
+#include <err.h>
#include <stdarg.h>
#include <stdio.h>
#include <libio/strfile.h>
@@ -1006,6 +1007,66 @@ __nldbl_argp_failure (const struct argp_state *state, int status,
va_end (ap);
}
+#define VA_CALL(call) \
+{ \
+ va_list ap; \
+ va_start (ap, format); \
+ call (format, ap, PRINTF_LDBL_IS_DBL); \
+ va_end (ap); \
+}
+
+void
+__nldbl_err (int status, const char *format, ...)
+{
+ VA_CALL (__vwarn_internal)
+ exit (status);
+}
+
+void
+__nldbl_errx (int status, const char *format, ...)
+{
+ VA_CALL (__vwarnx_internal)
+ exit (status);
+}
+
+void
+__nldbl_verr (int status, const char *format, __gnuc_va_list ap)
+{
+ __vwarn_internal (format, ap, PRINTF_LDBL_IS_DBL);
+ exit (status);
+}
+
+void
+__nldbl_verrx (int status, const char *format, __gnuc_va_list ap)
+{
+ __vwarnx_internal (format, ap, PRINTF_LDBL_IS_DBL);
+ exit (status);
+}
+
+void
+__nldbl_warn (const char *format, ...)
+{
+ VA_CALL (__vwarn_internal)
+}
+
+void
+__nldbl_warnx (const char *format, ...)
+{
+ VA_CALL (__vwarnx_internal)
+}
+
+void
+__nldbl_vwarn (const char *format, __gnuc_va_list ap)
+{
+ __vwarn_internal (format, ap, PRINTF_LDBL_IS_DBL);
+}
+
+void
+__nldbl_vwarnx (const char *format, __gnuc_va_list ap)
+{
+ __vwarnx_internal (format, ap, PRINTF_LDBL_IS_DBL);
+}
+
#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0);
compat_symbol (libc, __nldbl__IO_sprintf, _IO_sprintf, GLIBC_2_0);
@@ -27,6 +27,7 @@
/* Avoid long double prototypes. */
#define __NO_LONG_DOUBLE_MATH 1
#include <argp.h>
+#include <err.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdint.h>
@@ -79,6 +80,14 @@ NLDBL_DECL (__isoc99_vfwscanf);
NLDBL_DECL (__isoc99_vswscanf);
NLDBL_DECL (argp_error);
NLDBL_DECL (argp_failure);
+NLDBL_DECL (warn);
+NLDBL_DECL (vwarn);
+NLDBL_DECL (warnx);
+NLDBL_DECL (vwarnx);
+NLDBL_DECL (err);
+NLDBL_DECL (verr);
+NLDBL_DECL (errx);
+NLDBL_DECL (verrx);
/* These do not exist in the normal interface, but must exist in the
__nldbl interface so that they can be called from libnldbl. */
@@ -2035,6 +2035,14 @@ GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1995,6 +1995,14 @@ GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1999,6 +1999,14 @@ GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -125,6 +125,14 @@ GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -2230,6 +2230,14 @@ GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -2004,6 +2004,14 @@ GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1910,6 +1910,14 @@ GLIBC_2.28 thrd_yield F
GLIBC_2.29 __fentry__ F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F
@@ -1998,6 +1998,14 @@ GLIBC_2.28 thrd_sleep F
GLIBC_2.28 thrd_yield F
GLIBC_2.29 __nldbl_argp_error F
GLIBC_2.29 __nldbl_argp_failure F
+GLIBC_2.29 __nldbl_err F
+GLIBC_2.29 __nldbl_errx F
+GLIBC_2.29 __nldbl_verr F
+GLIBC_2.29 __nldbl_verrx F
+GLIBC_2.29 __nldbl_vwarn F
+GLIBC_2.29 __nldbl_vwarnx F
+GLIBC_2.29 __nldbl_warn F
+GLIBC_2.29 __nldbl_warnx F
GLIBC_2.29 getcpu F
GLIBC_2.29 posix_spawn_file_actions_addchdir_np F
GLIBC_2.29 posix_spawn_file_actions_addfchdir_np F