]> git.sur5r.net Git - u-boot/commitdiff
Add basic errno support.
authorWolfgang Denk <wd@denx.de>
Fri, 11 Jun 2010 22:19:46 +0000 (00:19 +0200)
committerWolfgang Denk <wd@denx.de>
Sun, 19 Sep 2010 17:29:47 +0000 (19:29 +0200)
Needed for hash table support; probably useful in a lot of other
places as well.

Signed-off-by: Wolfgang Denk <wd@denx.de>
include/errno.h [new file with mode: 0644]
lib/Makefile
lib/errno.c [new file with mode: 0644]

diff --git a/include/errno.h b/include/errno.h
new file mode 100644 (file)
index 0000000..e24a33b
--- /dev/null
@@ -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 */
index c45f07ca125be1de78117b3e5a235e67be6208b3..c26536d0b312ccc56fa895809cd277e706b52cb3 100644 (file)
@@ -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 (file)
index 0000000..8330a8f
--- /dev/null
@@ -0,0 +1 @@
+int errno = 0;