]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20041018T0940
authorJakub Jelinek <jakub@redhat.com>
Wed, 20 Oct 2004 10:47:20 +0000 (10:47 +0000)
committerJakub Jelinek <jakub@redhat.com>
Wed, 20 Oct 2004 10:47:20 +0000 (10:47 +0000)
22 files changed:
ChangeLog
NEWS
debug/Makefile
debug/catchsegv.sh
elf/Versions
elf/dl-addr.c
elf/dl-debug.c
linuxthreads/ChangeLog
linuxthreads/Makefile
linuxthreads/sysdeps/i386/i686/pt-machine.h
linuxthreads/sysdeps/i386/tls.h
manual/errno.texi
nss/getent.c
sysdeps/generic/ldsodefs.h
sysdeps/generic/readonly-area.c
sysdeps/gnu/Makefile
sysdeps/gnu/errlist-compat.awk
sysdeps/gnu/errlist.awk
sysdeps/gnu/errlist.c
sysdeps/mach/readonly-area.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/Versions
sysdeps/unix/sysv/linux/syscalls.list

index 5d8010ef22ac4a9d42c896090b0f97ddc9ed09a3..35e9f5b80592284d1cd474fc70948c778f56b1d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+2004-10-20  Roland McGrath  <roland@redhat.com>
+
+       * manual/errno.texi (Error Codes): Add ENOKEY, EKEYEXPIRED,
+       EKEYREVOKED, EKEYREJECTED.
+       * sysdeps/unix/sysv/linux/Versions (libc: GLIBC_2.3.4): New errlist.
+       * sysdeps/gnu/errlist.c: Regenerated
+
+       * sysdeps/gnu/errlist-compat.awk: Don't bail if Versions gives a count
+       higher than ERR_MAX reports.  Instead, emit a #define ERR_MAX.
+       * sysdeps/gnu/Makefile ($(objpfx)errlist-compat.h): New target.
+       (generated): Add errlist-compat.h.
+       * sysdeps/gnu/errlist.awk: Make output #include <errlist-compat.h> to
+       define ERR_MAX and use that for table size.
+
+2004-10-20  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/syscalls.list: Add entries for setaltroot,
+       key_add, key_request, and keyctl syscalls.
+       * sysdeps/unix/sysv/linux/Versions: Export them.
+
+2004-10-19  Roland McGrath  <roland@frob.com>
+
+       * sysdeps/mach/readonly-area.c: New file.
+
+2004-10-19  Ulrich Drepper  <drepper@redhat.com>
+
+       * elf/Versions [ld, GLIBC_PRIVATE]: Add _dl_debug_state.
+       * elf/dl-debug.c (_dl_debug_state): Add rtld_hidden_def.
+       * sysdeps/generic/ldsodefs.h (_dl_debug_state): Don't mark as
+       hidden but use rtld_hidden_proto.
+
+2004-10-19  Alfred M. Szmidt  <ams@gnu.org>
+
+       * sysdeps/generic/readonly-area.c (__readonly_str): Renamed to ...
+       (__readonly_area): ... this.
+
+2004-10-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/generic/strcpy_chk.c (__strcpy_chk): Speed up by checking
+       destlen only every 4 bytes.
+
+2004-10-19  Ulrich Drepper  <drepper@redhat.com>
+
+       * nss/getent.c (hosts_keys): Let inet_pton decide whether the
+       string is an address or not.
+
+2004-10-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/dl-addr.c (_dl_addr): Don't look at STT_TLS symbols.
+       Use DL_SYMBOL_ADDRESS to set dli_saddr.
+
+       * debug/Makefile (catchsegv): Prefix $LIB with a backslash.
+
+2004-10-19  Ulrich Drepper  <drepper@redhat.com>
+
+       * debug/Makefile ($(objpfx)catchsegv): To support multilib
+       platforms, use $LIB in path to slibdir.
+
+2004-10-19  Jakub Jelinek  <jakub@redhat.com>
+
+       * debug/catchsegv.sh: Update copyright year.
+       Use mktemp to create segv_output file.
+
 2004-10-19  Jakub Jelinek  <jakub@redhat.com>
 
        * include/features.h (__USE_FORTIFY_LEVEL): Enable even with
