[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Provide __libc_current_sigrt{min,max}



__libc_current_sigrt{min,max} are exported by LinuxThreads, but not by
NPTL 0.6.

This patch fixes this problem by exporting current_rtmin and
current_rtmax (renamed to __current_rt{min, max}) as GLIBC_PRIVATE from
glibc and including allocrtsig.c in both libc and libpthread.

Note that this may not be the best way to solve the problem.


diff --exclude-from=/home/ldb/src/linux-exclude -urNdp nptl-0.6/nptl/sysdeps/unix/sysv/linux/allocrtsig.c nptl_ldb/sysdeps/unix/sysv/linux/allocrtsig.c
--- nptl-0.6/nptl/sysdeps/unix/sysv/linux/allocrtsig.c	2002-09-19 11:57:31.000000000 +0200
+++ nptl_ldb/sysdeps/unix/sysv/linux/allocrtsig.c	2002-11-14 15:47:39.000000000 +0100
@@ -19,9 +19,13 @@

 #include <signal.h>

-
-static int current_rtmin = __SIGRTMIN + 1;
-static int current_rtmax = __SIGRTMAX;
+#ifdef _LIBC
+int __current_rtmin = __SIGRTMIN + 1;
+int __current_rtmax = __SIGRTMAX;
+#else
+extern int __current_rtmin;
+extern int __current_rtmax;
+#endif


 /* We reserve __SIGRTMIN for use as the cancelation signal.  This
@@ -29,23 +33,23 @@ static int current_rtmax = __SIGRTMAX;
 int
 __libc_current_sigrtmin (void)
 {
-  return current_rtmin;
+  return __current_rtmin;
 }


 int
 __libc_current_sigrtmax (void)
 {
-  return current_rtmax;
+  return __current_rtmax;
 }


 int
 __libc_allocate_rtsig (int high)
 {
-  if (current_rtmin == -1 || current_rtmin > current_rtmax)
+  if (__current_rtmin == -1 || __current_rtmin > __current_rtmax)
     /* We don't have anymore signal available.  */
     return -1;

-  return high ? current_rtmin++ : current_rtmax--;
+  return high ? __current_rtmin++ : __current_rtmax--;
 }
diff --exclude-from=/home/ldb/src/linux-exclude -urNdp nptl-0.6/nptl/sysdeps/unix/sysv/linux/Versions nptl_ldb/sysdeps/unix/sysv/linux/Versions
--- nptl-0.6/nptl/sysdeps/unix/sysv/linux/Versions	2002-09-24 16:10:10.000000000 +0200
+++ nptl_ldb/sysdeps/unix/sysv/linux/Versions	2002-11-14 15:46:44.000000000 +0100
@@ -1,6 +1,7 @@
 libc {
   GLIBC_PRIVATE {
     __register_atfork; __register_pthread_fork_handler;
+    __current_rtmin; __current_rtmax;
   }
 }
 libpthread {
diff --exclude-from=/home/ldb/src/linux-exclude -urNdp nptl-0.6/nptl/Versions nptl_ldb/Versions
--- nptl-0.6/nptl/Versions	2002-11-19 19:51:10.000000000 +0100
+++ nptl_ldb/Versions	2002-11-14 15:47:07.000000000 +0100
@@ -127,7 +141,7 @@ libpthread {
     # Semaphores.
     sem_destroy; sem_getvalue; sem_init; sem_post; sem_trywait; sem_wait;

-    __libc_allocate_rtsig;
+    __libc_current_sigrtmin; __libc_current_sigrtmax; __libc_allocate_rtsig;
   }

   GLIBC_2.1.1 {

Attachment: signature.asc
Description: This is a digitally signed message part


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]