| 1 |
/* strerror-override.h --- POSIX compatible system error routine |
| 2 |
|
| 3 |
Copyright (C) 2010-2023 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
This file is free software: you can redistribute it and/or modify |
| 6 |
it under the terms of the GNU Lesser General Public License as |
| 7 |
published by the Free Software Foundation; either version 2.1 of the |
| 8 |
License, or (at your option) any later version. |
| 9 |
|
| 10 |
This file 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 |
| 13 |
GNU Lesser General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU Lesser General Public License |
| 16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
| 17 |
|
| 18 |
#ifndef _GL_STRERROR_OVERRIDE_H |
| 19 |
# define _GL_STRERROR_OVERRIDE_H |
| 20 |
|
| 21 |
/* This file uses _GL_ATTRIBUTE_CONST. */ |
| 22 |
# if !_GL_CONFIG_H_INCLUDED |
| 23 |
# error "Please include config.h first." |
| 24 |
# endif |
| 25 |
|
| 26 |
# include <errno.h> |
| 27 |
# include <stddef.h> |
| 28 |
|
| 29 |
/* Reasonable buffer size that should never trigger ERANGE; if this |
| 30 |
proves too small, we intentionally abort(), to remind us to fix |
| 31 |
this value. */ |
| 32 |
# define STACKBUF_LEN 256 |
| 33 |
|
| 34 |
/* If ERRNUM maps to an errno value defined by gnulib, return a string |
| 35 |
describing the error. Otherwise return NULL. */ |
| 36 |
# if REPLACE_STRERROR_0 \ |
| 37 |
|| GNULIB_defined_ESOCK \ |
| 38 |
|| GNULIB_defined_ESTREAMS \ |
| 39 |
|| GNULIB_defined_EWINSOCK \ |
| 40 |
|| GNULIB_defined_ENOMSG \ |
| 41 |
|| GNULIB_defined_EIDRM \ |
| 42 |
|| GNULIB_defined_ENOLINK \ |
| 43 |
|| GNULIB_defined_EPROTO \ |
| 44 |
|| GNULIB_defined_EMULTIHOP \ |
| 45 |
|| GNULIB_defined_EBADMSG \ |
| 46 |
|| GNULIB_defined_EOVERFLOW \ |
| 47 |
|| GNULIB_defined_ENOTSUP \ |
| 48 |
|| GNULIB_defined_ENETRESET \ |
| 49 |
|| GNULIB_defined_ECONNABORTED \ |
| 50 |
|| GNULIB_defined_ESTALE \ |
| 51 |
|| GNULIB_defined_EDQUOT \ |
| 52 |
|| GNULIB_defined_ECANCELED \ |
| 53 |
|| GNULIB_defined_EOWNERDEAD \ |
| 54 |
|| GNULIB_defined_ENOTRECOVERABLE \ |
| 55 |
|| GNULIB_defined_EILSEQ |
| 56 |
extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST; |
| 57 |
# else |
| 58 |
# define strerror_override(ignored) NULL |
| 59 |
# define GNULIB_defined_strerror_override_macro 1 |
| 60 |
# endif |
| 61 |
|
| 62 |
#endif /* _GL_STRERROR_OVERRIDE_H */ |