diff options
Diffstat (limited to 'libc')
28 files changed, 94 insertions, 223 deletions
diff --git a/libc/Makefile.in b/libc/Makefile.in index 50201d4fd..f65121c00 100644 --- a/libc/Makefile.in +++ b/libc/Makefile.in @@ -45,7 +45,7 @@ lib-a-y += $(top_builddir)lib/libc.a crt-y lib-so-y += libc-y $(top_builddir)lib/$(NONSHARED_LIBNAME) crt-y objclean-y += libc_clean -$(top_builddir)lib/libc.so: $(libc_OUT)/libc_so.a pre-y +$(top_builddir)lib/libc.so: $(libc_OUT)/libc_so.a $(top_builddir)include/headers_done $(interp) $(call link.so,$(libc_FULL_NAME),$(MAJOR_VERSION)) $(Q)$(RM) $@ $(Q)echo "/* GNU ld script" > $@ diff --git a/libc/misc/internals/Makefile.in b/libc/misc/internals/Makefile.in index bfae764e4..8863aba7b 100644 --- a/libc/misc/internals/Makefile.in +++ b/libc/misc/internals/Makefile.in @@ -16,7 +16,7 @@ MISC_INTERNALS_OUT:=$(top_builddir)libc/misc/internals MISC_INTERNALS_SRC:=$(patsubst %.c,$(MISC_INTERNALS_DIR)/%.c,$(CSRC)) MISC_INTERNALS_OBJ:=$(patsubst %.c,$(MISC_INTERNALS_OUT)/%.o,$(CSRC)) -$(MISC_INTERNALS_OUT)/interp.c: headers_root +$(MISC_INTERNALS_OUT)/interp.c: $(top_builddir)include/headers_done $(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@ $(Q)echo "#include <features.h>" >> $@ $(Q)echo "#ifdef __HAVE_ELF__" >> $@ diff --git a/libc/stdio/Makefile.in b/libc/stdio/Makefile.in index a928e0872..dfdf4ff14 100644 --- a/libc/stdio/Makefile.in +++ b/libc/stdio/Makefile.in @@ -7,10 +7,9 @@ # Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details. # -# Note: The *64.o objects are empty when compiled without large file support. - # SUSv3 functions -CSRC:= fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \ +CSRC := \ + fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \ fseeko.c fsetpos.c ftello.c getdelim.c getline.c gets.c getw.c \ perror.c puts.c putw.c remove.c rewind.c setbuf.c setbuffer.c \ setlinebuf.c setvbuf.c ungetc.c \ @@ -18,102 +17,102 @@ CSRC:= fclose.c fcloseall.c fdopen.c fgetpos.c fopen.c freopen.c \ asprintf.c sprintf.c vasprintf.c vdprintf.c vsnprintf.c \ tmpfile.c tmpnam.c tmpnam_r.c popen.c tempnam.c ctermid.c +# Note: The *64.o objects are empty when compiled without large file support +CSRC += fgetpos64.c fopen64.c freopen64.c fseeko64.c fsetpos64.c ftello64.c + # getc -> alias for fgetc # putc -> alias for fputc # rename is a syscall # Implementation support functions -CSRC+= _READ.c _WRITE.c _adjust_pos.c _fopen.c _fwrite.c \ +CSRC += \ + _READ.c _WRITE.c _adjust_pos.c _fopen.c _fwrite.c \ _rfill.c _stdio.c _trans2r.c _trans2w.c _wcommit.c \ _cs_funcs.c _load_inttype.c _store_inttype.c _uintmaxtostr.c ifeq ($(UCLIBC_HAS_FLOATS),y) -CSRC+=_fpmaxtostr.c +CSRC += _fpmaxtostr.c endif # stdio_ext.h functions -CSRC+= __fbufsize.c __flbf.c __fpending.c __fpurge.c __freadable.c \ +CSRC += \ + __fbufsize.c __flbf.c __fpending.c __fpurge.c __freadable.c \ __freading.c __fsetlocking.c __fwritable.c __fwriting.c _flushlbf.c # Other glibc extensions ifeq ($(UCLIBC_HAS_GLIBC_CUSTOM_STREAMS),y) -CSRC+=fopencookie.c fmemopen.c open_memstream.c +CSRC += fopencookie.c fmemopen.c open_memstream.c endif # pthread functions -CSRC+=flockfile.c ftrylockfile.c funlockfile.c +CSRC += flockfile.c ftrylockfile.c funlockfile.c # Functions with unlocked versions -CUSRC:= clearerr.c feof.c ferror.c fflush.c fgetc.c fgets.c fileno.c \ +CUSRC := \ + clearerr.c feof.c ferror.c fflush.c fgetc.c fgets.c fileno.c \ fputc.c fputs.c fread.c fwrite.c getchar.c putchar.c # getc_unlocked -> alias for fgetc_unlocked # putc_unlocked -> alias for fputc_unlocked -# Largefile functions (%64.o) -CLSRC:= -ifeq ($(UCLIBC_HAS_LFS),y) -CLSRC:=fgetpos.c fopen.c freopen.c fseeko.c fsetpos.c ftello.c # tmpfile -endif - # vfprintf and support functions -MSRC1:=vfprintf.c +MSRC1 := vfprintf.c ifneq ($(USE_OLD_VFPRINTF),y) -MOBJ1:= vfprintf.o \ +MOBJ1 := \ + vfprintf.o \ _ppfs_init.o _ppfs_prepargs.o _ppfs_setargs.o _ppfs_parsespec.o \ register_printf_function.o parse_printf_format.o else -MOBJ1:= -CSRC+=old_vfprintf.c +MOBJ1 := +CSRC += old_vfprintf.c endif # vfscanf and support functions plus other *scanf funcs -MSRC2:=scanf.c -MOBJ2:= vfscanf.o __scan_cookie.o __psfs_parse_spec.o __psfs_do_numeric.o \ +MSRC2 := scanf.c +MOBJ2 := \ + vfscanf.o __scan_cookie.o __psfs_parse_spec.o __psfs_do_numeric.o \ scanf.o sscanf.o fscanf.o vscanf.o vsscanf.o -CWSRC:= +CWSRC := ifeq ($(UCLIBC_HAS_WCHAR),y) -CWSRC+=_wfwrite.c fwprintf.c swprintf.c vswprintf.c vwprintf.c wprintf.c \ +CWSRC += _wfwrite.c fwprintf.c swprintf.c vswprintf.c vwprintf.c wprintf.c \ fwide.c ungetwc.c -CUSRC+=fgetwc.c getwchar.c fgetws.c fputwc.c putwchar.c fputws.c +CUSRC += fgetwc.c getwchar.c fgetws.c fputwc.c putwchar.c fputws.c # getwc (fgetwc alias) getwc_unlocked (fgetwc_unlocked alias) # putwc (fputwc alias) putwc_unlocked (fputwc_unlocked alias) -MOBJ1+=vfwprintf.o -MOBJ2+=wscanf.o swscanf.o fwscanf.o vwscanf.o vswscanf.o vfwscanf.o +MOBJ1 += vfwprintf.o +MOBJ2 += wscanf.o swscanf.o fwscanf.o vwscanf.o vswscanf.o vfwscanf.o endif -CSRC+=$(CUSRC) $(CWSRC) +CSRC += $(CUSRC) $(CWSRC) ifneq ($(DOMULTI),n) -STDIO_CSRC_NO_MULTI:=fwrite.c fputc.c fputs.c fprintf.c _fpmaxtostr.c -CSRC:=$(filter-out $(STDIO_CSRC_NO_MULTI),$(CSRC)) +STDIO_CSRC_NO_MULTI := fwrite.c fputc.c fputs.c fprintf.c _fpmaxtostr.c +CSRC := $(filter-out $(STDIO_CSRC_NO_MULTI),$(CSRC)) endif -STDIO_MOBJ1_NO_MULTI:=vfprintf.o vfwprintf.o register_printf_function.o -STDIO_MOBJ2_NO_MULTI:=vfscanf.o vfwscanf.o fscanf.o -STDIO_MOBJ_NO_MULTI:=$(STDIO_MOBJ1_NO_MULTI) $(STDIO_MOBJ2_NO_MULTI) +STDIO_MOBJ1_NO_MULTI := vfprintf.o vfwprintf.o register_printf_function.o +STDIO_MOBJ2_NO_MULTI := vfscanf.o vfwscanf.o fscanf.o +STDIO_MOBJ_NO_MULTI := $(STDIO_MOBJ1_NO_MULTI) $(STDIO_MOBJ2_NO_MULTI) -STDIO_DIR:=$(top_srcdir)libc/stdio -STDIO_OUT:=$(top_builddir)libc/stdio +STDIO_DIR := $(top_srcdir)libc/stdio +STDIO_OUT := $(top_builddir)libc/stdio -STDIO_SRC:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(CSRC)) -STDIO_OBJ:=$(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC)) -STDIO_CUSRC:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(CUSRC)) -STDIO_CUOBJ:=$(patsubst %.c,$(STDIO_OUT)/%_unlocked.o,$(CUSRC)) -STDIO_CLSRC:=$(patsubst %.c,$(STDIO_OUT)/%64.c,$(CLSRC)) -STDIO_CLOBJ:=$(patsubst %.c,$(STDIO_OUT)/%64.o,$(CLSRC)) +STDIO_SRC := $(patsubst %.c,$(STDIO_DIR)/%.c,$(CSRC)) +STDIO_OBJ := $(patsubst %.c,$(STDIO_OUT)/%.o,$(CSRC)) +STDIO_CUSRC := $(patsubst %.c,$(STDIO_DIR)/%.c,$(CUSRC)) +STDIO_CUOBJ := $(patsubst %.c,$(STDIO_OUT)/%_unlocked.o,$(CUSRC)) -STDIO_MSRC1:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC1)) -STDIO_MSRC2:=$(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC2)) -STDIO_MOBJ1:=$(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ1)) -STDIO_MOBJ2:=$(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ2)) +STDIO_MSRC1 := $(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC1)) +STDIO_MSRC2 := $(patsubst %.c,$(STDIO_DIR)/%.c,$(MSRC2)) +STDIO_MOBJ1 := $(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ1)) +STDIO_MOBJ2 := $(patsubst %.o,$(STDIO_OUT)/%.o,$(MOBJ2)) -STDIO_MSRC:=$(STDIO_MSRC1) $(STDIO_MSRC2) -STDIO_MOBJ:=$(STDIO_MOBJ1) $(STDIO_MOBJ2) +STDIO_MSRC := $(STDIO_MSRC1) $(STDIO_MSRC2) +STDIO_MOBJ := $(STDIO_MOBJ1) $(STDIO_MOBJ2) -STDIO_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(filter-out $(STDIO_MOBJ_NO_MULTI),$(notdir $(STDIO_MOBJ))))) +STDIO_DEF := $(patsubst %,-DL_%,$(subst .o,,$(filter-out $(STDIO_MOBJ_NO_MULTI),$(notdir $(STDIO_MOBJ))))) -STDIO_OBJS:=$(STDIO_OBJ) $(STDIO_MOBJ) $(STDIO_CUOBJ) $(STDIO_CLOBJ) +STDIO_OBJS := $(STDIO_OBJ) $(STDIO_MOBJ) $(STDIO_CUOBJ) $(STDIO_CLOBJ) -STDIO_NO_MULTI:=$(STDIO_CUOBJ) $(STDIO_CLOBJ) +STDIO_NO_MULTI := $(STDIO_CUOBJ) $(STDIO_CLOBJ) # these need special handling or rewrite to support multi-build # CUOBJ @@ -123,16 +122,6 @@ STDIO_NO_MULTI:=$(STDIO_CUOBJ) $(STDIO_CLOBJ) %_unlocked.os: %.c $(compile.c) -D__DO_UNLOCKED -# need this, else the other %64 files will get false rules -$(STDIO_CLSRC): $(STDIO_OUT)/%64.c : $(STDIO_DIR)/%.c - @cp $< $@ - -$(STDIO_CLOBJ): %.o : %.c - $(compile.c) -D__DO_LARGEFILE - -$(STDIO_CLOBJ:.o=.os): %.os : %.c - $(compile.c) -D__DO_LARGEFILE - $(STDIO_MOBJ1): $(STDIO_MSRC1) $(compile.m) @@ -157,4 +146,4 @@ libc-nomulti-y+=$(patsubst %.o,$(STDIO_OUT)/%.o,$(STDIO_MOBJ_NO_MULTI)) objclean-y+=stdio_objclean stdio_objclean: - $(RM) $(STDIO_OUT)/*.{o,os} $(STDIO_OUT)/*64.c + $(RM) $(STDIO_OUT)/*.{o,os} diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index 1ed349533..e900edac6 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -17,6 +17,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <features.h> #ifdef __UCLIBC_HAS_WCHAR__ #include <wchar.h> diff --git a/libc/stdio/fgetpos.c b/libc/stdio/fgetpos.c index 9c6c26297..84cf0b98c 100644 --- a/libc/stdio/fgetpos.c +++ b/libc/stdio/fgetpos.c @@ -7,16 +7,6 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define fgetpos fgetpos64 -# define fpos_t fpos64_t -# define ftell ftello64 -#endif - int fgetpos(FILE * __restrict stream, register fpos_t * __restrict pos) { #ifdef __STDIO_MBSTATE diff --git a/libc/stdio/fopen.c b/libc/stdio/fopen.c index 8303fa88c..244304acf 100644 --- a/libc/stdio/fopen.c +++ b/libc/stdio/fopen.c @@ -7,14 +7,7 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define fopen fopen64 -# define FILEDES_ARG (-2) -#else +#ifndef __DO_LARGEFILE # define FILEDES_ARG (-1) #endif diff --git a/libc/stdio/freopen.c b/libc/stdio/freopen.c index 0eccaac1f..7df035d48 100644 --- a/libc/stdio/freopen.c +++ b/libc/stdio/freopen.c @@ -7,14 +7,7 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define freopen freopen64 -# define FILEDES_ARG (-2) -#else +#ifndef __DO_LARGEFILE # define FILEDES_ARG (-1) #endif diff --git a/libc/stdio/fseeko.c b/libc/stdio/fseeko.c index 48979a06b..242292a43 100644 --- a/libc/stdio/fseeko.c +++ b/libc/stdio/fseeko.c @@ -11,22 +11,11 @@ # error Assumption violated -- values of SEEK_SET, SEEK_CUR, SEEK_END #endif -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define FSEEK __fseeko64 -# define OFFSET_TYPE __off64_t - -#else - +#ifndef __DO_LARGEFILE # define FSEEK fseek # define OFFSET_TYPE long int - #endif - int FSEEK(register FILE *stream, OFFSET_TYPE offset, int whence) { #if defined(__UCLIBC_HAS_LFS__) && !defined(__DO_LARGEFILE) diff --git a/libc/stdio/fsetpos.c b/libc/stdio/fsetpos.c index 44104b4df..2b02f25e0 100644 --- a/libc/stdio/fsetpos.c +++ b/libc/stdio/fsetpos.c @@ -7,16 +7,6 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define fsetpos fsetpos64 -# define fpos_t fpos64_t -# define fseek fseeko64 -#endif - int fsetpos(FILE *stream, register const fpos_t *pos) { #ifdef __STDIO_MBSTATE @@ -41,4 +31,3 @@ int fsetpos(FILE *stream, register const fpos_t *pos) #endif } - diff --git a/libc/stdio/ftello.c b/libc/stdio/ftello.c index 38517acbd..a28333efc 100644 --- a/libc/stdio/ftello.c +++ b/libc/stdio/ftello.c @@ -7,19 +7,9 @@ #include "_stdio.h" -#ifdef __DO_LARGEFILE -# ifndef __UCLIBC_HAS_LFS__ -# error large file support is not enabled! -# endif - -# define FTELL __ftello64 -# define OFFSET_TYPE __off64_t - -#else - +#ifndef __DO_LARGEFILE # define FTELL ftell # define OFFSET_TYPE long int - #endif OFFSET_TYPE FTELL(register FILE *stream) diff --git a/libc/sysdeps/linux/Makefile.arch b/libc/sysdeps/linux/Makefile.arch deleted file mode 100644 index 5feffe8d6..000000000 --- a/libc/sysdeps/linux/Makefile.arch +++ /dev/null @@ -1,44 +0,0 @@ -# Makefile template to be included by sysdeps/linux/<ARCH>/Makefile.arch -# -# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -ARCH_DIR := $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH) -ARCH_OUT := $(top_builddir)libc/sysdeps/linux/$(TARGET_ARCH) - -ARCH_CSRC := $(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC)) -ARCH_COBJ := $(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC)) -ARCH_SSRC := $(patsubst %.s,$(ARCH_DIR)/%.s,$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))) -ARCH_SOBJ := $(patsubst %.s,$(ARCH_OUT)/%.o,$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))) - -ARCH_OBJS := $(ARCH_COBJ) $(ARCH_SOBJ) - -crt-y := create -libc-a-y += $(ARCH_OBJS) -libc-so-y += $(ARCH_OBJS:.o=.os) -libc-multi-y += $(ARCH_CSRC) -libc-nomulti-y += $(ARCH_SOBJ) -objclean-y += arch_objclean - -arch_objclean: - $(RM) $(ARCH_OUT)/*.{o,os} $(CTOR_TARGETS) $(CRTS) - -ifneq ($(ARCH_HEADERS),) - -ARCH_HEADERS_IN := $(patsubst %,../libc/sysdeps/linux/$(TARGET_ARCH)/%,$(ARCH_HEADERS)) -ARCH_HEADERS_OUT := $(patsubst %,$(top_builddir)include/%,$(ARCH_HEADERS)) - -headers-y += arch_headers -arch_headers: - $(SECHO) $(LN) -fs $(ARCH_HEADERS) $(top_builddir)include/ - @for h in $(ARCH_HEADERS_IN) ; do \ - $(LN) -fs $$h $(top_builddir)include/ ; \ - done - -headers_clean-y += arch_headers_clean -arch_headers_clean: - $(RM) $(ARCH_HEADERS_OUT) - -endif diff --git a/libc/sysdeps/linux/alpha/Makefile.arch b/libc/sysdeps/linux/alpha/Makefile.arch index aafb4a826..91636c71a 100644 --- a/libc/sysdeps/linux/alpha/Makefile.arch +++ b/libc/sysdeps/linux/alpha/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S brk.S bsd-_setjmp.S bsd-setjmp.S clone.S \ divl.S divq.S reml.S remq.S setjmp.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/arm/Makefile.arch b/libc/sysdeps/linux/arm/Makefile.arch index c6edc12a1..1ed4b6a6e 100644 --- a/libc/sysdeps/linux/arm/Makefile.arch +++ b/libc/sysdeps/linux/arm/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ bsd-_setjmp.S sigrestorer.S mmap64.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/common/bits/kernel_sigaction.h b/libc/sysdeps/linux/common/bits/kernel_sigaction.h index 6eaf61f1d..5baf1e224 100644 --- a/libc/sysdeps/linux/common/bits/kernel_sigaction.h +++ b/libc/sysdeps/linux/common/bits/kernel_sigaction.h @@ -4,36 +4,9 @@ /* This file provides whatever this particular arch's kernel thinks * the sigaction struct should look like... */ -#if defined(__alpha__) -#undef HAVE_SA_RESTORER -/* This is the sigaction struction from the Linux 2.1.20 kernel. */ -struct old_kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_mask; - unsigned int sa_flags; -}; -/* This is the sigaction structure from the Linux 2.1.68 kernel. */ -struct kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned int sa_flags; - sigset_t sa_mask; -}; -#elif defined(__hppa__) -#undef HAVE_SA_RESTORER -/* This is the sigaction struction from the Linux 2.1.20 kernel. */ -/* Blah. This is bogus. We don't ever use it. */ -struct old_kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_mask; - unsigned long sa_flags; -}; -/* This is the sigaction structure from the Linux 2.1.68 kernel. */ -struct kernel_sigaction { - __sighandler_t k_sa_handler; - unsigned long sa_flags; - sigset_t sa_mask; -}; -#elif defined(__mips__) +#undef NO_OLD_SIGACTION + +#if defined(__mips__) #undef HAVE_SA_RESTORER /* This is the sigaction structure from the Linux 2.1.24 kernel. */ #include <sgidefs.h> @@ -58,6 +31,14 @@ struct kernel_sigaction { void (*sa_restorer)(void); int s_resv[1]; /* reserved */ }; +#elif defined(__ia64__) +#define NO_OLD_SIGACTION +#undef HAVE_SA_RESTORER +struct kernel_sigaction { + __sighandler_t k_sa_handler; + unsigned long sa_flags; + sigset_t sa_mask; +}; #else #define HAVE_SA_RESTORER /* This is the sigaction structure from the Linux 2.1.20 kernel. */ @@ -76,8 +57,10 @@ struct kernel_sigaction { }; #endif +#ifndef NO_OLD_SIGACTION extern int __syscall_sigaction (int, const struct old_kernel_sigaction *__unbounded, struct old_kernel_sigaction *__unbounded); +#endif extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded, struct kernel_sigaction *__unbounded, size_t); diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c index e37f8e804..0c8f50999 100644 --- a/libc/sysdeps/linux/common/create_module.c +++ b/libc/sysdeps/linux/common/create_module.c @@ -27,19 +27,17 @@ #include <sys/syscall.h> -//#define __NR_create_module 127 - #ifdef __NR_create_module #if defined(__i386__) || defined(__m68k__) || defined(__arm__) || defined(__thumb__) || defined(__cris__) || defined(__i960__) -#define __NR___create_module __NR_create_module -#ifdef __STR_NR_create_module -#define __STR_NR___create_module __STR_NR_create_module -#endif +# define __NR___create_module __NR_create_module +# ifdef __STR_NR_create_module +# define __STR_NR___create_module __STR_NR_create_module +# endif _syscall2(long, __create_module, const char *, name, size_t, size); /* By checking the value of errno, we know if we have been fooled * by the syscall2 macro making a very high address look like a - * negaitive, so we we fix it up here. */ + * negative, so we we fix it up here. */ unsigned long create_module(const char *name, size_t size) { long ret = __create_module(name, size); @@ -52,7 +50,7 @@ unsigned long create_module(const char *name, size_t size) return ret; } #elif defined(__alpha__) -#define __NR___create_module __NR_create_module +# define __NR___create_module __NR_create_module /* Alpha doesn't have the same problem, exactly, but a bug in older kernels fails to clear the error flag. Clear it here explicitly. */ _syscall4(unsigned long, __create_module, const char *, name, @@ -66,11 +64,10 @@ unsigned long create_module(const char *name, size_t size) _syscall2(unsigned long, create_module, const char *, name, size_t, size); #endif -#else -unsigned long create_module(const char *name, size_t size) +#else /* !__NR_create_module */ +caddr_t create_module(const char *name, size_t size) { __set_errno(ENOSYS); - return (unsigned long)-1; + return (caddr_t)-1; } #endif - diff --git a/libc/sysdeps/linux/common/get_kernel_syms.c b/libc/sysdeps/linux/common/get_kernel_syms.c index ae19cd2c7..92a105ebd 100644 --- a/libc/sysdeps/linux/common/get_kernel_syms.c +++ b/libc/sysdeps/linux/common/get_kernel_syms.c @@ -9,13 +9,13 @@ #include "syscalls.h" -#ifdef __NR_get_kernel_syms struct kernel_sym; +#ifdef __NR_get_kernel_syms _syscall1(int, get_kernel_syms, struct kernel_sym *, table); #else int get_kernel_syms(struct kernel_sym *table) { __set_errno(ENOSYS); - return (unsigned long)-1; + return -1; } #endif diff --git a/libc/sysdeps/linux/common/getrusage.c b/libc/sysdeps/linux/common/getrusage.c index f0476352c..c6aa5a95e 100644 --- a/libc/sysdeps/linux/common/getrusage.c +++ b/libc/sysdeps/linux/common/getrusage.c @@ -10,4 +10,4 @@ #include "syscalls.h" #include <unistd.h> #include <wait.h> -_syscall2(int, getrusage, int, who, struct rusage *, usage); +_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage); diff --git a/libc/sysdeps/linux/cris/Makefile.arch b/libc/sysdeps/linux/cris/Makefile.arch index ba2040f0d..850c83de5 100644 --- a/libc/sysdeps/linux/cris/Makefile.arch +++ b/libc/sysdeps/linux/cris/Makefile.arch @@ -12,4 +12,4 @@ ifeq ($(UNIFIED_SYSCALL),y) SSRC += __uClibc_syscall.S endif -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/hppa/Makefile.arch b/libc/sysdeps/linux/hppa/Makefile.arch index 047c01005..9739e74d7 100644 --- a/libc/sysdeps/linux/hppa/Makefile.arch +++ b/libc/sysdeps/linux/hppa/Makefile.arch @@ -10,4 +10,4 @@ CSRC := __syscall_error.c brk.c mmap.c syscall.c SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S \ add_n.s lshift.s rshift.s sub_n.s udiv_qrnnd.s -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/hppa/bits/syscalls.h b/libc/sysdeps/linux/hppa/bits/syscalls.h index 013c24095..d173aa389 100644 --- a/libc/sysdeps/linux/hppa/bits/syscalls.h +++ b/libc/sysdeps/linux/hppa/bits/syscalls.h @@ -163,4 +163,4 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 } #endif /* __ASSEMBLER__ */ -#endif /* _ASM_PARISC_UNISTD_H_ */ +#endif /* _BITS_SYSCALLS_H */ diff --git a/libc/sysdeps/linux/i386/Makefile.arch b/libc/sysdeps/linux/i386/Makefile.arch index c0f4f2f40..abd267445 100644 --- a/libc/sysdeps/linux/i386/Makefile.arch +++ b/libc/sysdeps/linux/i386/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S vfork.S clone.S setjmp.S bsd-setjmp.S \ bsd-_setjmp.S syscall.S mmap.S mmap64.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/m68k/Makefile.arch b/libc/sysdeps/linux/m68k/Makefile.arch index 833d31ffe..81e5b27f7 100644 --- a/libc/sysdeps/linux/m68k/Makefile.arch +++ b/libc/sysdeps/linux/m68k/Makefile.arch @@ -15,4 +15,4 @@ else ARCH_HEADERS := fpu_control.h endif -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/m68k/bits/mman.h b/libc/sysdeps/linux/m68k/bits/mman.h index 34f14ee5b..7f644b99b 100644 --- a/libc/sysdeps/linux/m68k/bits/mman.h +++ b/libc/sysdeps/linux/m68k/bits/mman.h @@ -72,4 +72,5 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif diff --git a/libc/sysdeps/linux/mips/Makefile.arch b/libc/sysdeps/linux/mips/Makefile.arch index f88e99686..c79aee8ca 100644 --- a/libc/sysdeps/linux/mips/Makefile.arch +++ b/libc/sysdeps/linux/mips/Makefile.arch @@ -14,4 +14,4 @@ SSRC := bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S syscall.S pipe.S ARCH_HEADERS := sgidefs.h # regdef.h -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/powerpc/Makefile.arch b/libc/sysdeps/linux/powerpc/Makefile.arch index 125ebc397..eaa1cb7f8 100644 --- a/libc/sysdeps/linux/powerpc/Makefile.arch +++ b/libc/sysdeps/linux/powerpc/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \ clone.S __uClibc_syscall.S syscall.S vfork.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/sh/Makefile.arch b/libc/sysdeps/linux/sh/Makefile.arch index 33ea8a94f..fa1a49543 100644 --- a/libc/sysdeps/linux/sh/Makefile.arch +++ b/libc/sysdeps/linux/sh/Makefile.arch @@ -11,4 +11,4 @@ CSRC := \ SSRC := setjmp.S __longjmp.S vfork.S clone.S ___fpscr_values.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/sparc/Makefile.arch b/libc/sysdeps/linux/sparc/Makefile.arch index 6730206b4..a6f44f2f0 100644 --- a/libc/sysdeps/linux/sparc/Makefile.arch +++ b/libc/sysdeps/linux/sparc/Makefile.arch @@ -11,4 +11,4 @@ SSRC := \ __longjmp.S fork.S vfork.S clone.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \ urem.S udiv.S umul.S sdiv.S rem.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch diff --git a/libc/sysdeps/linux/x86_64/Makefile.arch b/libc/sysdeps/linux/x86_64/Makefile.arch index 2cd9b2389..b6ad71cbd 100644 --- a/libc/sysdeps/linux/x86_64/Makefile.arch +++ b/libc/sysdeps/linux/x86_64/Makefile.arch @@ -10,4 +10,4 @@ CSRC := brk.c sigaction.c __syscall_error.c mmap.c SSRC := \ __longjmp.S vfork.S setjmp.S syscall.S bsd-setjmp.S bsd-_setjmp.S clone.S -include $(top_srcdir)libc/sysdeps/linux/Makefile.arch +include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch |