From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Sat, 17 Jul 2010 21:45:44 +0200 Subject: [U-Boot] [PATCH 1/5] Add basic errno support. In-Reply-To: <1279395948-25864-1-git-send-email-wd@denx.de> References: <1279395948-25864-1-git-send-email-wd@denx.de> Message-ID: <1279395948-25864-2-git-send-email-wd@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Needed for hash table support; probably useful in a lot of other places as well. Signed-off-by: Wolfgang Denk --- include/errno.h | 9 +++++++++ lib/Makefile | 1 + lib/errno.c | 1 + 3 files changed, 11 insertions(+), 0 deletions(-) create mode 100644 include/errno.h create mode 100644 lib/errno.c diff --git a/include/errno.h b/include/errno.h new file mode 100644 index 0000000..e24a33b --- /dev/null +++ b/include/errno.h @@ -0,0 +1,9 @@ +#ifndef _ERRNO_H + +#include + +extern int errno; + +#define __set_errno(val) do { errno = val; } while (0) + +#endif /* _ERRNO_H */ diff --git a/lib/Makefile b/lib/Makefile index c45f07c..c26536d 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 0000000..8330a8f --- /dev/null +++ b/lib/errno.c @@ -0,0 +1 @@ +int errno = 0; -- 1.7.1.1