Browse Source

Hide internally used symbols, use weak_alias for raise/sigwait, as they could be in libpthread too

Peter S. Mazinger 19 years ago
parent
commit
ae7377cea8
2 changed files with 9 additions and 2 deletions
  1. 4 1
      libc/signal/raise.c
  2. 5 1
      libc/signal/sigwait.c

+ 4 - 1
libc/signal/raise.c

@@ -7,8 +7,11 @@
 #include <signal.h>
 #include <sys/types.h>
 
-int raise(int signo)
+#undef raise
+int attribute_hidden __raise(int signo)
 {
     return kill(getpid(), signo);
 }
 
+/* psm: keep this weak, because the one in libpthread.so could overwrite it */
+weak_alias(__raise, raise)

+ 5 - 1
libc/signal/sigwait.c

@@ -22,7 +22,8 @@
 #include <signal.h>
 #include <string.h>
 
-int sigwait (const sigset_t *set, int *sig)
+#undef sigwait
+int attribute_hidden __sigwait (const sigset_t *set, int *sig)
 {
     int ret = 1;
     if ((ret = sigwaitinfo(set, NULL)) != -1) {
@@ -31,3 +32,6 @@ int sigwait (const sigset_t *set, int *sig)
     }
     return 1;
 }
+
+/* psm: keep this weak, because the one in libpthread.so could overwrite it */
+weak_alias(__sigwait, sigwait)