9
0
Fork 0

svn_rev_181

add perror function (which does not do much yet)
This commit is contained in:
Sascha Hauer 2007-07-05 18:01:30 +02:00 committed by Sascha Hauer
parent d8c247e00d
commit f9a07ee39b
2 changed files with 14 additions and 2 deletions

View File

@ -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);
}

6
include/errno.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef __ERRNO_H
#define __ERRNO_H
void perror(const char *s, int errno);
#endif /* __ERRNO_H */