musl: introduce GNU specific version of strerror_r()

musl provides XSI compliant strerror_r(), and it is slightly different
from the one by glibc.
Let's introduce a tiny wrapper to convert XSI strerror_r() to GNU one.

The wrapper also patches musl's spurious catchall error message.
This commit is contained in:
Yu Watanabe
2025-11-15 03:37:30 +09:00
parent b8ef90d6fd
commit ebb422dd2b
3 changed files with 52 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include_next <string.h>
char* strerror_r_gnu(int errnum, char *buf, size_t buflen);
#define strerror_r strerror_r_gnu