NetBSD/tests/lib/libpthread
manu bba80928a8 setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
  (powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
  setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
  (hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
  powerpc, sh3, sparc and sparc64 is left to portmasters
  sparc64

Approved by core@
2012-09-12 02:00:51 +00:00
..
Makefile setcontext() used to be incompatible with -lpthread since it affected 2012-09-12 02:00:51 +00:00
d_mach
h_atexit.c
h_cancel.c
h_common.h
h_exit.c
h_resolv.c add Makefile.inc everywhere so that we can set WARNS=4 by default. Amazing 2010-11-03 16:10:19 +00:00
t_atexit.sh Adjusts tests after import of atf-0.12: 2010-11-07 17:51:16 +00:00
t_barrier.c add Makefile.inc everywhere so that we can set WARNS=4 by default. Amazing 2010-11-03 16:10:19 +00:00
t_cancel.sh
t_cond.c Add a test case for pthread_cond_timedwait(3) failures reported by 2011-03-27 16:45:15 +00:00
t_detach.c A dummy conformance-test for pthread_detach(3). I will extend this later. 2011-03-24 13:52:04 +00:00
t_equal.c A dummy conformance-test of pthread_equal(3). 2011-03-24 12:40:59 +00:00
t_exit.sh
t_fork.c
t_fpu.c
t_join.c Also exercise pthread_attr_setstacksize. 2012-03-12 20:17:16 +00:00
t_kill.c
t_mutex.c Do only set a (lower than default) timeout value if we are on powerpc and 2011-04-04 14:47:22 +00:00
t_name.c
t_once.c
t_preempt.c add Makefile.inc everywhere so that we can set WARNS=4 by default. Amazing 2010-11-03 16:10:19 +00:00
t_resolv.sh
t_rwlock.c
t_sem.c It is perfectly valid for sem_wait to be interrupted, so loop on EINTR. 2012-03-09 19:46:37 +00:00
t_sigalarm.c
t_siglongjmp.c
t_sigmask.c add Makefile.inc everywhere so that we can set WARNS=4 by default. Amazing 2010-11-03 16:10:19 +00:00
t_sigsuspend.c
t_sleep.c
t_swapcontext.c setcontext() used to be incompatible with -lpthread since it affected 2012-09-12 02:00:51 +00:00