diff --git a/NEWS b/NEWS
index 126107f57ad04cbd81a1191d2abcdbd2606c1f1c..236c4378f80f3e43107858df12f68b07b6bcf643 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2004-8-5
+GNU C Library NEWS -- history of user-visible changes.  2004-10-19
 Copyright (C) 1992-2002,2003,2004 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -17,7 +17,7 @@ Version 2.3.4
 * nscd can now perform SELinux checks.
   Implemented by Matthew Rickard <mjricka@epoch.ncsc.mil>.
 
-* getaddrinfo queries are not cached.  Canonical name lookup is performed
+* getaddrinfo queries are now cached.  Canonical name lookup is performed
   efficiently.
   Implemented by Ulrich Drepper.
 
@@ -27,10 +27,20 @@ Version 2.3.4
 
 * The malloc functions perform more error checking and are stricter when
   it comes to reacting on errors.  The default action is to terminate
-  the process after showing an error message.
+  the process after showing an error message.  Implemented by Ulrich Drepper.
 
 * Reverse lookups of IPv6 addresses does not use bit string or .ip6.int
-  lookups anymore unless explicitly requested.
+  lookups anymore unless explicitly requested.  Implemented by Ulrich Drepper.
+
+* Namespaces in ld.so are implemented.  DSOs can be loaded in separate
+  namespaces using the new function dlmopen().  This feature is of course,
+  like most other dynamic loading functionality, not available in statically
+  linked applications.  Implemented by Ulrich Drepper.
+
+* Low-overhead boundary checking variants of string and some stdio functions
+  were added.  These are to be used in conjunction with a gcc patch by
+  Jakub Jelinek which adds calls to these functions if possible.
+  Patch by Jakub Jelinek and Ulrich Drepper.
 \f
 Version 2.3.3
 
index fed60d78b59dd34b3f97748a30f3d3f747aa3a6e..6df06116b712b8af9f275173537684e17301a478 100644 (file)
@@ -38,7 +38,7 @@ CFLAGS-vsprintf_chk.c = -D_IO_MTSAFE_IO
 CFLAGS-vsnprintf_chk.c = -D_IO_MTSAFE_IO
 CFLAGS-printf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
 CFLAGS-fprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions) 
+CFLAGS-vprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
 CFLAGS-vfprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
 CFLAGS-gets_chk.c = -D_IO_MTSAFE_IO $(exceptions)
 
@@ -72,7 +72,8 @@ include ../Rules
 
 $(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
                    $(common-objpfx)config.make
-       sed -e 's|@VERSION@|$(version)|' -e 's|@SLIB@|$(slibdir)|' $< > $@.new
+       slibpfx=`echo $(slibdir)|sed 's/lib\(64\|\)$$/\\\\\\\\$$LIB/'`; \
+       sed -e 's|@VERSION@|$(version)|' -e "s|@SLIB@|$$slibpfx|" $< > $@.new
        chmod 555 $@.new
        mv -f $@.new $@
 
index 853b108609d28b0d6bcfc43599a4811f67adcbba..14556f712a2b35f6f69243fda036492b1649d426 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -39,7 +39,7 @@ if test $# -eq 0; then
       ;;
     --v | --ve | --ver | --vers | --versi | --versio | --version)
       echo 'catchsegv (GNU libc) @VERSION@'
-      echo 'Copyright (C) 2003 Free Software Foundation, Inc.
+      echo 'Copyright (C) 2004 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 Written by Ulrich Drepper.'
@@ -50,9 +50,7 @@ Written by Ulrich Drepper.'
   esac
 fi
 
-segv_output=`basename "$prog"`.segv.$$
-# Make sure this output file does not exist.
-rm -f "$segv_output"
+segv_output=`mktemp ${TMPDIR:-/tmp}/segv_output.XXXXXX` || exit
 
 # Redirect stderr to avoid termination message from shell.
 (exec 3>&2 2>/dev/null
@@ -65,7 +63,7 @@ exval=$?
 # Check for output.  Even if the program terminated correctly it might
 # be that a minor process (clone) failed.  Therefore we do not check the
 # exit code.
-if test -f "$segv_output"; then
+if test -s "$segv_output"; then
   # The program caught a signal.  The output is in the file with the
   # name we have in SEGFAULT_OUTPUT_NAME.  In the output the names of
   # functions in shared objects are available, but names in the static
@@ -102,7 +100,7 @@ if test -f "$segv_output"; then
            ;;
      esac
    done)
-   rm -f "$segv_output"
 fi
+rm -f "$segv_output"
 
 exit $exval
index 3797cc4eee0e93d9defae1ac7d99f06dde78ea27..e24b2de04cbc078624ae700044242a50b5ee75c7 100644 (file)
@@ -54,5 +54,7 @@ ld {
     _dl_get_tls_static_info; _dl_allocate_tls_init;
     _dl_tls_setup; _dl_rtld_di_serinfo;
     _dl_make_stack_executable;
+    # Only here for gdb while a better method is developed.
+    _dl_debug_state;
   }
 }
index c418784b4ff88eb6848e5758ba74de65bb407ad2..685cab9be8cce87099d18d4da5515a38c35e8dc9 100644 (file)
@@ -92,6 +92,9 @@ _dl_addr (const void *address, Dl_info *info,
         dynamic symbol table!!  */
       for (matchsym = NULL; (void *) symtab < (void *) symtabend; ++symtab)
        if (addr >= match->l_addr + symtab->st_value
+#if defined USE_TLS
+           && ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
+#endif
            && ((symtab->st_size == 0
                 && addr == match->l_addr + symtab->st_value)
                || addr < match->l_addr + symtab->st_value + symtab->st_size)
@@ -110,8 +113,10 @@ _dl_addr (const void *address, Dl_info *info,
        {
          /* We found a symbol close by.  Fill in its name and exact
             address.  */
+         lookup_t matchl = LOOKUP_VALUE (match);
+
          info->dli_sname = strtab + matchsym->st_name;
-         info->dli_saddr = (void *) (match->l_addr + matchsym->st_value);
+         info->dli_saddr = DL_SYMBOL_ADDRESS (matchl, matchsym);
        }
       else
        {
index 2e7b9e84b9b5233e488a51beee78c9025bf68a48..bd6ee69189ccda38011c6f045419df9ad2650610 100644 (file)
@@ -57,3 +57,4 @@ void
 _dl_debug_state (void)
 {
 }
+rtld_hidden_def (_dl_debug_state)
index bfccc57eb73f6d77982475d8cf8fd10c64263a0a..e15dc08a10222105bcc9443dc3388ac71c245964 100644 (file)
@@ -1,3 +1,12 @@
+2004-10-18  Roland McGrath  <roland@redhat.com>
+
+       [BZ #406]
+       * Makefile (linuxthreads-CPPFLAGS): New variable;
+       adds -DIS_IN_linuxthreads=1.
+       * sysdeps/i386/tls.h: Protect "useldt.h" with
+       [!IS_IN_linuxthreads && !DO_MODIFY_LDT].
+       * sysdeps/i386/i686/pt-machine.h: Revert last change.
+
 2004-10-14  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/pthread/errno-loc.c: Don't undef #errno
index 5bf558334d35f80906b3a1232685b1e9b37e8da0..75e6852733fd5b2d162722cac2922aee62bd9200 100644 (file)
@@ -65,6 +65,8 @@ libpthread-static-only-routines = pthread_atfork
 
 libpthread-nonshared = pthread_atfork
 
+linuxthreads-CPPFLAGS = -DIS_IN_linuxthreads=1
+
 CFLAGS-pthread_atfork.c = -DNOT_IN_libc
 
 nodelete-yes = -Wl,--enable-new-dtags,-z,nodelete
index 6048bc448f36b6c48b6606a26965bd6eda14ef78..1c75bf98077f5e03e02734d490dd307cb90641c9 100644 (file)
@@ -1,6 +1,6 @@
 /* Machine-dependent pthreads configuration and inline functions.
    i686 version.
-   Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson <rth@tamu.edu>.
 
index c1f47ca864fe07643e51cb53745da36efdee04dd..d296340ad8c475501fbf11d4bf458443027de71c 100644 (file)
@@ -120,7 +120,7 @@ typedef struct
 #   define TLS_LOAD_EBX
 #  endif
 
-#  ifndef THREAD_SELF
+#  if !defined IS_IN_linuxthreads && !defined DO_MODIFY_LDT
 #   include "useldt.h"         /* For the structure.  */
 #  endif
 #  if __ASSUME_LDT_WORKS > 0
index c799d268f89762e440d08e6aee335dd6fd88f3ce..7872452df3bce46b7312c42c5b37290e432e36a7 100644 (file)
@@ -1229,6 +1229,30 @@ They are not yet documented.}
 @comment errno ???/???
 @end deftypevr
 
+@comment errno.h
+@comment Linux???: Required key not available
+@deftypevr Macro int ENOKEY
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux???: Key has expired
+@deftypevr Macro int EKEYEXPIRED
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux???: Key has been revoked
+@deftypevr Macro int EKEYREVOKED
+@comment errno ???/???
+@end deftypevr
+
+@comment errno.h
+@comment Linux???: Key was rejected by service
+@deftypevr Macro int EKEYREJECTED
+@comment errno ???/???
+@end deftypevr
+
 @node Error Messages,  , Error Codes, Error Reporting
 @section Error Messages
 
index f9f0a6e22ac9957971ef459630144095be0dab96..c0a273241fc014cd46323e9431370d5341fa5164 100644 (file)
@@ -276,19 +276,12 @@ hosts_keys (int number, char *key[])
   for (i = 0; i < number; ++i)
     {
       struct hostent *host = NULL;
+      char addr[IN6ADDRSZ];
 
-      if (strchr (key[i], ':') != NULL)
-       {
-         char addr[IN6ADDRSZ];
-         if (inet_pton (AF_INET6, key[i], &addr))
-           host = gethostbyaddr (addr, sizeof (addr), AF_INET6);
-       }
-      else if (isdigit (key[i][0]))
-       {
-         char addr[INADDRSZ];
-         if (inet_pton (AF_INET, key[i], &addr))
-           host = gethostbyaddr (addr, sizeof (addr), AF_INET);
-       }
+      if (inet_pton (AF_INET6, key[i], &addr) > 0)
+       host = gethostbyaddr (addr, sizeof (addr), AF_INET6);
+      else if (inet_pton (AF_INET, key[i], &addr) > 0)
+       host = gethostbyaddr (addr, sizeof (addr), AF_INET);
       else if ((host = gethostbyname2 (key[i], AF_INET6)) == NULL)
        host = gethostbyname2 (key[i], AF_INET);
 
index f1062e7fa6458ccdb2ab86b287bb25310761202d..fd45bdc87fda6d526a2b08d405484bda0d5cea60 100644 (file)
@@ -785,7 +785,8 @@ extern void _dl_fini (void) internal_function;
    any shared object mappings.  The `r_state' member of `struct r_debug'
    says what change is taking place.  This function's address is
    the value of the `r_brk' member.  */
-extern void _dl_debug_state (void) attribute_hidden;
+extern void _dl_debug_state (void);
+rtld_hidden_proto (_dl_debug_state)
 
 /* Initialize `struct r_debug' if it has not already been done.  The
    argument is the run-time load address of the dynamic linker, to be put
index df5b96015c072704a1697ce889e043f8f651f9b5..4b8172f1935a56f23360e7cbf8d85b19b4cbc3c4 100644 (file)
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <stdlib.h>
+
 /* Return 1 if the whole area PTR .. PTR+SIZE is not writable.
    Return -1 if it is writable.  */
 
-#include <stdlib.h>
-
 int
-__readonly_str (const void *ptr, size_t size)
+__readonly_area (const void *ptr, size_t size)
 {
-  /* The conservative answer is that all strings are writable.  */
-  return -1;
+  /* We cannot determine in general whether memory is writable or not.
+     This must be handled in a system-dependent manner.  to not
+     unconditionally break code we need to return here a positive
+     answer.  This disables this security measure but that is the
+     price people have to pay for using systems without a real
+     implementation of this interface.  */
+  return 1;
 }
index dee0c67bcf3dbbda54f3c8f86b9e77d41f7231eb..0fc33213ae9e782a8fe51ccf0db167a98578d61b 100644 (file)
@@ -49,10 +49,14 @@ endif
 # Make it unwritable so noone will edit it by mistake.
        -chmod a-w $@T
        mv -f $@T $@
-generated += errlist-compat.c
+$(objpfx)errlist-compat.h: $(objpfx)errlist-compat.c
+       sed -n '1p;/ERR_MAX/p' $< > $@T
+       -chmod a-w $@T
+       mv -f $@T $@
+generated += errlist-compat.c errlist-compat.h
 
 # This will force the generation above to happy if need be.
-$(foreach o,.d $(object-suffixes),$(objpfx)errlist$o):$(objpfx)errlist-compat.c
+$(foreach o,.d $(object-suffixes),$(objpfx)errlist$o):$(objpfx)errlist-compat.h
 endif
 
 ifeq ($(subdir),login)
index b243a96bc4b7c4543d1a80fd3eec743a62e404a6..db827f3f7024fe9031c7a55c71aa26e3c4ebfeec 100644 (file)
@@ -1,5 +1,5 @@
 # awk script to generate errlist-compat.c
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
@@ -59,7 +59,7 @@ END {
 
   count = maxerr + 1;
 
-  if (highest != count) {
+  if (highest < count) {
     printf "*** errlist.c count %d vs Versions sys_errlist@%s count %d\n", \
       count, highest_version, highest > "/dev/stderr";
     exit 1;
@@ -79,6 +79,12 @@ END {
   print "/* This file was generated by errlist-compat.awk; DO NOT EDIT!  */\n";
   print "#include <shlib-compat.h>\n";
 
+  if (highest > count) {
+    printf "*** errlist.c count %d inflated to %s count %d (old errno.h?)\n", \
+      count, highest_version, highest > "/dev/stderr";
+    printf "#define ERR_MAX %d\n\n", highest;
+  }
+
   for (old in compat) {
     new = compat[old];
     n = vcount[old];
index 952cb8073cf1fe8f12e1ac6484f37f454eb8ba41..3f074ed482c9c817281e463433aad5b772c6174b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-1999, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1991-1999,2002,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
@@ -47,7 +47,16 @@ BEGIN {
     print "#endif";
     print "";
 
-    print "const char *const _sys_errlist_internal[] =";
+    print "#if !defined EMIT_ERR_MAX && !defined ERRLIST_NO_COMPAT";
+    print "# include <errlist-compat.h>";
+    print "#endif";
+    print "#ifdef ERR_MAX";
+    print "# define ERRLIST_SIZE ERR_MAX + 1";
+    print "#else"
+    print "# define ERRLIST_SIZE";
+    print "#endif";
+
+    print "const char *const _sys_errlist_internal[ERRLIST_SIZE] =";
     print "  {";
     print "    [0] = N_(\"Success\"),"
   }
index 8131038047d5fbbb60cf0f66585dc61689b0176e..3098fc34c52163d8ca1e4283c7e386bb6a1191f8 100644 (file)
@@ -7,7 +7,15 @@
 # define ERR_REMAP(n) n
 #endif
 
-const char *const _sys_errlist_internal[] =
+#if !defined EMIT_ERR_MAX && !defined ERRLIST_NO_COMPAT
+# include <errlist-compat.h>
+#endif
+#ifdef ERR_MAX
+# define ERRLIST_SIZE ERR_MAX + 1
+#else
+# define ERRLIST_SIZE
+#endif
+const char *const _sys_errlist_internal[ERRLIST_SIZE] =
   {
     [0] = N_("Success"),
 #ifdef EPERM
@@ -1399,6 +1407,38 @@ TRANS error; @pxref{Cancel AIO Operations}. */
 # undef ERR_MAX
 # define ERR_MAX EMEDIUMTYPE
 # endif
+#endif
+#ifdef ENOKEY
+/* */
+    [ERR_REMAP (ENOKEY)] = N_("Required key not available"),
+# if ENOKEY > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX ENOKEY
+# endif
+#endif
+#ifdef EKEYEXPIRED
+/* */
+    [ERR_REMAP (EKEYEXPIRED)] = N_("Key has expired"),
+# if EKEYEXPIRED > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EKEYEXPIRED
+# endif
+#endif
+#ifdef EKEYREVOKED
+/* */
+    [ERR_REMAP (EKEYREVOKED)] = N_("Key has been revoked"),
+# if EKEYREVOKED > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EKEYREVOKED
+# endif
+#endif
+#ifdef EKEYREJECTED
+/* */
+    [ERR_REMAP (EKEYREJECTED)] = N_("Key was rejected by service"),
+# if EKEYREJECTED > ERR_MAX
+# undef ERR_MAX
+# define ERR_MAX EKEYREJECTED
+# endif
 #endif
   };
 
diff --git a/sysdeps/mach/readonly-area.c b/sysdeps/mach/readonly-area.c
new file mode 100644 (file)
index 0000000..afee7a4
--- /dev/null
@@ -0,0 +1,57 @@
+/* Test if a memory region is wholly unwritable.  Mach version.
+   Copyright (C) 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <mach.h>
+
+/* Return 1 if the whole area PTR .. PTR+SIZE is not writable.
+   Return -1 if it is writable.  */
+
+int
+__readonly_area (const char *ptr, size_t size)
+{
+  vm_address_t region_address = (uintptr_t) ptr;
+  vm_size_t region_length = size;
+  vm_prot_t protection;
+  vm_prot_t max_protection;
+  vm_inherit_t inheritance;
+  boolean_t is_shared;
+  mach_port_t object_name;
+  vm_offset_t offset;
+
+  while (__vm_region (__mach_task_self (),
+                     &region_address, &region_length,
+                     &protection, &max_protection, &inheritance, &is_shared,
+                     &object_name, &offset) == KERN_SUCCESS
+        && region_address <= (uintptr_t) ptr)
+    {
+      region_address += region_length;
+      if (region_address < (uintptr_t) ptr)
+       continue;
+
+      if (protection & VM_PROT_WRITE)
+       return -1;
+
+      if (region_address - (uintptr_t) ptr >= size)
+       break;
+    }
+
+  return 1;
+}
index 980724e51911678f31d6c9b87377b702d8fcaf45..2d38ed6247b7c4e61c2052995389c66260e34db1 100644 (file)
@@ -114,6 +114,12 @@ libc {
   }
   GLIBC_2.3.4 {
     sched_getaffinity; sched_setaffinity;
+
+    # new syscalls
+    setaltroot; add_key; request_key; keyctl;
+
+    #errlist-compat    129
+    _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
   GLIBC_PRIVATE {
     # functions used in other libraries
index 860094be50ffd0f1dd714c1fc96d2398a51bb0b7..dd229238c1c4e0302c9d9b72b079d36bfa8942f4 100644 (file)
@@ -1,5 +1,6 @@
 # File name    Caller  Syscall name    Args    Strong name     Weak names
 
+add_key                EXTRA   add_key         i:pppii add_key
 adjtimex       adjtime adjtimex        i:p     __adjtimex      adjtimex ntp_adjtime __adjtimex_internal
 bdflush                EXTRA   bdflush         i:ii    bdflush
 capget         EXTRA   capget          i:pp    capget
@@ -26,6 +27,7 @@ getsid                -       getsid          i:i     getsid
 init_module    EXTRA   init_module     5       init_module
 ioperm         -       ioperm          i:iii   ioperm
 iopl           -       iopl            i:i     iopl
+keyctl         EXTRA   keyctl          i:iiiii keyctl
 klogctl                EXTRA   syslog          i:isi   klogctl
 lchown         -       lchown          i:sii   __lchown        lchown
 posix_madvise  -       madvise         Vi:pii  posix_madvise
@@ -49,6 +51,8 @@ putpmsg               -       putpmsg         i:ippii putpmsg
 query_module   EXTRA   query_module    i:sipip query_module
 quotactl       EXTRA   quotactl        i:isip  quotactl
 remap_file_pages -     remap_file_pages i:piiii        __remap_file_pages remap_file_pages
+request_key    EXTRA   request_key     i:pppi  request_key
+setaltroot     EXTRA   setaltroot      i:p     setaltroot
 sched_getp     -       sched_getparam  i:ip    __sched_getparam        sched_getparam
 sched_gets     -       sched_getscheduler      i:i     __sched_getscheduler    sched_getscheduler
 sched_primax   -       sched_get_priority_max  i:i     __sched_get_priority_max        sched_get_priority_max