From f9a07ee39b8c3a16ba5a3ed1d34d419f38b34eda Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 5 Jul 2007 18:01:30 +0200 Subject: svn_rev_181 add perror function (which does not do much yet) --- common/misc.c | 10 ++++++++-- include/errno.h | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 include/errno.h diff --git a/common/misc.c b/common/misc.c index 8133e687b0..0d193664c0 100644 --- a/common/misc.c +++ b/common/misc.c @@ -23,10 +23,16 @@ void *sbrk (ptrdiff_t increment) ulong old = mem_malloc_brk; ulong new = old + increment; - if ((new < mem_malloc_start) || (new > mem_malloc_end)) { - return (NULL); + if ((new < mem_malloc_start) || (new > mem_malloc_end)) { + return (NULL); } mem_malloc_brk = new; return ((void *) old); } + +void perror(char *s, int errno) +{ + printf("%s failed with %d\n", s, errno); +} + diff --git a/include/errno.h b/include/errno.h new file mode 100644 index 0000000000..aee5c78fff --- /dev/null +++ b/include/errno.h @@ -0,0 +1,6 @@ +#ifndef __ERRNO_H +#define __ERRNO_H + +void perror(const char *s, int errno); + +#endif /* __ERRNO_H */ -- cgit v1.2.3