about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-06-27 09:15:54 +0000
committerJakub Jelinek <jakub@redhat.com>2005-06-27 09:15:54 +0000
commit5570fbd25a574d54ab135e1d3cdac0bc74029689 (patch)
tree6af711ed17dd644491e68d1a85c22e51bac87179 /sysdeps/unix/sysv/linux
parente4edec582dc1fb924a2cfbfb07409fd7b3c84a26 (diff)
downloadglibc-5570fbd25a574d54ab135e1d3cdac0bc74029689.tar.gz
glibc-5570fbd25a574d54ab135e1d3cdac0bc74029689.tar.xz
glibc-5570fbd25a574d54ab135e1d3cdac0bc74029689.zip
Updated to fedora-glibc-20050627T0850
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/resource.h2
-rw-r--r--sysdeps/unix/sysv/linux/bits/resource.h2
-rw-r--r--sysdeps/unix/sysv/linux/dl-osinfo.h22
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/resource.h2
4 files changed, 25 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/resource.h b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
index 8bbd301dd9..2163745840 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/resource.h
@@ -98,7 +98,7 @@ enum __rlimit_resource
   /* Maximum realtime priority allowed for non-priviledged
      processes.  */
   __RLIMIT_RTPRIO = 14,
-#define RLIMIT_RTPRIO _RLIMIT_RTPRIO
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
 
   __RLIMIT_NLIMITS = 15,
   __RLIM_NLIMITS = __RLIMIT_NLIMITS
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index 115739d439..526cdaf53c 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -98,7 +98,7 @@ enum __rlimit_resource
   /* Maximum realtime priority allowed for non-priviledged
      processes.  */
   __RLIMIT_RTPRIO = 14,
-#define RLIMIT_RTPRIO _RLIMIT_RTPRIO
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
 
   __RLIMIT_NLIMITS = 15,
   __RLIM_NLIMITS = __RLIMIT_NLIMITS
diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
index 03e1de716c..e374023841 100644
--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
+++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
@@ -23,6 +23,7 @@
 #include <sys/utsname.h>
 #include "kernel-features.h"
 #include <dl-sysdep.h>
+#include <stdint.h>
 
 #ifndef MIN
 # define MIN(a,b) (((a)<(b))?(a):(b))
@@ -157,3 +158,24 @@ _dl_discover_osversion (void)
     else if (__LINUX_KERNEL_VERSION > 0)				      \
       FATAL ("FATAL: cannot determine kernel version\n");		      \
   } while (0)
+
+static inline uintptr_t __attribute__ ((always_inline))
+_dl_setup_stack_chk_guard (void)
+{
+  uintptr_t ret;
+#ifdef ENABLE_STACKGUARD_RANDOMIZE
+  int fd = __open ("/dev/urandom", O_RDONLY);
+  if (fd >= 0)
+    {
+      ssize_t reslen = __read (fd, &ret, sizeof (ret));
+      __close (fd);
+      if (reslen == (ssize_t) sizeof (ret))
+	return ret;
+    }
+#endif
+  ret = 0;
+  unsigned char *p = (unsigned char *) &ret;
+  p[sizeof (ret) - 1] = 255;
+  p[sizeof (ret) - 2] = '\n';
+  return ret;
+}
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/resource.h b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
index 8e7b64f996..3f2c600141 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/resource.h
@@ -98,7 +98,7 @@ enum __rlimit_resource
   /* Maximum realtime priority allowed for non-priviledged
      processes.  */
   __RLIMIT_RTPRIO = 14,
-#define RLIMIT_RTPRIO _RLIMIT_RTPRIO
+#define RLIMIT_RTPRIO __RLIMIT_RTPRIO
 
   __RLIMIT_NLIMITS = 15,
   __RLIM_NLIMITS = __RLIMIT_NLIMITS