From: Wolfgang Denk <wd@denx.de>
Date: Fri, 11 Jun 2010 22:19:46 +0000 (+0200)
Subject: Add basic errno support.
X-Git-Tag: v2025.01-rc5-pxa1908~20078^2~73
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/index.html?a=commitdiff_plain;h=65cd3fa81ff48cd44bcb3d9baf646dade15b9131;p=u-boot.git

Add basic errno support.

Needed for hash table support; probably useful in a lot of other
places as well.

Signed-off-by: Wolfgang Denk <wd@denx.de>
---

diff --git a/include/errno.h b/include/errno.h
new file mode 100644
index 0000000000..e24a33b386
--- /dev/null
+++ b/include/errno.h
@@ -0,0 +1,9 @@
+#ifndef _ERRNO_H
+
+#include <asm-generic/errno.h>
+
+extern int errno;
+
+#define __set_errno(val) do { errno = val; } while (0)
+
+#endif /* _ERRNO_H */
diff --git a/lib/Makefile b/lib/Makefile
index c45f07ca12..c26536d0b3 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -37,6 +37,7 @@ COBJS-y += crc32.o
 COBJS-y += ctype.o
 COBJS-y += display_options.o
 COBJS-y += div64.o
+COBJS-y += errno.o
 COBJS-$(CONFIG_GZIP) += gunzip.o
 COBJS-$(CONFIG_LMB) += lmb.o
 COBJS-y += ldiv.o
diff --git a/lib/errno.c b/lib/errno.c
new file mode 100644
index 0000000000..8330a8fd14
--- /dev/null
+++ b/lib/errno.c
@@ -0,0 +1 @@
+int errno = 0;