This diff tightens up internal references to exported functions, plus one
pointless syscall.
This is done via a namespace.h and wrapper headers like the hidden/* added
in the libc source. The files are the libpthread directory as that's the
style of arrangement of the rthread source; some day I'll move everything
into subdirectories of /usr/src/lib/libpthread/ but until then a single
directory is fine.
This version also implements the pattern I intend to apply to libc at some
point, where symbols in the shared library are always strong (as the
shared library search order handles conflicts) and only the static library
have symbols that are weakened.
Again, no changes to what's exported, only changes to what this library
depends on others for, so no lib version bump.
check_sym report:
No dynamic export changes
External reference changes:
removed:
getpagesize
PLT removed:
pthread_attr_setstackaddr
pthread_cond_broadcast
pthread_cond_destroy
pthread_cond_init
pthread_cond_wait
pthread_exit
pthread_getspecific
pthread_key_create
pthread_mutex_destroy
pthread_mutex_init
pthread_mutex_lock
pthread_mutex_unlock
pthread_rwlock_init
pthread_self
pthread_setcancelstate
pthread_setspecific
ok?
Philip Guenther
Index: Makefile
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- Makefile 19 May 2015 20:50:06 -0000 1.40
+++ Makefile 2 Apr 2016 06:05:40 -0000
@@ -6,7 +6,8 @@ LIBCSRCDIR= ${.CURDIR}/../libc
CFLAGS+=-Wall -g -Werror -Wshadow
CFLAGS+=-Wmissing-prototypes -Wstrict-prototypes
CFLAGS+=-Wsign-compare
-CFLAGS+=-I${LIBCSRCDIR}/arch/${MACHINE_CPU} -I${LIBCSRCDIR}/include
+CFLAGS+=-I${.CURDIR} -include namespace.h \
+ -I${LIBCSRCDIR}/arch/${MACHINE_CPU} -I${LIBCSRCDIR}/include
CDIAGFLAGS=
LDADD = -Wl,-znodelete,-zinitfirst,-znodlopen
@@ -47,3 +48,5 @@ SRCDIR= ${.CURDIR}/../libpthread
.include "${SRCDIR}/include/Makefile.inc"
.include "${SRCDIR}/man/Makefile.inc"
.include <bsd.lib.mk>
+
+${OBJS} ${GOBJS} ${POBJS} ${SOBJS} ${DOBJS}: ${.CURDIR}/namespace.h
Index: namespace.h
===================================================================
RCS file: namespace.h
diff -N namespace.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ namespace.h 2 Apr 2016 06:11:05 -0000
@@ -0,0 +1,43 @@
+/* $OpenBSD$ */
+
+#ifndef _LIBPTHREAD_NAMESPACE_H_
+#define _LIBPTHREAD_NAMESPACE_H_
+
+/*
+ * Copyright (c) 2016 Philip Guenther <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/cdefs.h> /* for __dso_hidden and __strong_alias */
+
+#ifndef PIC
+# define WEAK_IN_STATIC_ALIAS(x,y) __weak_alias(x,y)
+# define WEAK_IN_STATIC __attribute__((weak))
+#else
+# define WEAK_IN_STATIC_ALIAS(x,y) __strong_alias(x,y)
+# define WEAK_IN_STATIC /* nothing */
+#endif
+
+#define HIDDEN(x) _libpthread_##x
+#define HIDDEN_STRING(x) "_libpthread_" __STRING(x)
+
+#define PROTO_NORMAL(x) __dso_hidden typeof(x) x
asm(HIDDEN_STRING(x))
+#define PROTO_STD_DEPRECATED(x) typeof(x) x __attribute__((deprecated))
+#define PROTO_DEPRECATED(x) PROTO_STD_DEPRECATED(x) WEAK_IN_STATIC
+
+#define DEF_STD(x) __strong_alias(x, HIDDEN(x))
+#define DEF_NONSTD(x) WEAK_IN_STATIC_ALIAS(x, HIDDEN(x))
+
+#endif /* _LIBPTHREAD_NAMESPACE_H_ */
+
Index: pthread.h
===================================================================
RCS file: pthread.h
diff -N pthread.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pthread.h 2 Apr 2016 06:11:10 -0000
@@ -0,0 +1,125 @@
+/* $OpenBSD$ */
+/*
+ * Copyright (c) 2016 Philip Guenther <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBPTHREAD_PTHREAD_H_
+#define _LIBPTHREAD_PTHREAD_H_
+
+#include_next <pthread.h>
+
+PROTO_STD_DEPRECATED(pthread_attr_destroy);
+PROTO_STD_DEPRECATED(pthread_attr_getdetachstate);
+PROTO_STD_DEPRECATED(pthread_attr_getguardsize);
+PROTO_STD_DEPRECATED(pthread_attr_getinheritsched);
+PROTO_STD_DEPRECATED(pthread_attr_getschedparam);
+PROTO_STD_DEPRECATED(pthread_attr_getschedpolicy);
+PROTO_STD_DEPRECATED(pthread_attr_getscope);
+PROTO_STD_DEPRECATED(pthread_attr_getstack);
+PROTO_STD_DEPRECATED(pthread_attr_getstacksize);
+PROTO_STD_DEPRECATED(pthread_attr_init);
+PROTO_STD_DEPRECATED(pthread_attr_setdetachstate);
+PROTO_STD_DEPRECATED(pthread_attr_setguardsize);
+PROTO_STD_DEPRECATED(pthread_attr_setinheritsched);
+PROTO_STD_DEPRECATED(pthread_attr_setschedparam);
+PROTO_STD_DEPRECATED(pthread_attr_setschedpolicy);
+PROTO_STD_DEPRECATED(pthread_attr_setscope);
+PROTO_STD_DEPRECATED(pthread_attr_setstack);
+PROTO_STD_DEPRECATED(pthread_attr_setstacksize);
+PROTO_STD_DEPRECATED(pthread_barrier_destroy);
+PROTO_STD_DEPRECATED(pthread_barrier_init);
+PROTO_STD_DEPRECATED(pthread_barrier_wait);
+PROTO_STD_DEPRECATED(pthread_barrierattr_destroy);
+PROTO_STD_DEPRECATED(pthread_barrierattr_getpshared);
+PROTO_STD_DEPRECATED(pthread_barrierattr_init);
+PROTO_STD_DEPRECATED(pthread_barrierattr_setpshared);
+PROTO_STD_DEPRECATED(pthread_cancel);
+PROTO_STD_DEPRECATED(pthread_cleanup_pop);
+PROTO_STD_DEPRECATED(pthread_cleanup_push);
+PROTO_NORMAL(pthread_cond_broadcast);
+PROTO_NORMAL(pthread_cond_destroy);
+PROTO_NORMAL(pthread_cond_init);
+PROTO_STD_DEPRECATED(pthread_cond_signal);
+PROTO_STD_DEPRECATED(pthread_cond_timedwait);
+PROTO_NORMAL(pthread_cond_wait);
+PROTO_STD_DEPRECATED(pthread_condattr_destroy);
+PROTO_STD_DEPRECATED(pthread_condattr_getclock);
+PROTO_STD_DEPRECATED(pthread_condattr_init);
+PROTO_STD_DEPRECATED(pthread_condattr_setclock);
+PROTO_STD_DEPRECATED(pthread_create);
+PROTO_STD_DEPRECATED(pthread_detach);
+PROTO_STD_DEPRECATED(pthread_equal);
+PROTO_NORMAL(pthread_exit);
+PROTO_STD_DEPRECATED(pthread_getconcurrency);
+PROTO_STD_DEPRECATED(pthread_getcpuclockid);
+PROTO_STD_DEPRECATED(pthread_getschedparam);
+PROTO_NORMAL(pthread_getspecific);
+PROTO_STD_DEPRECATED(pthread_join);
+PROTO_NORMAL(pthread_key_create);
+PROTO_STD_DEPRECATED(pthread_key_delete);
+PROTO_STD_DEPRECATED(pthread_kill);
+PROTO_NORMAL(pthread_mutex_destroy);
+PROTO_STD_DEPRECATED(pthread_mutex_getprioceiling);
+PROTO_NORMAL(pthread_mutex_init);
+PROTO_NORMAL(pthread_mutex_lock);
+PROTO_STD_DEPRECATED(pthread_mutex_setprioceiling);
+PROTO_STD_DEPRECATED(pthread_mutex_timedlock);
+PROTO_STD_DEPRECATED(pthread_mutex_trylock);
+PROTO_NORMAL(pthread_mutex_unlock);
+PROTO_STD_DEPRECATED(pthread_mutexattr_destroy);
+PROTO_STD_DEPRECATED(pthread_mutexattr_getprioceiling);
+PROTO_STD_DEPRECATED(pthread_mutexattr_getprotocol);
+PROTO_STD_DEPRECATED(pthread_mutexattr_gettype);
+PROTO_STD_DEPRECATED(pthread_mutexattr_init);
+PROTO_STD_DEPRECATED(pthread_mutexattr_setprioceiling);
+PROTO_STD_DEPRECATED(pthread_mutexattr_setprotocol);
+PROTO_STD_DEPRECATED(pthread_mutexattr_settype);
+PROTO_STD_DEPRECATED(pthread_once);
+PROTO_STD_DEPRECATED(pthread_rwlock_destroy);
+PROTO_NORMAL(pthread_rwlock_init);
+PROTO_STD_DEPRECATED(pthread_rwlock_rdlock);
+PROTO_STD_DEPRECATED(pthread_rwlock_timedrdlock);
+PROTO_STD_DEPRECATED(pthread_rwlock_timedwrlock);
+PROTO_STD_DEPRECATED(pthread_rwlock_tryrdlock);
+PROTO_STD_DEPRECATED(pthread_rwlock_trywrlock);
+PROTO_STD_DEPRECATED(pthread_rwlock_unlock);
+PROTO_STD_DEPRECATED(pthread_rwlock_wrlock);
+PROTO_STD_DEPRECATED(pthread_rwlockattr_destroy);
+PROTO_STD_DEPRECATED(pthread_rwlockattr_getpshared);
+PROTO_STD_DEPRECATED(pthread_rwlockattr_init);
+PROTO_STD_DEPRECATED(pthread_rwlockattr_setpshared);
+PROTO_NORMAL(pthread_self);
+PROTO_NORMAL(pthread_setcancelstate);
+PROTO_STD_DEPRECATED(pthread_setcanceltype);
+PROTO_STD_DEPRECATED(pthread_setconcurrency);
+PROTO_STD_DEPRECATED(pthread_setschedparam);
+PROTO_NORMAL(pthread_setspecific);
+PROTO_STD_DEPRECATED(pthread_spin_destroy);
+PROTO_STD_DEPRECATED(pthread_spin_init);
+PROTO_STD_DEPRECATED(pthread_spin_lock);
+PROTO_STD_DEPRECATED(pthread_spin_trylock);
+PROTO_STD_DEPRECATED(pthread_spin_unlock);
+PROTO_STD_DEPRECATED(pthread_testcancel);
+
+/*
+ * Obsolete, non-portable
+ */
+PROTO_DEPRECATED(pthread_setprio);
+PROTO_DEPRECATED(pthread_getprio);
+PROTO_DEPRECATED(pthread_attr_getstackaddr);
+PROTO_NORMAL(pthread_attr_setstackaddr);
+PROTO_DEPRECATED(pthread_yield);
+
+#endif /* !_LIBPTHREAD_PTHREAD_H_ */
Index: pthread_np.h
===================================================================
RCS file: pthread_np.h
diff -N pthread_np.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pthread_np.h 2 Apr 2016 06:11:18 -0000
@@ -0,0 +1,29 @@
+/* $OpenBSD$ */
+/*
+ * Copyright (c) 2016 Philip Guenther <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBPTHREAD_PTHREAD_NP_H_
+#define _LIBPTHREAD_PTHREAD_NP_H_
+
+#include_next <pthread_np.h>
+
+PROTO_DEPRECATED(pthread_main_np);
+PROTO_DEPRECATED(pthread_mutexattr_getkind_np);
+PROTO_DEPRECATED(pthread_mutexattr_setkind_np);
+PROTO_DEPRECATED(pthread_set_name_np);
+PROTO_DEPRECATED(pthread_stackseg_np);
+
+#endif /* !_LIBPTHREAD_PTHREAD_NP_H_ */
Index: rthread.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread.c,v
retrieving revision 1.88
diff -u -p -r1.88 rthread.c
--- rthread.c 20 Mar 2016 02:30:28 -0000 1.88
+++ rthread.c 2 Apr 2016 06:05:40 -0000
@@ -47,6 +47,21 @@
#include "rthread.h"
#include "tcb.h"
+/*
+ * Call nonstandard functions via names in the reserved namespace:
+ * NOT YET dlctl() -> _dlctl()
+ * getthrid -> _thread_sys_getthrid
+ */
+REDIRECT_SYSCALL(getthrid);
+
+/*
+ * libc's signal wrappers hide SIGTHR; we need to call the real syscall
+ * stubs _thread_sys_* directly.
+ */
+REDIRECT_SYSCALL(sigaction);
+REDIRECT_SYSCALL(sigprocmask);
+REDIRECT_SYSCALL(thrkill);
+
static int concurrency_level; /* not used */
struct _spinlock _SPINLOCK_UNLOCKED_ASSIGN = _SPINLOCK_UNLOCKED;
@@ -207,9 +222,9 @@ _rthread_init(void)
memset(&sa, 0, sizeof(sa));
sigemptyset(&sa.sa_mask);
sa.sa_handler = sigthr_handler;
- _thread_sys_sigaction(SIGTHR, &sa, NULL);
+ sigaction(SIGTHR, &sa, NULL);
sigaddset(&sa.sa_mask, SIGTHR);
- _thread_sys_sigprocmask(SIG_UNBLOCK, &sa.sa_mask, NULL);
+ sigprocmask(SIG_UNBLOCK, &sa.sa_mask, NULL);
return (0);
}
@@ -257,6 +272,7 @@ pthread_self(void)
return (TCB_THREAD());
}
+DEF_STD(pthread_self);
static void
_rthread_reaper(void)
@@ -323,6 +339,7 @@ pthread_exit(void *retval)
__threxit(&thread->tid);
for(;;);
}
+DEF_STD(pthread_exit);
int
pthread_join(pthread_t thread, void **retval)
@@ -463,7 +480,7 @@ pthread_kill(pthread_t thread, int sig)
{
if (sig == SIGTHR)
return (EINVAL);
- if (_thread_sys_thrkill(thread->tid, sig, thread->tcb))
+ if (thrkill(thread->tid, sig, thread->tcb))
return (errno);
return (0);
}
@@ -487,7 +504,7 @@ pthread_cancel(pthread_t thread)
if (thread->flags & THREAD_CANCEL_ENABLE) {
_spinunlock(&thread->flags_lock);
- _thread_sys_thrkill(tid, SIGTHR, thread->tcb);
+ thrkill(tid, SIGTHR, thread->tcb);
return (0);
}
}
@@ -524,6 +541,7 @@ pthread_setcancelstate(int state, int *o
return (0);
}
+DEF_STD(pthread_setcancelstate);
int
pthread_setcanceltype(int type, int *oldtypep)
Index: rthread.h
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread.h,v
retrieving revision 1.55
diff -u -p -r1.55 rthread.h
--- rthread.h 27 Jan 2016 08:40:05 -0000 1.55
+++ rthread.h 2 Apr 2016 05:34:27 -0000
@@ -233,15 +233,10 @@ void _leave_delayed_cancel(pthread_t, in
void _thread_dump_info(void);
-/* syscalls */
+/* syscalls not declared in system headers */
+#define REDIRECT_SYSCALL(x) typeof(x) x asm("_thread_sys_"#x)
void __threxit(pid_t *);
int __thrsleep(const volatile void *, clockid_t, const struct timespec *,
volatile void *, const int *);
int __thrwakeup(const volatile void *, int n);
int __thrsigdivert(sigset_t, siginfo_t *, const struct timespec *);
-int sched_yield(void);
-int _thread_sys_sigaction(int, const struct sigaction *,
- struct sigaction *);
-int _thread_sys_sigprocmask(int, const sigset_t *, sigset_t *);
-int _thread_sys_thrkill(pid_t _tid, int _signum, void *_tcb);
-
Index: rthread_attr.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_attr.c,v
retrieving revision 1.20
diff -u -p -r1.20 rthread_attr.c
--- rthread_attr.c 9 Aug 2014 03:29:35 -0000 1.20
+++ rthread_attr.c 2 Apr 2016 06:05:40 -0000
@@ -170,6 +170,7 @@ pthread_attr_setstackaddr(pthread_attr_t
return (0);
}
+DEF_NONSTD(pthread_attr_setstackaddr);
int
pthread_attr_getscope(const pthread_attr_t *attrp, int *contentionscope)
Index: rthread_debug.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_debug.c,v
retrieving revision 1.3
diff -u -p -r1.3 rthread_debug.c
--- rthread_debug.c 13 Mar 2012 05:51:30 -0000 1.3
+++ rthread_debug.c 31 Mar 2016 23:23:42 -0000
@@ -11,6 +11,8 @@
#include "rthread.h"
+REDIRECT_SYSCALL(issetugid);
+
int _rthread_debug_level;
/*
Index: rthread_fork.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_fork.c,v
retrieving revision 1.15
diff -u -p -r1.15 rthread_fork.c
--- rthread_fork.c 27 Jan 2016 08:40:05 -0000 1.15
+++ rthread_fork.c 2 Apr 2016 05:35:50 -0000
@@ -45,6 +45,8 @@
#include "rthread.h"
+REDIRECT_SYSCALL(getthrid);
+
pid_t _thread_sys_fork(void);
pid_t _thread_sys_vfork(void);
pid_t _dofork(int);
Index: rthread_np.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_np.c,v
retrieving revision 1.17
diff -u -p -r1.17 rthread_np.c
--- rthread_np.c 24 Jan 2015 10:35:33 -0000 1.17
+++ rthread_np.c 31 Mar 2016 23:00:23 -0000
@@ -36,6 +36,8 @@
#include "rthread.h"
+REDIRECT_SYSCALL(sysctl);
+
void
pthread_set_name_np(pthread_t thread, const char *name)
{
Index: rthread_rwlock.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_rwlock.c,v
retrieving revision 1.5
diff -u -p -r1.5 rthread_rwlock.c
--- rthread_rwlock.c 1 Nov 2015 03:52:17 -0000 1.5
+++ rthread_rwlock.c 2 Apr 2016 06:05:40 -0000
@@ -49,6 +49,7 @@ pthread_rwlock_init(pthread_rwlock_t *lo
return (0);
}
+DEF_STD(pthread_rwlock_init);
int
pthread_rwlock_destroy(pthread_rwlock_t *lockp)
Index: rthread_sem.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_sem.c,v
retrieving revision 1.21
diff -u -p -r1.21 rthread_sem.c
--- rthread_sem.c 10 Dec 2015 13:02:24 -0000 1.21
+++ rthread_sem.c 2 Apr 2016 06:05:40 -0000
@@ -46,7 +46,7 @@
* Size of memory to be mmap()'ed by named semaphores.
* Should be >= SEM_PATH_SIZE and page-aligned.
*/
-#define SEM_MMAP_SIZE getpagesize()
+#define SEM_MMAP_SIZE _thread_pagesize
/*
* Internal implementation of semaphores
@@ -347,7 +347,7 @@ sem_open(const char *name, int oflag, ..
errno = EPERM;
return (SEM_FAILED);
}
- if (sb.st_size != SEM_MMAP_SIZE) {
+ if (sb.st_size != (off_t)SEM_MMAP_SIZE) {
if (!(oflag & O_CREAT)) {
close(fd);
errno = EINVAL;
Index: rthread_sync.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_sync.c,v
retrieving revision 1.39
diff -u -p -r1.39 rthread_sync.c
--- rthread_sync.c 1 Jun 2013 23:06:26 -0000 1.39
+++ rthread_sync.c 2 Apr 2016 06:05:40 -0000
@@ -58,6 +58,7 @@ pthread_mutex_init(pthread_mutex_t *mute
return (0);
}
+DEF_STD(pthread_mutex_init);
int
pthread_mutex_destroy(pthread_mutex_t *mutexp)
@@ -79,6 +80,7 @@ pthread_mutex_destroy(pthread_mutex_t *m
}
return (0);
}
+DEF_STD(pthread_mutex_destroy);
static int
_rthread_mutex_lock(pthread_mutex_t *mutexp, int trywait,
@@ -170,6 +172,7 @@ pthread_mutex_lock(pthread_mutex_t *p)
{
return (_rthread_mutex_lock(p, 0, NULL));
}
+DEF_STD(pthread_mutex_lock);
int
pthread_mutex_trylock(pthread_mutex_t *p)
@@ -234,6 +237,7 @@ pthread_mutex_unlock(pthread_mutex_t *mu
return (0);
}
+DEF_STD(pthread_mutex_unlock);
/*
* condition variables
@@ -256,6 +260,7 @@ pthread_cond_init(pthread_cond_t *condp,
return (0);
}
+DEF_STD(pthread_cond_init);
int
pthread_cond_destroy(pthread_cond_t *condp)
@@ -277,6 +282,7 @@ pthread_cond_destroy(pthread_cond_t *con
return (0);
}
+DEF_STD(pthread_cond_destroy);
int
pthread_cond_timedwait(pthread_cond_t *condp, pthread_mutex_t *mutexp,
@@ -563,6 +569,7 @@ pthread_cond_wait(pthread_cond_t *condp,
return (0);
}
+DEF_STD(pthread_cond_wait);
int
@@ -677,3 +684,4 @@ pthread_cond_broadcast(pthread_cond_t *c
return (0);
}
+DEF_STD(pthread_cond_broadcast);
Index: rthread_tls.c
===================================================================
RCS file: /data/src/openbsd/src/lib/librthread/rthread_tls.c,v
retrieving revision 1.16
diff -u -p -r1.16 rthread_tls.c
--- rthread_tls.c 2 Nov 2013 22:37:17 -0000 1.16
+++ rthread_tls.c 2 Apr 2016 06:05:40 -0000
@@ -57,6 +57,7 @@ pthread_key_create(pthread_key_t *key, v
return (0);
}
+DEF_STD(pthread_key_create);
int
pthread_key_delete(pthread_key_t key)
@@ -135,6 +136,7 @@ pthread_getspecific(pthread_key_t key)
return (rs->data);
}
+DEF_STD(pthread_getspecific);
int
pthread_setspecific(pthread_key_t key, const void *data)
@@ -151,6 +153,7 @@ pthread_setspecific(pthread_key_t key, c
return (0);
}
+DEF_STD(pthread_setspecific);
void
_rthread_tls_destructors(pthread_t thread)