1 /* 4.4BSD utility functions for error messages.
2 Copyright (C) 1995-2023 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
27 #define flockfile(s) _IO_flockfile (s)
28 #define funlockfile(s) _IO_funlockfile (s)
30 extern char *__progname
;
35 va_start (ap, format); \
41 __vwarnx_internal (const char *format
, __gnuc_va_list ap
,
42 unsigned int mode_flags
)
45 __fxprintf (stderr
, "%s: ", __progname
);
47 __vfxprintf (stderr
, format
, ap
, mode_flags
);
48 __fxprintf (stderr
, "\n");
53 __vwarn_internal (const char *format
, __gnuc_va_list ap
,
54 unsigned int mode_flags
)
61 __fxprintf (stderr
, "%s: ", __progname
);
62 __vfxprintf (stderr
, format
, ap
, mode_flags
);
64 __fxprintf (stderr
, ": %m\n");
69 __fxprintf (stderr
, "%s: %m\n", __progname
);
75 vwarn (const char *format
, __gnuc_va_list ap
)
77 __vwarn_internal (format
, ap
, 0);
79 libc_hidden_def (vwarn
)
82 vwarnx (const char *format
, __gnuc_va_list ap
)
84 __vwarnx_internal (format
, ap
, 0);
86 libc_hidden_def (vwarnx
)
89 warn (const char *format
, ...)
91 VA (vwarn (format
, ap
))
93 libc_hidden_def (warn
)
96 warnx (const char *format
, ...)
98 VA (vwarnx (format
, ap
))
100 libc_hidden_def (warnx
)
103 verr (int status
, const char *format
, __gnuc_va_list ap
)
108 libc_hidden_def (verr
)
111 verrx (int status
, const char *format
, __gnuc_va_list ap
)
116 libc_hidden_def (verrx
)
119 err (int status
, const char *format
, ...)
121 VA (verr (status
, format
, ap
))
125 errx (int status
, const char *format
, ...)
127 VA (verrx (status
, format
, ap
))