shithub: npe

Download patch

ref: cb6ef851fe81ecd9a64ec529b5236e2bb606a745
parent: 2782eb13587665c4973ac573f14d443efdfd42f6
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Apr 30 07:55:18 EDT 2021

add strerror

--- a/include/npe/string.h
+++ b/include/npe/string.h
@@ -1,1 +1,8 @@
+#ifndef _npe_string_h_
+#define _npe_string_h_
+
 #include <npe.h>
+
+char *strerror(int);
+
+#endif
--- a/libnpe/mkfile
+++ b/libnpe/mkfile
@@ -34,6 +34,7 @@
 	round.$O\
 	sigaction.$O\
 	stat.$O\
+	strerror.$O\
 	strftime.$O\
 	trunc.$O\
 	usleep.$O\
--- /dev/null
+++ b/libnpe/strerror.c
@@ -1,0 +1,12 @@
+#include "string.h"
+#include "errno.h"
+
+char *
+strerror(int e)
+{
+	switch(e){
+	case ENOENT: return "ENOENT";
+	}
+
+	return "???";
+}