[PATCH] update to klibc version 0.101, fixing the stdin bug.

This commit is contained in:
greg@kroah.com 2004-01-28 18:35:47 -08:00 committed by Greg KH
parent 35b7d88c0d
commit 273636ca8b
8 changed files with 58 additions and 26 deletions

View File

@ -24,7 +24,7 @@ LIBOBJS = vsnprintf.o snprintf.o vsprintf.o sprintf.o \
sleep.o usleep.o raise.o abort.o assert.o alarm.o pause.o \
__signal.o signal.o bsd_signal.o siglist.o siglongjmp.o \
sigaction.o sigpending.o sigprocmask.o sigsuspend.o \
brk.o sbrk.o malloc.o realloc.o calloc.o mmap.o \
brk.o sbrk.o malloc.o realloc.o calloc.o mmap.o getpagesize.o \
memcpy.o memcmp.o memset.o memccpy.o memmem.o memswap.o \
memmove.o \
strcasecmp.o strncasecmp.o strndup.o strerror.o \
@ -118,12 +118,12 @@ socketcalls.dir: SOCKETCALLS socketcalls.pl socketcommon.h
touch $@
%/static.obj: %.dir
$(MAKE) objects-$(basename $(notdir $@)) DIR=$*
$(MAKE) objects-$(basename $(notdir $@)) DIR=$*/
STATIC = $(addsuffix .o,$(basename $(wildcard $(DIR)/*.[cS])))
STATIC = $(addsuffix .o,$(basename $(wildcard $(DIR)*.[cS])))
objects-static: $(STATIC)
touch $(DIR)/static.obj
touch $(DIR)static.obj
clean: archclean
find . -type f -a \( -name \*.[isoa] -o -name \*.l[iso] \) -print0 | xargs -0rt rm -f
@ -140,6 +140,6 @@ spotless: clean
bitsize:
@echo $(BITSIZE)
ifneq ($(wildcard $(DIR)/.*.d),)
include $(wildcard $(DIR)/.*.d)
ifneq ($(wildcard $(DIR).*.d),)
include $(wildcard $(DIR).*.d)
endif

View File

@ -36,18 +36,24 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
__asm__ __volatile__ \
("sc \n\t" \
"mfcr %1 " \
: "=&r" (__sc_3), "=&r" (__sc_0) \
: "0" (__sc_3), "1" (__sc_0), \
"r" (__sc_4), \
"r" (__sc_5), \
"r" (__sc_6), \
"r" (__sc_7), \
"r" (__sc_8) \
: __syscall_clobbers); \
: "+r" (__sc_3), \
"+r" (__sc_0), \
"+r" (__sc_4), \
"+r" (__sc_5), \
"+r" (__sc_6), \
"+r" (__sc_7), \
"+r" (__sc_8) \
: : "cr0", "ctr", "memory", \
"r9", "r10", "r11", "r12"); \
__sc_ret = __sc_3; \
__sc_err = __sc_0; \
} \
__syscall_return (type); \
if (__sc_err & 0x10000000) \
{ \
errno = (int)__sc_ret; \
__sc_ret = -1; \
} \
return (type)__sc_ret; \
}
#endif /* _syscall6() missing */

26
klibc/klibc/getpagesize.c Normal file
View File

@ -0,0 +1,26 @@
/*
* getpagesize.c
*/
#include <sys/syscall.h>
#include <asm/page.h>
/* Presumably there is a better way to do this... */
#ifdef __ia64__
# define __NR_getpagesize 1171
#endif
#ifdef __NR_getpagesize
_syscall0(int,getpagesize);
#else
int getpagesize(void)
{
return PAGE_SIZE;
}
#endif

View File

@ -15,10 +15,6 @@
struct _IO_file;
typedef struct _IO_file FILE;
#define stdin ((FILE *)0)
#define stdout ((FILE *)1)
#define stderr ((FILE *)2)
#ifndef EOF
# define EOF (-1)
#endif
@ -44,10 +40,12 @@ static __inline__ int fileno(FILE *__f)
return (int)(size_t)__f - 1;
}
static __inline__ FILE * __create_file(int __fd)
{
return (FILE *)(size_t)(__fd + 1);
}
/* This is a macro so it can be used as initializer */
#define __create_file(__fd) ((FILE *)(size_t)((__fd) + 1))
#define stdin __create_file(0)
#define stdout __create_file(1)
#define stderr __create_file(2)
__extern FILE *fopen(const char *, const char *);

View File

@ -105,6 +105,8 @@ __extern int optind, opterr, optopt;
__extern int isatty(int);
__extern int getpagesize(void);
/* Standard file descriptor numbers. */
#define STDIN_FILENO 0
#define STDOUT_FILENO 1

View File

@ -19,7 +19,7 @@
* Prefer mmap2() over mmap(), except on the architectures listed
*/
#if defined(__NR_mmap2) && !defined(__sparc__) && !defined(__ia64__) && !defined(__powerpc64__)
#if defined(__NR_mmap2) && !defined(__sparc__) && !defined(__ia64__) && !defined(__powerpc__) && !defined(__powerpc64__)
/* This architecture uses mmap2() */

View File

@ -28,5 +28,5 @@
#include <unistd.h>
#ifdef __i386__
#include <sys/vm86.h>
# include <sys/vm86.h>
#endif

View File

@ -1 +1 @@
0.98
0.101