1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2009 Index Data
3 * See the file LICENSE for details.
8 * \brief errno utilities
14 /* prepare for threads.. even in non-threaded appliactions.
15 The yaz_errno/yaz_set_errno is part of core YAZ and shared */
35 void yaz_set_errno(int v)
40 void yaz_strerror(char *buf, int max)
51 FORMAT_MESSAGE_FROM_SYSTEM,
54 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default lang */
65 strerror_r(errno, buf, max);
66 /* if buffer is unset - use strerror anyway (GLIBC bug) */
68 strcpy(buf, strerror(yaz_errno()));
70 strcpy(buf, strerror(yaz_errno()));
74 if ((cp = strrchr(buf, '\n')))
76 if ((cp = strrchr(buf, '\r')))
82 * c-file-style: "Stroustrup"
83 * indent-tabs-mode: nil
85 * vim: shiftwidth=4 tabstop=8 expandtab