summaryrefslogtreecommitdiff
path: root/src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c
index 210b2bc..dbdb234 100644
--- a/src/string.c
+++ b/src/string.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <errno.h>
#include <stddef.h>
#include <string.h>
@@ -141,3 +142,26 @@ strncmp(const char *s1, const char *s2, size_t n)
return (int)c1 - (int)c2;
}
+
+char *
+strerror(int errnum)
+{
+ switch (errnum) {
+ case 0:
+ return "success";
+ case EINVAL:
+ return "invalid argument";
+ case EAGAIN:
+ return "resource temporarily unavailable";
+ case ENOMEM:
+ return "not enough space";
+ case EIO:
+ return "input/output error";
+ case EBUSY:
+ return "resource busy";
+ case EEXIST:
+ return "entry exist";
+ default:
+ return "unknown error";
+ }
+}