diff options
Diffstat (limited to 'libc/sysdeps/linux')
84 files changed, 493 insertions, 483 deletions
diff --git a/libc/sysdeps/linux/Makefile b/libc/sysdeps/linux/Makefile index 0e891d193..4a8f4a072 100644 --- a/libc/sysdeps/linux/Makefile +++ b/libc/sysdeps/linux/Makefile @@ -1,42 +1,13 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -TOPDIR=../../../ -include $(TOPDIR)Rules.mak - -ALL_SUBDIRS = arm common cris h8300 i386 m68k mips nios nios2 powerpc sh sh64 sparc v850 - -all: common $(TARGET_ARCH) - -tags: - ctags -R - -common: dummy - $(MAKE) -C common - -$(TARGET_ARCH): common - $(MAKE) -C $(TARGET_ARCH) - -clean: subdirs_clean - -subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) - -$(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy - $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean -.PHONY: dummy $(TARGET_ARCH) +top_srcdir=../../../ +top_builddir=../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.in +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/alpha/Makefile b/libc/sysdeps/linux/alpha/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/alpha/Makefile +++ b/libc/sysdeps/linux/alpha/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/arm/Makefile b/libc/sysdeps/linux/arm/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/arm/Makefile +++ b/libc/sysdeps/linux/arm/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/arm/bits/mman.h b/libc/sysdeps/linux/arm/bits/mman.h index 715e0f04c..596bd316c 100644 --- a/libc/sysdeps/linux/arm/bits/mman.h +++ b/libc/sysdeps/linux/arm/bits/mman.h @@ -72,6 +72,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/arm/ioperm.c b/libc/sysdeps/linux/arm/ioperm.c index 357d987f8..f887d54f1 100644 --- a/libc/sysdeps/linux/arm/ioperm.c +++ b/libc/sysdeps/linux/arm/ioperm.c @@ -157,7 +157,7 @@ init_iosys (void) /* translate systype name into i/o system: */ for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i) { - if (strcmp (platform[i].name, systype) == 0) { + if (__strcmp (platform[i].name, systype) == 0) { io.shift = platform[i].shift; io.io_base = platform[i].io_base; io.initdone = 1; @@ -185,14 +185,14 @@ int ioperm (unsigned long int from, unsigned long int num, int turn_on) if (! io.base) { int fd; - fd = open ("/dev/mem", O_RDWR); + fd = __open ("/dev/mem", O_RDWR); if (fd < 0) return -1; io.base = (unsigned long int) mmap (0, MAX_PORT << io.shift, PROT_READ | PROT_WRITE, MAP_SHARED, fd, io.io_base); - close (fd); + __close (fd); if ((long) io.base == -1) return -1; } diff --git a/libc/sysdeps/linux/arm/sigaction.c b/libc/sysdeps/linux/arm/sigaction.c index 5fbb7fbf1..822fd0d97 100644 --- a/libc/sysdeps/linux/arm/sigaction.c +++ b/libc/sysdeps/linux/arm/sigaction.c @@ -58,7 +58,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa if (act) { kact.k_sa_handler = act->sa_handler; - memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + __memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); kact.sa_flags = act->sa_flags; # ifdef HAVE_SA_RESTORER /* If the user specified SA_ONSTACK this means she is trying to @@ -83,7 +83,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); if (oact && result >= 0) { oact->sa_handler = koact.k_sa_handler; - memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); + __memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); oact->sa_flags = koact.sa_flags; # ifdef HAVE_SA_RESTORER oact->sa_restorer = koact.sa_restorer; diff --git a/libc/sysdeps/linux/bfin/bits/mman.h b/libc/sysdeps/linux/bfin/bits/mman.h index 0e0f8d113..d57eeb587 100644 --- a/libc/sysdeps/linux/bfin/bits/mman.h +++ b/libc/sysdeps/linux/bfin/bits/mman.h @@ -72,6 +72,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/common/__socketcall.c b/libc/sysdeps/linux/common/__socketcall.c index 8e9fbf7f3..48a083c3a 100644 --- a/libc/sysdeps/linux/common/__socketcall.c +++ b/libc/sysdeps/linux/common/__socketcall.c @@ -10,5 +10,5 @@ #include "syscalls.h" #ifdef __NR_socketcall #define __NR___socketcall __NR_socketcall -_syscall2(int, __socketcall, int, call, unsigned long *, args); +attribute_hidden _syscall2(int, __socketcall, int, call, unsigned long *, args); #endif diff --git a/libc/sysdeps/linux/common/bits/mman.h b/libc/sysdeps/linux/common/bits/mman.h index f567b9baa..0c1590270 100644 --- a/libc/sysdeps/linux/common/bits/mman.h +++ b/libc/sysdeps/linux/common/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for BSD-style memory management. - Copyright (C) 1994-1998,2000,01 Free Software Foundation, Inc. + Copyright (C) 1994-1998,2000,01,02,05 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -80,6 +80,16 @@ # define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ #endif +/* Flags to `msync'. */ +#define MS_ASYNC 1 /* Sync memory asynchronously. */ +#define MS_SYNC 0 /* Synchronous memory sync. */ +#define MS_INVALIDATE 2 /* Invalidate the caches. */ + +/* Flags for `mremap'. */ +#ifdef __USE_GNU +# define MREMAP_MAYMOVE 1 /* Mapping address may change. */ +# define MREMAP_FIXED 2 /* Fifth argument sets new address. */ +#endif /* Flags for `mlockall' (can be OR'd together). */ #define MCL_CURRENT 1 /* Lock all currently mapped pages. */ diff --git a/libc/sysdeps/linux/common/bits/utmp.h b/libc/sysdeps/linux/common/bits/utmp.h index 2ed29bbb4..e855ad73f 100644 --- a/libc/sysdeps/linux/common/bits/utmp.h +++ b/libc/sysdeps/linux/common/bits/utmp.h @@ -1,5 +1,6 @@ /* The `struct utmp' type, describing entries in the utmp file. GNU version. - Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,6 +25,7 @@ #include <paths.h> #include <sys/time.h> #include <sys/types.h> +#include <bits/wordsize.h> #define UT_LINESIZE 32 @@ -35,7 +37,11 @@ previous logins. */ struct lastlog { +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + int32_t ll_time; +#else __time_t ll_time; +#endif char ll_line[UT_LINESIZE]; char ll_host[UT_HOSTSIZE]; }; @@ -61,8 +67,21 @@ struct utmp char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */ struct exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ +/* The ut_session and ut_tv fields must be the same size when compiled + 32- and 64-bit. This allows data files and shared memory to be + shared between 32- and 64-bit applications. */ +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + int32_t ut_session; /* Session ID, used for windowing. */ + struct + { + int32_t tv_sec; /* Seconds. */ + int32_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ +#endif + int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __unused[20]; /* Reserved for future use. */ }; diff --git a/libc/sysdeps/linux/common/bits/utmpx.h b/libc/sysdeps/linux/common/bits/utmpx.h index 99735370b..c84cda6fe 100644 --- a/libc/sysdeps/linux/common/bits/utmpx.h +++ b/libc/sysdeps/linux/common/bits/utmpx.h @@ -1,5 +1,5 @@ /* Structures and definitions for the user accounting database. GNU version. - Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -23,6 +23,7 @@ #include <bits/types.h> #include <sys/time.h> +#include <bits/wordsize.h> #ifdef __USE_GNU @@ -62,8 +63,21 @@ struct utmpx char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */ struct __exit_status ut_exit; /* Exit status of a process marked as DEAD_PROCESS. */ + +/* The fields ut_session and ut_tv must be the same size when compiled + 32- and 64-bit. This allows files and shared memory to be shared + between 32- and 64-bit applications. */ +#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 + __int32_t ut_session; /* Session ID, used for windowing. */ + struct + { + __int32_t tv_sec; /* Seconds. */ + __int32_t tv_usec; /* Microseconds. */ + } ut_tv; /* Time entry was made. */ +#else long int ut_session; /* Session ID, used for windowing. */ struct timeval ut_tv; /* Time entry was made. */ +#endif __int32_t ut_addr_v6[4]; /* Internet address of remote host. */ char __unused[20]; /* Reserved for future use. */ }; diff --git a/libc/sysdeps/linux/common/clock_getres.c b/libc/sysdeps/linux/common/clock_getres.c index 0ae2bb07d..7aff495d0 100644 --- a/libc/sysdeps/linux/common/clock_getres.c +++ b/libc/sysdeps/linux/common/clock_getres.c @@ -19,6 +19,8 @@ * */ +#define sysconf __sysconf + #define _GNU_SOURCE #include "syscalls.h" #include <time.h> diff --git a/libc/sysdeps/linux/common/close.c b/libc/sysdeps/linux/common/close.c index 1e03b091e..2e9c2073d 100644 --- a/libc/sysdeps/linux/common/close.c +++ b/libc/sysdeps/linux/common/close.c @@ -10,6 +10,7 @@ #include "syscalls.h" #include <unistd.h> -#define __NR___libc_close __NR_close -_syscall1(int, __libc_close, int, fd); -weak_alias(__libc_close, close); +#define __NR___close __NR_close +attribute_hidden _syscall1(int, __close, int, fd); +strong_alias(__close,close) +weak_alias(__close,__libc_close) diff --git a/libc/sysdeps/linux/common/cmsg_nxthdr.c b/libc/sysdeps/linux/common/cmsg_nxthdr.c index 20c490dcc..cc17c28f5 100644 --- a/libc/sysdeps/linux/common/cmsg_nxthdr.c +++ b/libc/sysdeps/linux/common/cmsg_nxthdr.c @@ -22,8 +22,8 @@ #include <sys/socket.h> -struct cmsghdr * -__cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg) +struct cmsghdr attribute_hidden * +__libc_cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg) { if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr)) /* The kernel header does this so there may be a reason. */ @@ -39,3 +39,4 @@ __cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg) return NULL; return cmsg; } +strong_alias(__libc_cmsg_nxthdr,__cmsg_nxthdr) diff --git a/libc/sysdeps/linux/common/creat64.c b/libc/sysdeps/linux/common/creat64.c index deeda3892..759f5bed8 100644 --- a/libc/sysdeps/linux/common/creat64.c +++ b/libc/sysdeps/linux/common/creat64.c @@ -16,6 +16,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define open64 __open64 + #include <features.h> #include <fcntl.h> #include <sys/types.h> diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c index 0c8f50999..a54f13be5 100644 --- a/libc/sysdeps/linux/common/create_module.c +++ b/libc/sysdeps/linux/common/create_module.c @@ -34,7 +34,7 @@ # 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); +static inline _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 * negative, so we we fix it up here. */ @@ -53,7 +53,7 @@ unsigned long create_module(const char *name, size_t size) # 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, +static inline _syscall4(unsigned long, __create_module, const char *, name, size_t, size, size_t, dummy, size_t, err); unsigned long create_module(const char *name, size_t size) { diff --git a/libc/sysdeps/linux/common/dl-osinfo.h b/libc/sysdeps/linux/common/dl-osinfo.h index 4976b2b46..7998b08a4 100644 --- a/libc/sysdeps/linux/common/dl-osinfo.h +++ b/libc/sysdeps/linux/common/dl-osinfo.h @@ -10,35 +10,35 @@ #include <features.h> #ifdef __UCLIBC_HAS_SSP__ -#include <stdint.h> -#include <sys/time.h> +# if defined IS_IN_libc || defined IS_IN_rtld -#ifdef IS_IN_libc -#include <ssp-internal.h> -#if 0 -#ifndef __SSP_QUICK_CANARY__ -#define OPEN __libc_open -#define READ __libc_read -#define CLOSE __libc_close -#endif -#define GETTIMEOFDAY gettimeofday -#endif -#else -#ifdef __SSP__ -#error "file must not be compiled with stack protection enabled on it. Use -fno-stack-protector" -#endif -#ifndef __SSP_QUICK_CANARY__ -#define OPEN _dl_open -#define READ _dl_read -#define CLOSE _dl_close -#endif -#define GETTIMEOFDAY _dl_gettimeofday -#endif +# if defined __SSP__ || defined __SSP_ALL__ +# error "file must not be compiled with stack protection enabled on it. Use -fno-stack-protector" +# endif + +# include <stdint.h> +# include <sys/time.h> + +# ifdef IS_IN_libc +# ifndef __SSP_QUICK_CANARY__ +# define OPEN __open +# define READ __read +# define CLOSE __close +# endif +# define GETTIMEOFDAY gettimeofday +# else +# ifndef __SSP_QUICK_CANARY__ +# define OPEN _dl_open +# define READ _dl_read +# define CLOSE _dl_close +# endif +# define GETTIMEOFDAY _dl_gettimeofday +# endif static __always_inline uintptr_t _dl_setup_stack_chk_guard(void) { uintptr_t ret; -#ifndef __SSP_QUICK_CANARY__ +# ifndef __SSP_QUICK_CANARY__ { int fd = OPEN("/dev/urandom", O_RDONLY, 0); if (fd >= 0) { @@ -48,7 +48,7 @@ static __always_inline uintptr_t _dl_setup_stack_chk_guard(void) return ret; } } -#endif /* !__SSP_QUICK_CANARY__ */ +# endif /* !__SSP_QUICK_CANARY__ */ /* Start with the "terminator canary". */ ret = 0xFF0A0D00UL; @@ -62,6 +62,7 @@ static __always_inline uintptr_t _dl_setup_stack_chk_guard(void) } return ret; } +# endif /* libc || rtld */ #endif /* __UCLIBC_HAS_SSP__ */ #endif /* _DL_OSINFO_H */ diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c index c6a2fc005..d007993eb 100644 --- a/libc/sysdeps/linux/common/getcwd.c +++ b/libc/sysdeps/linux/common/getcwd.c @@ -47,13 +47,13 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path slow_search = 1; #endif - slen = strlen(path_buf); + slen = __strlen(path_buf); ptr = path_buf + slen - 1; if (*ptr != '/') { if (slen + 2 > path_size) { goto oops; } - strcpy(++ptr, "/"); + __strcpy(++ptr, "/"); slen++; } slen++; @@ -67,10 +67,10 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path #ifdef FAST_DIR_SEARCH_POSSIBLE if (slow_search || this_ino == d->d_ino) { #endif - if (slen + strlen(d->d_name) > path_size) { + if (slen + __strlen(d->d_name) > path_size) { goto oops; } - strcpy(ptr + 1, d->d_name); + __strcpy(ptr + 1, d->d_name); if (stat(path_buf, &st) < 0) continue; if (st.st_ino == this_ino && st.st_dev == this_dev) { @@ -108,13 +108,13 @@ static char *recurser(char *path_buf, int path_size, dev_t root_dev, ino_t root_ if (path_size < 2) { goto oops; } - strcpy(path_buf, "/"); + __strcpy(path_buf, "/"); return path_buf; } - if (strlen(path_buf) + 4 > path_size) { + if (__strlen(path_buf) + 4 > path_size) { goto oops; } - strcat(path_buf, "/.."); + __strcat(path_buf, "/.."); if (recurser(path_buf, path_size, root_dev, root_ino) == 0) return 0; @@ -141,11 +141,11 @@ int __syscall_getcwd(char * buf, unsigned long size) return -1; } /* start with actual dir */ - if (buf) strncpy(buf, ".", size); + if (buf) __strncpy(buf, ".", size); cwd = recurser(buf, size, st.st_dev, st.st_ino); if (cwd) { - len = strlen(buf); + len = __strlen(buf); __set_errno(olderrno); } return len; diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index 876420664..24ce2c8ba 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -28,7 +28,7 @@ #include <sys/types.h> #include <sys/syscall.h> - +#undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) struct kernel_dirent @@ -90,7 +90,7 @@ ssize_t attribute_hidden __getdents (int fd, char *buf, size_t nbytes) dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; - memcpy (dp->d_name, kdp->d_name, + __memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent, d_name)); dp = (struct dirent *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen); diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index e45d9d364..a475c948a 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -31,7 +31,7 @@ #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 - +#undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) struct kernel_dirent64 @@ -95,7 +95,7 @@ ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes) dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; - memcpy (dp->d_name, kdp->d_name, + __memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent64, d_name)); dp = (struct dirent64 *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen); diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c index 4cc528fc7..d0865fba5 100644 --- a/libc/sysdeps/linux/common/getdirname.c +++ b/libc/sysdeps/linux/common/getdirname.c @@ -49,7 +49,7 @@ get_current_dir_name (void) && pwdstat.st_dev == dotstat.st_dev && pwdstat.st_ino == dotstat.st_ino) /* The PWD value is correct. Use it. */ - return strdup (pwd); + return __strdup (pwd); return getcwd ((char *) NULL, 0); } diff --git a/libc/sysdeps/linux/common/getdnnm.c b/libc/sysdeps/linux/common/getdnnm.c index aa5a7d756..3c48b4ca0 100644 --- a/libc/sysdeps/linux/common/getdnnm.c +++ b/libc/sysdeps/linux/common/getdnnm.c @@ -18,10 +18,10 @@ getdomainname(char *name, size_t len) if (uname(&uts) == -1) return -1; - if (strlen(uts.domainname)+1 > len) { + if (__strlen(uts.domainname)+1 > len) { __set_errno(EINVAL); return -1; } - strcpy(name, uts.domainname); + __strcpy(name, uts.domainname); return 0; } diff --git a/libc/sysdeps/linux/common/getdtablesize.c b/libc/sysdeps/linux/common/getdtablesize.c index 016e6f62e..8cbcebdce 100644 --- a/libc/sysdeps/linux/common/getdtablesize.c +++ b/libc/sysdeps/linux/common/getdtablesize.c @@ -16,6 +16,8 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define getrlimit __getrlimit + #include <stdlib.h> #include <unistd.h> #include <sys/resource.h> diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c index 17a7b51c7..402d87e66 100644 --- a/libc/sysdeps/linux/common/getgroups.c +++ b/libc/sysdeps/linux/common/getgroups.c @@ -7,6 +7,8 @@ * GNU Library General Public License (LGPL) version 2 or later. */ +#define sysconf __sysconf + #include "syscalls.h" #include <unistd.h> diff --git a/libc/sysdeps/linux/common/gethstnm.c b/libc/sysdeps/linux/common/gethstnm.c index 0f7a04681..8a23e9516 100644 --- a/libc/sysdeps/linux/common/gethstnm.c +++ b/libc/sysdeps/linux/common/gethstnm.c @@ -15,10 +15,10 @@ gethostname(char *name, size_t len) if (uname(&uts) == -1) return -1; - if (strlen(uts.nodename)+1 > len) { + if (__strlen(uts.nodename)+1 > len) { __set_errno(EINVAL); return -1; } - strcpy(name, uts.nodename); + __strcpy(name, uts.nodename); return 0; } diff --git a/libc/sysdeps/linux/common/getpagesize.c b/libc/sysdeps/linux/common/getpagesize.c index 0844d5b79..8469cbb76 100644 --- a/libc/sysdeps/linux/common/getpagesize.c +++ b/libc/sysdeps/linux/common/getpagesize.c @@ -22,7 +22,7 @@ extern size_t __pagesize; /* Return the system page size. */ -int __getpagesize(void) +int attribute_hidden __libc_getpagesize(void) { if (__pagesize != 0) return __pagesize; @@ -40,5 +40,6 @@ int __getpagesize(void) #endif /* NBPG. */ #endif /* EXEC_PAGESIZE. */ } -weak_alias(__getpagesize, getpagesize); +strong_alias(__libc_getpagesize, __getpagesize) +weak_alias(__getpagesize, getpagesize) diff --git a/libc/sysdeps/linux/common/getrlimit.c b/libc/sysdeps/linux/common/getrlimit.c index faeba92f4..fef907a03 100644 --- a/libc/sysdeps/linux/common/getrlimit.c +++ b/libc/sysdeps/linux/common/getrlimit.c @@ -13,9 +13,10 @@ #ifdef __NR_ugetrlimit #define __NR___ugetrlimit __NR_ugetrlimit +static inline _syscall2(int, __ugetrlimit, enum __rlimit_resource, resource, struct rlimit *, rlim); -int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) +int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { return (__ugetrlimit(resource, rlimits)); } @@ -23,15 +24,15 @@ int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) #else /* __NR_ugetrlimit */ /* Only include the old getrlimit if the new one (ugetrlimit) is not around */ -#define __NR___getrlimit __NR_getrlimit +#define __NR___syscall_getrlimit __NR_getrlimit static inline -_syscall2(int, __getrlimit, int, resource, struct rlimit *, rlim); +_syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim); -int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) +int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { int result; - result = __getrlimit(resource, rlimits); + result = __syscall_getrlimit(resource, rlimits); if (result == -1) return result; @@ -45,3 +46,5 @@ int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) return result; } #endif + +strong_alias(__getrlimit,getrlimit) diff --git a/libc/sysdeps/linux/common/getrlimit64.c b/libc/sysdeps/linux/common/getrlimit64.c index 1af7870af..76c3196ad 100644 --- a/libc/sysdeps/linux/common/getrlimit64.c +++ b/libc/sysdeps/linux/common/getrlimit64.c @@ -16,6 +16,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define getrlimit __getrlimit + #include <features.h> #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 diff --git a/libc/sysdeps/linux/common/longjmp.c b/libc/sysdeps/linux/common/longjmp.c index 1a4201922..5b4eff5f5 100644 --- a/libc/sysdeps/linux/common/longjmp.c +++ b/libc/sysdeps/linux/common/longjmp.c @@ -36,7 +36,7 @@ void __libc_longjmp (sigjmp_buf env, int val) if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ - (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, + (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, (sigset_t *) NULL); /* Call the machine-dependent function to restore machine state. */ diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c index 332d6a402..90e990a4f 100644 --- a/libc/sysdeps/linux/common/open.c +++ b/libc/sysdeps/linux/common/open.c @@ -18,7 +18,7 @@ static inline _syscall3(int, __syscall_open, const char *, file, int, flags, __kernel_mode_t, mode); -int __libc_open(const char *file, int flags, ...) +int attribute_hidden __open(const char *file, int flags, ...) { /* gcc may warn about mode being uninitialized. * Just ignore that, since gcc is wrong. */ @@ -33,9 +33,10 @@ int __libc_open(const char *file, int flags, ...) } return __syscall_open(file, flags, mode); } -weak_alias(__libc_open, open); +strong_alias(__open,open) +weak_alias(__open,__libc_open) int creat(const char *file, mode_t mode) { - return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode); + return __open(file, O_WRONLY | O_CREAT | O_TRUNC, mode); } diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index d9a27a7bc..c1cd47141 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -26,11 +26,9 @@ #endif #ifdef __UCLIBC_HAS_LFS__ -extern int __libc_open (__const char *file, int oflag, ...); - /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ -int __libc_open64 (const char *file, int oflag, ...) +int attribute_hidden __open64 (const char *file, int oflag, ...) { int mode = 0; @@ -42,7 +40,8 @@ int __libc_open64 (const char *file, int oflag, ...) va_end (arg); } - return __libc_open(file, oflag | O_LARGEFILE, mode); + return __open(file, oflag | O_LARGEFILE, mode); } -weak_alias (__libc_open64, open64); +strong_alias(__open64,open64) +weak_alias(__open64,__libc_open64) #endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c index 06c857c43..87d0dbb27 100644 --- a/libc/sysdeps/linux/common/poll.c +++ b/libc/sysdeps/linux/common/poll.c @@ -62,9 +62,9 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) /* We can't call FD_ZERO, since FD_ZERO only works with sets of exactly __FD_SETSIZE size. */ - memset (rset, 0, bytes); - memset (wset, 0, bytes); - memset (xset, 0, bytes); + __memset (rset, 0, bytes); + __memset (wset, 0, bytes); + __memset (xset, 0, bytes); for (f = fds; f < &fds[nfds]; ++f) { @@ -86,13 +86,13 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) nwset = alloca (nbytes); nxset = alloca (nbytes); - memset ((char *) nrset + bytes, 0, nbytes - bytes); - memset ((char *) nwset + bytes, 0, nbytes - bytes); - memset ((char *) nxset + bytes, 0, nbytes - bytes); + __memset ((char *) nrset + bytes, 0, nbytes - bytes); + __memset ((char *) nwset + bytes, 0, nbytes - bytes); + __memset ((char *) nxset + bytes, 0, nbytes - bytes); - rset = memcpy (nrset, rset, bytes); - wset = memcpy (nwset, wset, bytes); - xset = memcpy (nxset, xset, bytes); + rset = __memcpy (nrset, rset, bytes); + wset = __memcpy (nwset, wset, bytes); + xset = __memcpy (nxset, xset, bytes); bytes = nbytes; } @@ -126,9 +126,9 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) struct timeval sngl_tv; /* Clear the original set. */ - memset (rset, 0, bytes); - memset (wset, 0, bytes); - memset (xset, 0, bytes); + __memset (rset, 0, bytes); + __memset (wset, 0, bytes); + __memset (xset, 0, bytes); /* This means we don't wait for input. */ sngl_tv.tv_sec = 0; @@ -145,9 +145,9 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout) { int n; - memset (sngl_rset, 0, bytes); - memset (sngl_wset, 0, bytes); - memset (sngl_xset, 0, bytes); + __memset (sngl_rset, 0, bytes); + __memset (sngl_wset, 0, bytes); + __memset (sngl_xset, 0, bytes); if (f->events & POLLIN) FD_SET (f->fd, sngl_rset); diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c index a1888134b..52fc35700 100644 --- a/libc/sysdeps/linux/common/posix_fadvise.c +++ b/libc/sysdeps/linux/common/posix_fadvise.c @@ -8,22 +8,20 @@ * GNU Library General Public License (LGPL) version 2 or later. */ +/* need to hide the posix_fadvise64 prototype or the weak_alias() + * will fail when __NR_fadvise64_64 doesnt exist */ +#define posix_fadvise64 __hide_posix_fadvise64 #include "syscalls.h" #include <fcntl.h> +#undef posix_fadvise64 #ifdef __NR_fadvise64 -#define __NR___syscall_fadvise64 __NR_fadvise64 -_syscall4(int, __syscall_fadvise64, int, fd, off_t, offset, +#define __NR_posix_fadvise __NR_fadvise64 +_syscall4(int, posix_fadvise, int, fd, off_t, offset, off_t, len, int, advice); -int __libc_posix_fadvise(int fd, off_t offset, off_t len, int advice) -{ - return (__syscall_fadvise64(fd, offset, len, advice)); -} -weak_alias(__libc_posix_fadvise, posix_fadvise); -#if defined __UCLIBC_HAS_LFS__ && !defined __NR_fadvise64_64 && \ - !defined __USE_LARGEFILE64 -weak_alias(__libc_posix_fadvise, posix_fadvise64); +#if defined __UCLIBC_HAS_LFS__ && !defined __NR_fadvise64_64 +weak_alias(posix_fadvise, posix_fadvise64); #endif #else diff --git a/libc/sysdeps/linux/common/posix_fadvise64.c b/libc/sysdeps/linux/common/posix_fadvise64.c index a5dbe8de2..5c5cf9906 100644 --- a/libc/sysdeps/linux/common/posix_fadvise64.c +++ b/libc/sysdeps/linux/common/posix_fadvise64.c @@ -19,34 +19,30 @@ #ifdef __UCLIBC_HAS_LFS__ #ifdef __NR_fadvise64_64 -#define __NR___syscall_fadvise64_64 __NR_fadvise64_64 /* 64 bit implementation is cake ... or more like pie ... */ #if __WORDSIZE == 64 -_syscall4(int, __syscall_fadvise64_64, int, fd, __off64_t, offset, + +#define __NR_posix_fadvise64 __NR_fadvise64_64 +_syscall4(int, posix_fadvise64, int, fd, __off64_t, offset, __off64_t, len, int, advice); -int __libc_posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) -{ - return (__syscall_fadvise64_64(fd, offset, len, advice)); -} -weak_alias(__libc_posix_fadvise64, posix_fadvise64); /* 32 bit implementation is kind of a pita */ #elif __WORDSIZE == 32 #ifdef _syscall6 /* workaround until everyone has _syscall6() */ -_syscall6(int, __syscall_fadvise64_64, int, fd, +#define __NR___syscall_fadvise64_64 __NR_fadvise64_64 +static inline _syscall6(int, __syscall_fadvise64_64, int, fd, unsigned long, high_offset, unsigned long, low_offset, unsigned long, high_len, unsigned long, low_len, int, advice); -int __libc_posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) +int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) { return (__syscall_fadvise64_64(fd, __LONG_LONG_PAIR(offset >> 32, offset & 0xffffffff), __LONG_LONG_PAIR(len >> 32, len & 0xffffffff), advice)); } -weak_alias(__libc_posix_fadvise64, posix_fadvise64); #else #warning _syscall6 has not been defined for your machine :( #endif /* _syscall6 */ @@ -56,7 +52,7 @@ weak_alias(__libc_posix_fadvise64, posix_fadvise64); #endif #elif !defined __NR_fadvise64 -/* This is declared as a weak alias in posix_fadvice.c if __NR_fadvise64 +/* This is declared as a weak alias in posix_fadvise.c if __NR_fadvise64 * is defined. */ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice) diff --git a/libc/sysdeps/linux/common/read.c b/libc/sysdeps/linux/common/read.c index 9b9ea5bc9..6490bccbc 100644 --- a/libc/sysdeps/linux/common/read.c +++ b/libc/sysdeps/linux/common/read.c @@ -10,6 +10,7 @@ #include "syscalls.h" #include <unistd.h> -#define __NR___libc_read __NR_read -_syscall3(ssize_t, __libc_read, int, fd, __ptr_t, buf, size_t, count); -weak_alias(__libc_read, read); +#define __NR___read __NR_read +attribute_hidden _syscall3(ssize_t, __read, int, fd, __ptr_t, buf, size_t, count); +strong_alias(__read,read) +weak_alias(__read,__libc_read) diff --git a/libc/sysdeps/linux/common/setgroups.c b/libc/sysdeps/linux/common/setgroups.c index 4b4a1ddec..d92840370 100644 --- a/libc/sysdeps/linux/common/setgroups.c +++ b/libc/sysdeps/linux/common/setgroups.c @@ -7,6 +7,8 @@ * GNU Library General Public License (LGPL) version 2 or later. */ +#define sysconf __sysconf + #include "syscalls.h" #include <unistd.h> #include <grp.h> diff --git a/libc/sysdeps/linux/common/setrlimit.c b/libc/sysdeps/linux/common/setrlimit.c index c7ebe6c98..9c5466a09 100644 --- a/libc/sysdeps/linux/common/setrlimit.c +++ b/libc/sysdeps/linux/common/setrlimit.c @@ -12,12 +12,13 @@ #ifndef __NR_ugetrlimit /* Only wrap setrlimit if the new ugetrlimit is not present */ -#define __NR___setrlimit __NR_setrlimit +#define __NR___syscall_setrlimit __NR_setrlimit #include <unistd.h> #include <sys/resource.h> #define RMIN(x, y) ((x) < (y) ? (x) : (y)) -_syscall2(int, __setrlimit, int, resource, const struct rlimit *, rlim); -int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits) +static inline +_syscall2(int, __syscall_setrlimit, int, resource, const struct rlimit *, rlim); +int attribute_hidden __setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits) { struct rlimit rlimits_small; @@ -27,7 +28,7 @@ int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits) RLIM_INFINITY >> 1); rlimits_small.rlim_max = RMIN((unsigned long int) rlimits->rlim_max, RLIM_INFINITY >> 1); - return (__setrlimit(resource, &rlimits_small)); + return (__syscall_setrlimit(resource, &rlimits_small)); } #undef RMIN @@ -36,6 +37,9 @@ int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits) #include <unistd.h> struct rlimit; -_syscall2(int, setrlimit, unsigned int, resource, +#define __NR___setrlimit __NR_setrlimit +attribute_hidden _syscall2(int, __setrlimit, unsigned int, resource, const struct rlimit *, rlim); #endif + +strong_alias(__setrlimit,setrlimit) diff --git a/libc/sysdeps/linux/common/setrlimit64.c b/libc/sysdeps/linux/common/setrlimit64.c index 8d190f573..d59057c90 100644 --- a/libc/sysdeps/linux/common/setrlimit64.c +++ b/libc/sysdeps/linux/common/setrlimit64.c @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#define setrlimit __setrlimit #include <features.h> diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c index 43708fe61..4c52d070f 100644 --- a/libc/sysdeps/linux/common/ssp.c +++ b/libc/sysdeps/linux/common/ssp.c @@ -30,10 +30,10 @@ static __always_inline void block_signals(void) sigfillset(&mask); sigdelset(&mask, SSP_SIGTYPE); /* Block all signal handlers */ - SIGPROCMASK(SIG_BLOCK, &mask, NULL); /* except SSP_SIGTYPE */ + __sigprocmask(SIG_BLOCK, &mask, NULL); /* except SSP_SIGTYPE */ /* Make the default handler associated with the signal handler */ - memset(&sa, 0, sizeof(struct sigaction)); + __memset(&sa, 0, sizeof(struct sigaction)); sigfillset(&sa.sa_mask); /* Block all signals */ sa.sa_flags = 0; sa.sa_handler = SIG_DFL; @@ -42,10 +42,10 @@ static __always_inline void block_signals(void) static __always_inline void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3) { - WRITE(fd, msg1, strlen(msg1)); - WRITE(fd, msg2, strlen(msg2)); - WRITE(fd, msg3, strlen(msg3)); - WRITE(fd, "()\n", 3); + __write(fd, msg1, __strlen(msg1)); + __write(fd, msg2, __strlen(msg2)); + __write(fd, msg3, __strlen(msg3)); + __write(fd, "()\n", 3); openlog("ssp", LOG_CONS | LOG_PID, LOG_USER); syslog(LOG_INFO, "%s%s%s()", msg1, msg2, msg3); closelog(); diff --git a/libc/sysdeps/linux/common/syscalls.h b/libc/sysdeps/linux/common/syscalls.h index b42f82100..743ac8a74 100644 --- a/libc/sysdeps/linux/common/syscalls.h +++ b/libc/sysdeps/linux/common/syscalls.h @@ -29,10 +29,8 @@ #include <endian.h> #undef __OPTIMIZE__ -/* - * We absolutely do _NOT_ want interfaces silently - * renamed under us or very bad things will happen... - */ +/* We absolutely do _NOT_ want interfaces silently + * * * renamed under us or very bad things will happen... */ #ifdef __USE_FILE_OFFSET64 # undef __USE_FILE_OFFSET64 #endif diff --git a/libc/sysdeps/linux/common/ulimit.c b/libc/sysdeps/linux/common/ulimit.c index 2394edaae..b8e09fc8f 100644 --- a/libc/sysdeps/linux/common/ulimit.c +++ b/libc/sysdeps/linux/common/ulimit.c @@ -18,6 +18,10 @@ * */ +#define sysconf __sysconf +#define getrlimit __getrlimit +#define setrlimit __setrlimit + #define _GNU_SOURCE #define _LARGEFILE64_SOURCE #include <features.h> diff --git a/libc/sysdeps/linux/common/write.c b/libc/sysdeps/linux/common/write.c index b7e34f81c..d3b5fab93 100644 --- a/libc/sysdeps/linux/common/write.c +++ b/libc/sysdeps/linux/common/write.c @@ -10,9 +10,12 @@ #include "syscalls.h" #include <unistd.h> -#define __NR___libc_write __NR_write -_syscall3(ssize_t, __libc_write, int, fd, const __ptr_t, buf, size_t, count); -weak_alias(__libc_write, write); +#define __NR___write __NR_write +attribute_hidden _syscall3(ssize_t, __write, int, fd, const __ptr_t, buf, size_t, count); +strong_alias(__write,write) +weak_alias(__write,__libc_write) +#if 0 /* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o * which is a blatent GNU libc-ism... */ weak_alias(__libc_write, __write); +#endif diff --git a/libc/sysdeps/linux/cris/Makefile b/libc/sysdeps/linux/cris/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/cris/Makefile +++ b/libc/sysdeps/linux/cris/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/cris/bits/mman.h b/libc/sysdeps/linux/cris/bits/mman.h index 16216855f..b1f22a1c4 100644 --- a/libc/sysdeps/linux/cris/bits/mman.h +++ b/libc/sysdeps/linux/cris/bits/mman.h @@ -72,6 +72,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/e1/bits/mman.h b/libc/sysdeps/linux/e1/bits/mman.h index 34f14ee5b..7f644b99b 100644 --- a/libc/sysdeps/linux/e1/bits/mman.h +++ b/libc/sysdeps/linux/e1/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/e1/longjmp.c b/libc/sysdeps/linux/e1/longjmp.c index 5770d4997..89d6b76d9 100644 --- a/libc/sysdeps/linux/e1/longjmp.c +++ b/libc/sysdeps/linux/e1/longjmp.c @@ -43,7 +43,7 @@ void longjmp(jmp_buf state, int value ) void siglongjmp(sigjmp_buf state, int value ) { if( state->__mask_was_saved ) - sigprocmask(SIG_SETMASK, &state->__saved_mask, NULL); + __sigprocmask(SIG_SETMASK, &state->__saved_mask, NULL); if(!value) state->__jmpbuf->ReturnValue = 1; diff --git a/libc/sysdeps/linux/e1/setjmp.c b/libc/sysdeps/linux/e1/setjmp.c index 2942cb193..502e89b22 100644 --- a/libc/sysdeps/linux/e1/setjmp.c +++ b/libc/sysdeps/linux/e1/setjmp.c @@ -32,7 +32,7 @@ int sigsetjmp( sigjmp_buf state , int savesigs) if(savesigs) { state->__mask_was_saved = 1; /* how arg in <sigprocmask> is not significant */ - sigprocmask(SIG_SETMASK, NULL, &state->__saved_mask); + __sigprocmask(SIG_SETMASK, NULL, &state->__saved_mask); } else state->__mask_was_saved = 0; diff --git a/libc/sysdeps/linux/frv/bits/mman.h b/libc/sysdeps/linux/frv/bits/mman.h index 9e87f804c..0802005f4 100644 --- a/libc/sysdeps/linux/frv/bits/mman.h +++ b/libc/sysdeps/linux/frv/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/h8300/bits/mman.h b/libc/sysdeps/linux/h8300/bits/mman.h index 34f14ee5b..7f644b99b 100644 --- a/libc/sysdeps/linux/h8300/bits/mman.h +++ b/libc/sysdeps/linux/h8300/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/hppa/Makefile b/libc/sysdeps/linux/hppa/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/hppa/Makefile +++ b/libc/sysdeps/linux/hppa/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/i386/Makefile +++ b/libc/sysdeps/linux/i386/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/i386/bits/mman.h b/libc/sysdeps/linux/i386/bits/mman.h index 0778afbb5..f7a855aba 100644 --- a/libc/sysdeps/linux/i386/bits/mman.h +++ b/libc/sysdeps/linux/i386/bits/mman.h @@ -72,6 +72,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c index 229a95ff5..0875796cf 100644 --- a/libc/sysdeps/linux/i386/sigaction.c +++ b/libc/sysdeps/linux/i386/sigaction.c @@ -29,9 +29,8 @@ #if defined __NR_rt_sigaction -#warning "Yes there are two warnings here. Don't worry about it." -static void restore_rt (void) asm ("__restore_rt"); -static void restore (void) asm ("__restore"); +extern void restore_rt (void) asm ("__restore_rt") attribute_hidden; +extern void restore (void) asm ("__restore") attribute_hidden; /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ @@ -49,7 +48,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa if (act) { kact.k_sa_handler = act->sa_handler; - memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask)); + __memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask)); kact.sa_flags = act->sa_flags; kact.sa_flags = act->sa_flags | SA_RESTORER; @@ -64,7 +63,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa if (oact && result >= 0) { oact->sa_handler = koact.k_sa_handler; - memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask)); + __memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask)); oact->sa_flags = koact.sa_flags; oact->sa_restorer = koact.sa_restorer; } @@ -73,8 +72,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa #else -#warning "Yes there is a warning here. Don't worry about it." -static void restore (void) asm ("__restore"); +extern void restore (void) asm ("__restore") attribute_hidden; /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ @@ -121,10 +119,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa } #endif - -#ifndef LIBC_SIGACTION weak_alias (__libc_sigaction, sigaction) -#endif diff --git a/libc/sysdeps/linux/i960/bits/mman.h b/libc/sysdeps/linux/i960/bits/mman.h index 45663c963..48f46c274 100644 --- a/libc/sysdeps/linux/i960/bits/mman.h +++ b/libc/sysdeps/linux/i960/bits/mman.h @@ -72,6 +72,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/m68k/Makefile b/libc/sysdeps/linux/m68k/Makefile index 5173b2165..633c91f3e 100644 --- a/libc/sysdeps/linux/m68k/Makefile +++ b/libc/sysdeps/linux/m68k/Makefile @@ -1,89 +1,13 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -# If you're looking for vfork(), it is defined in include/unistd.h - - -ifeq ($(ARCH_HAS_MMU),y) -CRT_SRC := crt0.c -else -CRT_SRC := crt0.S -endif -CRT_OBJ := crt0.o crt1.o -CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC := __longjmp.S bsd-_setjmp.S bsd-setjmp.S clone.S setjmp.S vfork.S -SOBJ := $(patsubst %.S,%.o, $(SSRC)) - -CSRC := ptrace.c brk.c -COBJ := $(patsubst %.c,%.o, $(CSRC)) - -OBJS := $(SOBJ) $(COBJ) - -OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) $(CTOR_TARGETS) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) - $(STRIPTOOL) -x -R .note -R .comment $^ - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(TOPDIR)lib/ - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ - -$(CRT_OBJ): $(CRT_SRC) -ifeq ($(ARCH_HAS_MMU),y) - $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o -else - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o -endif - -$(SOBJ): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - -$(COBJ): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - -ifeq ($(UCLIBC_CTOR_DTOR),y) -$(TOPDIR)lib/crti.o: crti.S - $(INSTALL) -d $(TOPDIR)lib/ - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ - -$(TOPDIR)lib/crtn.o: crtn.S - $(INSTALL) -d $(TOPDIR)lib/ - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -else -$(CTOR_TARGETS): - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $@ -endif - -headers: -ifneq ($(HAVE_ELF),y) - echo "Working around compiler bug in the m68k-pic-coff toolchain" - $(LN) -fs ../libc/sysdeps/linux/m68k/float.h $(TOPDIR)/include/ -endif - $(LN) -fs ../libc/sysdeps/linux/m68k/fpu_control.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core -ifneq ($(HAVE_ELF),y) - $(RM) $(TOPDIR)/include/float.h -endif +top_srcdir=../../../../ +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/m68k/clone.S b/libc/sysdeps/linux/m68k/clone.S index f2e0122da..916488146 100644 --- a/libc/sysdeps/linux/m68k/clone.S +++ b/libc/sysdeps/linux/m68k/clone.S @@ -5,6 +5,7 @@ and invokes a function in the right context after its all over. */ #define _ERRNO_H +#include <features.h> #include <bits/errno.h> #include <sys/syscall.h> @@ -12,9 +13,6 @@ .text .align 4 -.type clone,@function -.globl clone; -clone: .type __clone,@function .globl __clone; __clone: @@ -82,4 +80,3 @@ thread_start: #else .set clone,__clone #endif - diff --git a/libc/sysdeps/linux/microblaze/bits/mman.h b/libc/sysdeps/linux/microblaze/bits/mman.h index 8c457158f..d051c8fa7 100644 --- a/libc/sysdeps/linux/microblaze/bits/mman.h +++ b/libc/sysdeps/linux/microblaze/bits/mman.h @@ -95,4 +95,5 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif diff --git a/libc/sysdeps/linux/mips/Makefile b/libc/sysdeps/linux/mips/Makefile index 6d51205e9..633c91f3e 100644 --- a/libc/sysdeps/linux/mips/Makefile +++ b/libc/sysdeps/linux/mips/Makefile @@ -1,91 +1,13 @@ # Makefile for uClibc # -# Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more -# details. -# -# You should have received a copy of the GNU Library General Public License -# along with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -TOPDIR=../../../../ -include $(TOPDIR)Rules.mak - -CRT_SRC = crt1.S -CRT_OBJ = crt1.o -SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o - -SSRC=bsd-_setjmp.S bsd-setjmp.S setjmp.S clone.S syscall.S pipe.S vfork.S -SOBJS=$(patsubst %.S,%.o, $(SSRC)) - -CSRC=__longjmp.c brk.c setjmp_aux.c mmap.c __syscall_error.c \ - cacheflush.c pread_write.c sysmips.c _test_and_set.c sigaction.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(SOBJS) $(COBJS) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) - $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/ - -$(CRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SCRT_OBJ): $(CRT_SRC) - $(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(SOBJS): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o - -$(TOPDIR)lib/crti.o: crti.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ - -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o - $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ -else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o -endif - -headers: - $(LN) -fs ../libc/sysdeps/linux/mips/sgidefs.h $(TOPDIR)/include/ - $(LN) -fs ../libc/sysdeps/linux/mips/fpu_control.h $(TOPDIR)/include/ - cp sysdep.h $(TOPDIR)/include/ -clean: - $(RM) *.o *~ core - $(RM) $(TOPDIR)/include/sgidefs.h $(TOPDIR)/include/sysdep.h +top_srcdir=../../../../ +top_builddir=../../../../ +all: objs +include $(top_builddir)Rules.mak +include Makefile.arch +include $(top_srcdir)Makerules diff --git a/libc/sysdeps/linux/mips/bits/kernel_types.h b/libc/sysdeps/linux/mips/bits/kernel_types.h index 3605b1644..f23b24874 100644 --- a/libc/sysdeps/linux/mips/bits/kernel_types.h +++ b/libc/sysdeps/linux/mips/bits/kernel_types.h @@ -14,7 +14,7 @@ typedef unsigned int __kernel_mode_t; typedef unsigned int __kernel_nlink_t; typedef long __kernel_off_t; typedef int __kernel_pid_t; -typedef int __kernel_ipc_pid_t; +typedef long int __kernel_ipc_pid_t; typedef int __kernel_uid_t; typedef int __kernel_gid_t; typedef unsigned long __kernel_size_t; @@ -50,7 +50,7 @@ typedef unsigned long __kernel_nlink_t; typedef long __kernel_off_t; typedef int __kernel_pid_t; -typedef int __kernel_ipc_pid_t; +typedef long int __kernel_ipc_pid_t; typedef int __kernel_uid_t; typedef int __kernel_gid_t; typedef unsigned int __kernel_size_t; diff --git a/libc/sysdeps/linux/mips/bits/mman.h b/libc/sysdeps/linux/mips/bits/mman.h index 61886e27e..33f9a11df 100644 --- a/libc/sysdeps/linux/mips/bits/mman.h +++ b/libc/sysdeps/linux/mips/bits/mman.h @@ -83,4 +83,5 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif diff --git a/libc/sysdeps/linux/nios/bits/mman.h b/libc/sysdeps/linux/nios/bits/mman.h index 34f14ee5b..7f644b99b 100644 --- a/libc/sysdeps/linux/nios/bits/mman.h +++ b/libc/sysdeps/linux/nios/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/nios2/bits/mman.h b/libc/sysdeps/linux/nios2/bits/mman.h index 34f14ee5b..7f644b99b 100644 --- a/libc/sysdeps/linux/nios2/bits/mman.h +++ b/libc/sysdeps/linux/nios2/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/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/powerpc/Makefile +++ b/libc/sysdeps/linux/powerpc/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/powerpc/bits/mman.h b/libc/sysdeps/linux/powerpc/bits/mman.h index 72c24132c..f92bc7fc3 100644 --- a/libc/sysdeps/linux/powerpc/bits/mman.h +++ b/libc/sysdeps/linux/powerpc/bits/mman.h @@ -73,6 +73,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/sh/Makefile b/libc/sysdeps/linux/sh/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/sh/Makefile +++ b/libc/sysdeps/linux/sh/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/sh/bits/mman.h b/libc/sysdeps/linux/sh/bits/mman.h index 1c17bf616..65eb86581 100644 --- a/libc/sysdeps/linux/sh/bits/mman.h +++ b/libc/sysdeps/linux/sh/bits/mman.h @@ -72,6 +72,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/sh/longjmp.c b/libc/sysdeps/linux/sh/longjmp.c index c36344cd1..ee3afcd74 100644 --- a/libc/sysdeps/linux/sh/longjmp.c +++ b/libc/sysdeps/linux/sh/longjmp.c @@ -33,7 +33,7 @@ void __libc_siglongjmp (sigjmp_buf env, int val) { if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ - (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, + (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, (sigset_t *) NULL); /* Call the machine-dependent function to restore machine state. */ diff --git a/libc/sysdeps/linux/sh64/bits/mman.h b/libc/sysdeps/linux/sh64/bits/mman.h index 3b18b2133..afa889dbf 100644 --- a/libc/sysdeps/linux/sh64/bits/mman.h +++ b/libc/sysdeps/linux/sh64/bits/mman.h @@ -75,6 +75,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/sparc/Makefile b/libc/sysdeps/linux/sparc/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/sparc/Makefile +++ b/libc/sysdeps/linux/sparc/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h index 12e9cffd2..5dc8bf32f 100644 --- a/libc/sysdeps/linux/sparc/bits/fcntl.h +++ b/libc/sysdeps/linux/sparc/bits/fcntl.h @@ -1,5 +1,6 @@ /* O_*, F_*, FD_* bit values for Linux/SPARC. - Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -43,7 +44,8 @@ #ifdef __USE_GNU # define O_DIRECTORY 0x10000 /* must be a directory */ # define O_NOFOLLOW 0x20000 /* don't follow links */ -# define O_STREAMING 0x4000000/* streaming access */ +# define O_DIRECT 0x100000 /* direct disk access hint */ +# define O_NOATIME 0x200000 /* Do not set atime. */ #endif #ifdef __USE_LARGEFILE64 @@ -76,7 +78,7 @@ #define F_SETFD 2 /* Set file descriptor flags. */ #define F_GETFL 3 /* Get file status flags. */ #define F_SETFL 4 /* Set file status flags. */ -#if defined __USE_BSD || defined __USE_XOPEN2K +#if defined __USE_BSD || defined __USE_UNIX98 # define F_GETOWN 5 /* Get owner of socket (receiver of SIGIO). */ # define F_SETOWN 6 /* Set owner of socket (receiver of SIGIO). */ #endif @@ -196,3 +198,11 @@ struct flock64 # define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ # define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ #endif + +__BEGIN_DECLS + +/* Provide kernel hint to read ahead. */ +extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) + __THROW; + +__END_DECLS diff --git a/libc/sysdeps/linux/sparc/bits/mman.h b/libc/sysdeps/linux/sparc/bits/mman.h index 7db39902d..26425876f 100644 --- a/libc/sysdeps/linux/sparc/bits/mman.h +++ b/libc/sysdeps/linux/sparc/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/SPARC version. - Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -34,6 +34,10 @@ #define PROT_WRITE 0x2 /* Page can be written. */ #define PROT_EXEC 0x4 /* Page can be executed. */ #define PROT_NONE 0x0 /* Page can not be accessed. */ +#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of + growsdown vma (mprotect only). */ +#define PROT_GROWSUP 0x02000000 /* Extend change to start of + growsup vma (mprotect only). */ /* Sharing types (must choose one and only one of these). */ #define MAP_SHARED 0x01 /* Share changes. */ @@ -53,12 +57,14 @@ /* These are Linux-specific. */ #ifdef __USE_MISC -# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */ +# define MAP_GROWSDOWN 0x0200 /* Stack-like segment. */ # define MAP_DENYWRITE 0x0800 /* ETXTBSY */ # define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ # define MAP_LOCKED 0x0100 /* Lock the mapping. */ # define MAP_NORESERVE 0x0040 /* Don't check for reservations. */ # define _MAP_NEW 0x80000000 /* Binary compatibility with SunOS. */ +# define MAP_POPULATE 0x8000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ #endif /* Flags to `msync'. */ @@ -74,6 +80,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/sparc/bits/resource.h b/libc/sysdeps/linux/sparc/bits/resource.h index 40c30d01d..3f2c60014 100644 --- a/libc/sysdeps/linux/sparc/bits/resource.h +++ b/libc/sysdeps/linux/sparc/bits/resource.h @@ -1,5 +1,6 @@ /* Bit values & structures for resource limits. Linux/SPARC version. - Copyright (C) 1994,1996,1997,1998,1999,2000 Free Software Foundation, Inc. + Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -55,34 +56,54 @@ enum __rlimit_resource This affects swapping; processes that are exceeding their resident set size will be more likely to have physical memory taken from them. */ - RLIMIT_RSS = 5, -#define RLIMIT_RSS RLIMIT_RSS + __RLIMIT_RSS = 5, +#define RLIMIT_RSS __RLIMIT_RSS /* Number of open files. */ RLIMIT_NOFILE = 6, - RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ + __RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */ #define RLIMIT_NOFILE RLIMIT_NOFILE -#define RLIMIT_OFILE RLIMIT_OFILE +#define RLIMIT_OFILE __RLIMIT_OFILE /* Address space limit (?) */ RLIMIT_AS = 9, #define RLIMIT_AS RLIMIT_AS /* Number of processes. */ - RLIMIT_NPROC = 7, -#define RLIMIT_NPROC RLIMIT_NPROC + __RLIMIT_NPROC = 7, +#define RLIMIT_NPROC __RLIMIT_NPROC /* Locked-in-memory address space. */ - RLIMIT_MEMLOCK = 8, -#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK + __RLIMIT_MEMLOCK = 8, +#define RLIMIT_MEMLOCK __RLIMIT_MEMLOCK /* Maximum number of file locks. */ - RLIMIT_LOCKS = 10, -#define RLIMIT_LOCKS RLIMIT_LOCKS - - RLIM_NLIMITS = 11 -#define RLIMIT_NLIMITS RLIMIT_NLIMITS -#define RLIM_NLIMITS RLIM_NLIMITS + __RLIMIT_LOCKS = 10, +#define RLIMIT_LOCKS __RLIMIT_LOCKS + + /* Maximum number of pending signals. */ + __RLIMIT_SIGPENDING = 11, +#define RLIMIT_SIGPENDING __RLIMIT_SIGPENDING + + /* Maximum bytes in POSIX message queues. */ + __RLIMIT_MSGQUEUE = 12, +#define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE + + /* Maximum nice priority allowed to raise to. + Nice levels 19 .. -20 correspond to 0 .. 39 + values of this resource limit. */ + __RLIMIT_NICE = 13, +#define RLIMIT_NICE __RLIMIT_NICE + + /* Maximum realtime priority allowed for non-priviledged + processes. */ + __RLIMIT_RTPRIO = 14, +#define RLIMIT_RTPRIO __RLIMIT_RTPRIO + + __RLIMIT_NLIMITS = 15, + __RLIM_NLIMITS = __RLIMIT_NLIMITS +#define RLIMIT_NLIMITS __RLIMIT_NLIMITS +#define RLIM_NLIMITS __RLIM_NLIMITS }; /* Value to indicate that there is no limit. */ @@ -153,12 +174,8 @@ enum __rusage_who #define RUSAGE_SELF RUSAGE_SELF /* All of its terminated child processes. */ - RUSAGE_CHILDREN = -1, + RUSAGE_CHILDREN = -1 #define RUSAGE_CHILDREN RUSAGE_CHILDREN - - /* Both. */ - RUSAGE_BOTH = -2 -#define RUSAGE_BOTH RUSAGE_BOTH }; #define __need_timeval diff --git a/libc/sysdeps/linux/sparc/bits/setjmp.h b/libc/sysdeps/linux/sparc/bits/setjmp.h index 574085664..dac9ac5cb 100644 --- a/libc/sysdeps/linux/sparc/bits/setjmp.h +++ b/libc/sysdeps/linux/sparc/bits/setjmp.h @@ -17,7 +17,7 @@ 02111-1307 USA. */ #ifndef _BITS_SETJMP_H -#define _BITS_SETJMP_H 1 +#define _BITS_SETJMP_H 1 #if !defined _SETJMP_H && !defined _PTHREAD_H # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead." @@ -77,8 +77,8 @@ typedef int __jmp_buf[3]; /* Test if longjmp to JMPBUF would unwind the frame containing a local variable at ADDRESS. */ #define _JMPBUF_UNWINDS(jmpbuf, address) \ - ((void *) (address) < (void *) (jmpbuf)[JB_SP]) + ((int) (address) < (jmpbuf)[JB_SP]) #endif -#endif /* bits/setjmp.h */ +#endif /* bits/setjmp.h */ diff --git a/libc/sysdeps/linux/sparc/bits/shm.h b/libc/sysdeps/linux/sparc/bits/shm.h index f075be8d8..03decb110 100644 --- a/libc/sysdeps/linux/sparc/bits/shm.h +++ b/libc/sysdeps/linux/sparc/bits/shm.h @@ -81,6 +81,7 @@ struct shmid_ds # define SHM_DEST 01000 /* segment will be destroyed on last detach */ # define SHM_LOCKED 02000 /* segment will not be swapped */ # define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ +# define SHM_NORESERVE 010000 /* don't check for reservations */ struct shminfo { diff --git a/libc/sysdeps/linux/sparc/bits/siginfo.h b/libc/sysdeps/linux/sparc/bits/siginfo.h index da2aed678..7ff1971c2 100644 --- a/libc/sysdeps/linux/sparc/bits/siginfo.h +++ b/libc/sysdeps/linux/sparc/bits/siginfo.h @@ -1,5 +1,5 @@ /* siginfo_t, sigevent and constants. Linux/SPARC version. - Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -69,8 +69,9 @@ typedef struct siginfo /* POSIX.1b timers. */ struct { - unsigned int _timer1; - unsigned int _timer2; + int si_tid; /* Timer ID. */ + int si_overrun; /* Overrun count. */ + sigval_t si_sigval; /* Signal value. */ } _timer; /* POSIX.1b signals. */ @@ -111,8 +112,8 @@ typedef struct siginfo /* X/Open requires some more fields with fixed names. */ # define si_pid _sifields._kill.si_pid # define si_uid _sifields._kill.si_uid -# define si_timer1 _sifields._timer._timer1 -# define si_timer2 _sifields._timer._timer2 +# define si_timerid _sifields._timer.si_tid +# define si_overrun _sifields._timer.si_overrun # define si_status _sifields._sigchld.si_status # define si_utime _sifields._sigchld.si_utime # define si_stime _sifields._sigchld.si_stime @@ -129,8 +130,10 @@ typedef struct siginfo signals. */ enum { - SI_ASYNCNL = -6, /* Sent by asynch name lookup completion. */ + SI_ASYNCNL = -60, /* Sent by asynch name lookup completion. */ # define SI_ASYNCNL SI_ASYNCNL + SI_TKILL = -6, /* Sent by tkill. */ +# define SI_TKILL SI_TKILL SI_SIGIO, /* Sent by queued SIGIO. */ # define SI_SIGIO SI_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ @@ -276,9 +279,6 @@ enum # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) # endif -/* Forward declaration of the `pthread_attr_t' type. */ -struct __pthread_attr_s; - typedef struct sigevent { sigval_t sigev_value; @@ -291,8 +291,8 @@ typedef struct sigevent struct { - void (*_function) (sigval_t); /* Function to start. */ - struct __pthread_attr_s *_attribute; /* Really pthread_attr_t. */ + void (*_function) (sigval_t); /* Function to start. */ + void *_attribute; /* Really pthread_attr_t. */ } _sigev_thread; } _sigev_un; } sigevent_t; @@ -308,8 +308,11 @@ enum # define SIGEV_SIGNAL SIGEV_SIGNAL SIGEV_NONE, /* Other notification: meaningless. */ # define SIGEV_NONE SIGEV_NONE - SIGEV_THREAD /* Deliver via thread creation. */ + SIGEV_THREAD, /* Deliver via thread creation. */ # define SIGEV_THREAD SIGEV_THREAD + + SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */ +#define SIGEV_THREAD_ID SIGEV_THREAD_ID }; #endif /* have _SIGNAL_H. */ diff --git a/libc/sysdeps/linux/sparc/bits/signum.h b/libc/sysdeps/linux/sparc/bits/signum.h index 48d39402d..6b58ec29d 100644 --- a/libc/sysdeps/linux/sparc/bits/signum.h +++ b/libc/sysdeps/linux/sparc/bits/signum.h @@ -1,5 +1,5 @@ /* Signal number definitions. Linux/SPARC version. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -70,7 +70,7 @@ #define SIGUSR1 30 #define SIGUSR2 31 -#define _NSIG 64 /* Biggest signal number + 1 +#define _NSIG 65 /* Biggest signal number + 1 (including real-time signals). */ #define SIGRTMIN (__libc_current_sigrtmin ()) diff --git a/libc/sysdeps/linux/sparc/bits/stat.h b/libc/sysdeps/linux/sparc/bits/stat.h index aefcf9ee1..cc454117b 100644 --- a/libc/sysdeps/linux/sparc/bits/stat.h +++ b/libc/sysdeps/linux/sparc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1992,95,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -61,11 +61,11 @@ struct stat __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ #endif __time_t st_atime; /* Time of last access. */ - unsigned long int __unused1; + unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ - unsigned long int __unused2; + unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ - unsigned long int __unused3; + unsigned long int st_ctimensec; /* Nsecs of last status change. */ unsigned long int __unused4; unsigned long int __unused5; }; @@ -89,11 +89,11 @@ struct stat64 __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ __time_t st_atime; /* Time of last access. */ - unsigned long int __unused1; + unsigned long int st_atimensec; /* Nscecs of last access. */ __time_t st_mtime; /* Time of last modification. */ - unsigned long int __unused2; + unsigned long int st_mtimensec; /* Nsecs of last modification. */ __time_t st_ctime; /* Time of last status change. */ - unsigned long int __unused3; + unsigned long int st_ctimensec; /* Nsecs of last status change. */ unsigned long int __unused4; unsigned long int __unused5; }; @@ -102,6 +102,8 @@ struct stat64 /* Tell code we have these members. */ #define _STATBUF_ST_BLKSIZE #define _STATBUF_ST_RDEV +/* Nanosecond resolution time values are supported. */ +#define _STATBUF_ST_NSEC /* Encoding of the file mode. */ diff --git a/libc/sysdeps/linux/sparc/bits/termios.h b/libc/sysdeps/linux/sparc/bits/termios.h index 409ed233d..cea13227f 100644 --- a/libc/sysdeps/linux/sparc/bits/termios.h +++ b/libc/sysdeps/linux/sparc/bits/termios.h @@ -1,5 +1,6 @@ /* termios type and macro definitions. Linux/SPARC version. - Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2005 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -73,6 +74,7 @@ struct termios #define IXANY 0x00000800 #define IXOFF 0x00001000 #define IMAXBEL 0x00002000 +#define IUTF8 0x00004000 /* c_oflag bits */ #define OPOST 0x00000001 @@ -83,34 +85,41 @@ struct termios #define ONLRET 0x00000020 #define OFILL 0x00000040 #define OFDEL 0x00000080 -#define NLDLY 0x00000100 -#define NL0 0x00000000 -#define NL1 0x00000100 -#define CRDLY 0x00000600 -#define CR0 0x00000000 -#define CR1 0x00000200 -#define CR2 0x00000400 -#define CR3 0x00000600 -#define TABDLY 0x00001800 -#define TAB0 0x00000000 -#define TAB1 0x00000800 -#define TAB2 0x00001000 -#define TAB3 0x00001800 -#define XTABS 0x00001800 -#define BSDLY 0x00002000 -#define BS0 0x00000000 -#define BS1 0x00002000 -#define VTDLY 0x00004000 -#define VT0 0x00000000 -#define VT1 0x00004000 +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 0x00000100 +# define NL0 0x00000000 +# define NL1 0x00000100 +# define CRDLY 0x00000600 +# define CR0 0x00000000 +# define CR1 0x00000200 +# define CR2 0x00000400 +# define CR3 0x00000600 +# define TABDLY 0x00001800 +# define TAB0 0x00000000 +# define TAB1 0x00000800 +# define TAB2 0x00001000 +# define TAB3 0x00001800 +# define BSDLY 0x00002000 +# define BS0 0x00000000 +# define BS1 0x00002000 #define FFDLY 0x00008000 #define FF0 0x00000000 #define FF1 0x00008000 +#endif +#define VTDLY 0x00004000 +#define VT0 0x00000000 +#define VT1 0x00004000 #define PAGEOUT 0x00010000 /* SUNOS specific */ #define WRAP 0x00020000 /* SUNOS specific */ +#ifdef __USE_MISC +# define XTABS 0x00001800 +#endif + /* c_cflag bit meaning */ -#define CBAUD 0x0000100f +#ifdef __USE_MISC +# define CBAUD 0x0000100f +#endif #define B0 0x00000000 /* hang up */ #define B50 0x00000001 #define B75 0x00000002 @@ -127,8 +136,10 @@ struct termios #define B9600 0x0000000d #define B19200 0x0000000e #define B38400 0x0000000f -#define EXTA B19200 -#define EXTB B38400 +#ifdef __USE_MISC +# define EXTA B19200 +# define EXTB B38400 +#endif #define CSIZE 0x00000030 #define CS5 0x00000000 #define CS6 0x00000010 @@ -140,7 +151,9 @@ struct termios #define PARODD 0x00000200 #define HUPCL 0x00000400 #define CLOCAL 0x00000800 -#define CBAUDEX 0x00001000 +#ifdef __USE_MISC +# define CBAUDEX 0x00001000 +#endif #define B57600 0x00001001 #define B115200 0x00001002 #define B230400 0x00001003 @@ -158,26 +171,32 @@ struct termios #define B2000000 0x0000100f #define __MAX_BAUD B2000000 -#define CIBAUD 0x100f0000 /* input baud rate (not used) */ -#define CMSPAR 0x40000000 /* mark or space (stick) parity */ -#define CRTSCTS 0x80000000 /* flow control */ +#ifdef __USE_MISC +# define CIBAUD 0x100f0000 /* input baud rate (not used) */ +# define CMSPAR 0x40000000 /* mark or space (stick) parity */ +# define CRTSCTS 0x80000000 /* flow control */ +#endif /* c_lflag bits */ #define ISIG 0x00000001 #define ICANON 0x00000002 -#define XCASE 0x00000004 +#if defined __USE_MISC || defined __USE_XOPEN +# define XCASE 0x00000004 +#endif #define ECHO 0x00000008 #define ECHOE 0x00000010 #define ECHOK 0x00000020 #define ECHONL 0x00000040 #define NOFLSH 0x00000080 #define TOSTOP 0x00000100 -#define ECHOCTL 0x00000200 -#define ECHOPRT 0x00000400 -#define ECHOKE 0x00000800 -#define DEFECHO 0x00001000 /* SUNOS thing, what is it? */ -#define FLUSHO 0x00002000 -#define PENDIN 0x00004000 +#ifdef __USE_MISC +# define ECHOCTL 0x00000200 +# define ECHOPRT 0x00000400 +# define ECHOKE 0x00000800 +# define DEFECHO 0x00001000 /* SUNOS thing, what is it? */ +# define FLUSHO 0x00002000 +# define PENDIN 0x00004000 +#endif #define IEXTEN 0x00008000 /* modem lines */ diff --git a/libc/sysdeps/linux/sparc/sys/procfs.h b/libc/sysdeps/linux/sparc/sys/procfs.h index e5d35f524..2827b1ec3 100644 --- a/libc/sysdeps/linux/sparc/sys/procfs.h +++ b/libc/sysdeps/linux/sparc/sys/procfs.h @@ -35,7 +35,7 @@ __BEGIN_DECLS #if __WORDSIZE == 64 -#define ELF_NGREG 20 +#define ELF_NGREG 36 typedef struct { @@ -139,6 +139,73 @@ typedef __pid_t lwpid_t; typedef struct elf_prstatus prstatus_t; typedef struct elf_prpsinfo prpsinfo_t; +#if __WORDSIZE == 64 + +/* Provide 32-bit variants so that BFD can read 32-bit + core files. */ +#define ELF_NGREG32 38 +typedef struct + { + union + { + unsigned int pr_regs[32]; + double pr_dregs[16]; + } pr_fr; + unsigned int __unused; + unsigned int pr_fsr; + unsigned char pr_qcnt; + unsigned char pr_q_entrysize; + unsigned char pr_en; + unsigned int pr_q[64]; + } elf_fpregset_t32; + +typedef unsigned int elf_greg_t32; +typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG32]; + +struct elf_prstatus32 + { + struct elf_siginfo pr_info; /* Info associated with signal. */ + short int pr_cursig; /* Current signal. */ + unsigned int pr_sigpend; /* Set of pending signals. */ + unsigned int pr_sighold; /* Set of held signals. */ + __pid_t pr_pid; + __pid_t pr_ppid; + __pid_t pr_pgrp; + __pid_t pr_sid; + struct + { + int tv_sec, tv_usec; + } pr_utime, /* User time. */ + pr_stime, /* System time. */ + pr_cutime, /* Cumulative user time. */ + pr_cstime; /* Cumulative system time. */ + elf_gregset_t32 pr_reg; /* GP registers. */ + int pr_fpvalid; /* True if math copro being used. */ + }; + +struct elf_prpsinfo32 + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned int pr_flag; /* Flags. */ + unsigned short int pr_uid; + unsigned short int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + /* Lots missing */ + char pr_fname[16]; /* Filename of executable. */ + char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ + }; + +typedef elf_gregset_t32 prgregset32_t; +typedef elf_fpregset_t32 prfpregset32_t; + +typedef struct elf_prstatus32 prstatus32_t; +typedef struct elf_prpsinfo32 prpsinfo32_t; + +#endif /* sparc64 */ + __END_DECLS #endif /* sys/procfs.h */ diff --git a/libc/sysdeps/linux/v850/bits/mman.h b/libc/sysdeps/linux/v850/bits/mman.h index b32e636c9..4393d0344 100644 --- a/libc/sysdeps/linux/v850/bits/mman.h +++ b/libc/sysdeps/linux/v850/bits/mman.h @@ -95,4 +95,5 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif diff --git a/libc/sysdeps/linux/x86_64/Makefile b/libc/sysdeps/linux/x86_64/Makefile index b1bf1ef10..633c91f3e 100644 --- a/libc/sysdeps/linux/x86_64/Makefile +++ b/libc/sysdeps/linux/x86_64/Makefile @@ -5,9 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -TOPDIR=../../../../ - -top_srcdir=$(TOPDIR) +top_srcdir=../../../../ top_builddir=../../../../ all: objs include $(top_builddir)Rules.mak diff --git a/libc/sysdeps/linux/x86_64/bits/mman.h b/libc/sysdeps/linux/x86_64/bits/mman.h index a7bac2693..c25900372 100644 --- a/libc/sysdeps/linux/x86_64/bits/mman.h +++ b/libc/sysdeps/linux/x86_64/bits/mman.h @@ -79,6 +79,7 @@ /* Flags for `mremap'. */ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 +# define MREMAP_FIXED 2 #endif /* Advice to `madvise'. */ diff --git a/libc/sysdeps/linux/x86_64/bits/wordsize.h b/libc/sysdeps/linux/x86_64/bits/wordsize.h index a40a0d816..e96a9f1ad 100644 --- a/libc/sysdeps/linux/x86_64/bits/wordsize.h +++ b/libc/sysdeps/linux/x86_64/bits/wordsize.h @@ -2,7 +2,6 @@ #if defined __x86_64__ # define __WORDSIZE 64 -# define __WORDSIZE_COMPAT32 1 #else # define __WORDSIZE 32 #endif diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c index 3ea9ad7d3..ac10bc5aa 100644 --- a/libc/sysdeps/linux/x86_64/sigaction.c +++ b/libc/sysdeps/linux/x86_64/sigaction.c @@ -17,30 +17,42 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ + #include <errno.h> +#include <stddef.h> #include <signal.h> #include <string.h> + + #include <sys/syscall.h> + + + +/* The difference here is that the sigaction structure used in the + kernel is not the same as we use in the libc. Therefore we must + translate it here. */ #include <bits/kernel_sigaction.h> +/* We do not globally define the SA_RESTORER flag so do it here. */ #define SA_RESTORER 0x04000000 - #if defined __NR_rt_sigaction -#warning Yes there are two warnings here. Don't worry about it. -static void restore_rt (void) asm ("__restore_rt"); -static void restore (void) asm ("__restore"); +/* Using the hidden attribute here does not change the code but it + helps to avoid warnings. */ +extern void restore_rt (void) asm ("__restore_rt") attribute_hidden; +extern void restore (void) asm ("__restore") attribute_hidden; /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ -int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) +int +__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) { int result; struct kernel_sigaction kact, koact; if (act) { kact.k_sa_handler = act->sa_handler; - memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + __memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); kact.sa_flags = act->sa_flags | SA_RESTORER; kact.sa_restorer = &restore_rt; @@ -53,7 +65,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); if (oact && result >= 0) { oact->sa_handler = koact.k_sa_handler; - memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); + __memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); oact->sa_flags = koact.sa_flags; oact->sa_restorer = koact.sa_restorer; } @@ -61,12 +73,12 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa } #else -#warning "Yes there is a warning here. Don't worry about it." -static void restore (void) asm ("__restore"); +extern void restore (void) asm ("__restore") attribute_hidden; /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ -int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) +int +__libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) { int result; struct old_kernel_sigaction kact, koact; @@ -106,9 +118,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa } #endif -#ifndef LIBC_SIGACTION weak_alias (__libc_sigaction, sigaction) -#endif /* NOTE: Please think twice before making any changes to the bits of code below. GDB needs some intimate knowledge about it to |