[Glibc-bsd-commits] r2173 - in trunk/glibc-ports/kfreebsd: . linuxthreads

ps-guest at alioth.debian.org ps-guest at alioth.debian.org
Mon Jun 9 16:11:22 UTC 2008


Author: ps-guest
Date: 2008-06-09 16:11:21 +0000 (Mon, 09 Jun 2008)
New Revision: 2173

Added:
   trunk/glibc-ports/kfreebsd/testrtsig.h
Modified:
   trunk/glibc-ports/kfreebsd/linuxthreads/allocrtsig.c
Log:
* use RT behaviour of signals, when available
  perl "ext/threads/shared/t/stress" passes with it under FreeBSD 7.x



Modified: trunk/glibc-ports/kfreebsd/linuxthreads/allocrtsig.c
===================================================================
--- trunk/glibc-ports/kfreebsd/linuxthreads/allocrtsig.c	2008-06-09 03:06:46 UTC (rev 2172)
+++ trunk/glibc-ports/kfreebsd/linuxthreads/allocrtsig.c	2008-06-09 16:11:21 UTC (rev 2173)
@@ -1,3 +1,11 @@
+#if 1
+
+#define __SIGRTMIN 65
+#define __SIGRTMAX 126
+#include <linuxthreads/sysdeps/unix/sysv/linux/allocrtsig.c>
+
+#else
+
 #include <signal/allocrtsig.c>
 strong_alias (__libc_current_sigrtmin, __libc_current_sigrtmin_private);
 strong_alias (__libc_current_sigrtmax, __libc_current_sigrtmax_private);
@@ -2 +10,3 @@
 strong_alias (__libc_allocate_rtsig, __libc_allocate_rtsig_private);
+
+#endif

Added: trunk/glibc-ports/kfreebsd/testrtsig.h
===================================================================
--- trunk/glibc-ports/kfreebsd/testrtsig.h	                        (rev 0)
+++ trunk/glibc-ports/kfreebsd/testrtsig.h	2008-06-09 16:11:21 UTC (rev 2173)
@@ -0,0 +1,44 @@
+/* Test whether RT signals are really available.
+   Copyright (C) 2008 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 <sys/sysctl.h>
+#include <errno.h>
+#include <string.h>
+
+#include <kernel-features.h>
+
+static int
+kernel_has_rtsig (void)
+{
+#if __ASSUME_REALTIME_SIGNALS
+  return 1;
+#else
+
+  int request[2] = { CTL_KERN, KERN_OSRELDATE};
+  size_t len;
+  int val;
+
+  len = sizeof (val);
+  if (__sysctl (request, 2, &val, &len, NULL, 0) < 0)
+      return 0;
+  if ( val < 700050) /* FreeBSD 7.0 is 700055 */
+      return 0;
+  return 1;    
+#endif
+}




More information about the Glibc-bsd-commits mailing list