summaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/configure11
-rw-r--r--sysdeps/unix/sysv/linux/configure.in13
-rw-r--r--sysdeps/unix/sysv/linux/eventfd.c15
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysconf.c3
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/signalfd.c15
6 files changed, 29 insertions, 30 deletions
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index 253e9c57ff..199457a3ac 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -1,17 +1,6 @@
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/unix/sysv/linux.
-# The Linux kernel headers can be found in
-# /lib/modules/$(uname -r)/build/include
-# Check whether this directory is available.
-if test -z "$sysheaders" &&
- test "x$cross_compiling" = xno &&
- test -d /lib/modules/`uname -r`/build/include; then
- sysheaders="/lib/modules/`uname -r`/build/include"
- ccheaders=`$CC -print-file-name=include`
- SYSINCLUDES="-I $sysheaders"
-fi
-
# Don't bother trying to generate any glue code to be compatible with the
# existing system library, because we are the only system library.
inhibit_glue=yes
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 5330e98c2d..8f00407a8b 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -1,19 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux.
-# The Linux kernel headers can be found in
-# /lib/modules/$(uname -r)/build/include
-# Check whether this directory is available.
-if test -z "$sysheaders" &&
- test "x$cross_compiling" = xno &&
- test -d /lib/modules/`uname -r`/build/include; then
- sysheaders="/lib/modules/`uname -r`/build/include"
- ccheaders=`$CC -print-file-name=include`
- dnl We don't have to use -nostdinc. We just want one more directory
- dnl to be used.
- SYSINCLUDES="-I $sysheaders"
-fi
-
# Don't bother trying to generate any glue code to be compatible with the
# existing system library, because we are the only system library.
inhibit_glue=yes
diff --git a/sysdeps/unix/sysv/linux/eventfd.c b/sysdeps/unix/sysv/linux/eventfd.c
index 4cd557983e..7f69ecdb8c 100644
--- a/sysdeps/unix/sysv/linux/eventfd.c
+++ b/sysdeps/unix/sysv/linux/eventfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009 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
@@ -19,14 +19,21 @@
#include <errno.h>
#include <sys/eventfd.h>
#include <sysdep.h>
+#include <kernel-features.h>
int
eventfd (int count, int flags)
{
#ifdef __NR_eventfd2
- return INLINE_SYSCALL (eventfd2, 2, count, flags);
-#else
+ int res = INLINE_SYSCALL (eventfd2, 2, count, flags);
+# ifndef __ASSUME_EVENTFD2
+ if (res != -1 || errno != ENOSYS)
+# endif
+ return res;
+#endif
+
+#ifndef __ASSUME_EVENTFD2
/* The old system call has no flag parameter which is bad. So we have
to wait until we have to support to pass additional values to the
kernel (sys_indirect) before implementing setting flags like
@@ -43,5 +50,7 @@ eventfd (int count, int flags)
__set_errno (ENOSYS);
return -1;
# endif
+#elif !defined __NR_eventfd2
+# error "__ASSUME_EVENTFD2 defined but not __NR_eventfd2"
#endif
}
diff --git a/sysdeps/unix/sysv/linux/i386/sysconf.c b/sysdeps/unix/sysv/linux/i386/sysconf.c
index efe1a639cd..ff3cf9f7c7 100644
--- a/sysdeps/unix/sysv/linux/i386/sysconf.c
+++ b/sysdeps/unix/sysv/linux/i386/sysconf.c
@@ -138,6 +138,9 @@ static const struct intel_02_cache_info
{ 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 2097152 },
{ 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 4194304 },
{ 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 8388608 },
+ { 0xea, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
+ { 0xeb, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 18874368 },
+ { 0xec, 24, 64, M(_SC_LEVEL3_CACHE_SIZE), 25165824 },
};
#define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known[0]))
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 4562515790..ff065effb5 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -516,6 +516,8 @@
# define __ASSUME_SOCK_CLOEXEC 1
# define __ASSUME_IN_NONBLOCK 1
# define __ASSUME_PIPE2 1
+# define __ASSUME_EVENTFD2 1
+# define __ASSUME_SIGNALFD4 1
#endif
/* Support for the accept4 syscall was added in 2.6.28. */
diff --git a/sysdeps/unix/sysv/linux/signalfd.c b/sysdeps/unix/sysv/linux/signalfd.c
index 9898f29231..c2d974a45d 100644
--- a/sysdeps/unix/sysv/linux/signalfd.c
+++ b/sysdeps/unix/sysv/linux/signalfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009 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
@@ -20,14 +20,21 @@
#include <signal.h>
#include <sys/signalfd.h>
#include <sysdep.h>
+#include <kernel-features.h>
int
signalfd (int fd, const sigset_t *mask, int flags)
{
#ifdef __NR_signalfd4
- return INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
-#else
+ int res = INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
+# ifndef __ASSUME_SIGNALFD4
+ if (res != -1 || errno != ENOSYS)
+# endif
+ return res;
+#endif
+
+#ifndef __ASSUME_SIGNALFD4
/* The old system call has no flag parameter which is bad. So we have
to wait until we have to support to pass additional values to the
kernel (sys_indirect) before implementing setting flags like
@@ -44,5 +51,7 @@ signalfd (int fd, const sigset_t *mask, int flags)
__set_errno (ENOSYS);
return -1;
# endif
+#elif !defined __NR_signalfd4
+# error "__ASSUME_SIGNALFD4 defined but not __NR_signalfd4"
#endif
}