]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/string/: strerrno(): Add macro
authorAlejandro Colomar <alx@kernel.org>
Tue, 22 Jul 2025 20:14:08 +0000 (22:14 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 4 Nov 2025 09:11:16 +0000 (10:11 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/string/strerrno.c [new file with mode: 0644]
lib/string/strerrno.h [new file with mode: 0644]

index b6420e3dcd93c07329764d3eac49298cbfca0c0d..60c4948d80067b7504195b190b78ab4713a7d449 100644 (file)
@@ -247,6 +247,8 @@ libshadow_la_SOURCES = \
        string/strdup/strndupa.h \
        string/strdup/strndup.c \
        string/strdup/strndup.h \
+       string/strerrno.c \
+       string/strerrno.h \
        string/strftime.c \
        string/strftime.h \
        string/strspn/stpspn.c \
diff --git a/lib/string/strerrno.c b/lib/string/strerrno.c
new file mode 100644 (file)
index 0000000..d7e817c
--- /dev/null
@@ -0,0 +1,7 @@
+// SPDX-FileCopyrightText: 2025, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#include "config.h"
+
+#include "string/strerrno.h"
diff --git a/lib/string/strerrno.h b/lib/string/strerrno.h
new file mode 100644 (file)
index 0000000..b82e101
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-FileCopyrightText: 2025, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_STRING_STRERRNO_H_
+#define SHADOW_INCLUDE_LIB_STRING_STRERRNO_H_
+
+
+#include "config.h"
+
+#include <errno.h>
+#include <string.h>
+
+
+// strerrno - string errno
+#define strerrno()  ((const char *){strerror(errno)})
+
+
+#endif  // include guard