syscall-restart2.vgtest syscall-restart2.stdout.exp syscall-restart2.stderr.exp \
system.stderr.exp system.vgtest \
thread-exits.stderr.exp thread-exits.stdout.exp thread-exits.vgtest \
+ threaded-fork.stderr.exp threaded-fork.stdout.exp threaded-fork.vgtest \
tls.stderr.exp tls.stdout.exp \
yield.stderr.exp yield.stdout.exp yield.vgtest
stackgrowth sigstackgrowth \
smc1 susphello pending pth_blockedsig pth_stackalign \
syscall-restart1 syscall-restart2 system \
- thread-exits \
+ thread-exits threaded-fork \
tls tls.so tls2.so \
coolo_sigaction gxx304 yield
fucomip_SOURCES = fucomip.c
getseg_SOURCES = getseg.c
pending_SOURCES = pending.c
+manythreads_SOURCES = manythreads.c
+manythreads_LDADD = -lpthread
map_unaligned_SOURCES = map_unaligned.c
map_unmap_SOURCES = map_unmap.c
mq_SOURCES = mq.c
mq_LDADD = -lrt
mremap_SOURCES = mremap.c
munmap_exe_SOURCES = munmap_exe.c
+pth_blockedsig_SOURCES = pth_blockedsig.c
+pth_blockedsig_LDADD = -lpthread
+pth_stackalign_SOURCES = pth_stackalign.c
+pth_stackalign_LDADD = -lpthread
rcrl_SOURCES = rcrl.c
readline1_SOURCES = readline1.c
resolv_SOURCES = resolv.c
system_SOURCES = system.c
thread_exits_SOURCES = thread-exits.c
thread_exits_LDADD = -lpthread
+threaded_fork_SOURCES = threaded-fork.c
+threaded_fork_LDADD = -lpthread
tls_SOURCES = tls.c tls2.c
tls_DEPENDENCIES = tls.so
tls_LDFLAGS = -Wl,-rpath,$(top_builddir)/none/tests
yield_CFLAGS = $(AM_CFLAGS) -D__$(VG_ARCH)__
yield_LDADD = -lpthread
-# pthread C ones
-manythreads_SOURCES = manythreads.c
-manythreads_LDADD = -lpthread
-pth_blockedsig_SOURCES = pth_blockedsig.c
-pth_blockedsig_LDADD = -lpthread
-pth_stackalign_SOURCES = pth_stackalign.c
-pth_stackalign_LDADD = -lpthread
-
# generic C++ ones
coolo_sigaction_SOURCES = coolo_sigaction.cpp
gxx304_SOURCES = gxx304.cpp
--- /dev/null
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <pthread.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <signal.h>
+
+static void *threadmain( void *dummy )
+{
+ sleep( (int)dummy );
+ return NULL;
+}
+
+int main( int argc, char **argv )
+{
+ pid_t childpid;
+ pthread_t childthread;
+ void *res;
+ int status;
+
+ pthread_create( &childthread, NULL, threadmain, (void *)2 );
+
+ childpid = fork();
+ switch( childpid ) {
+ case 0:
+ pthread_create( &childthread, NULL, threadmain, 0 );
+ pthread_join( childthread, &res );
+ exit(0);
+ break;
+ case -1:
+ perror( "FAILED: fork failed\n" );
+ break;
+ default:
+ break;
+ }
+
+ pthread_join( childthread, &res );
+ while(waitpid(childpid, &status, 0) != childpid)
+ ;
+
+ printf("PASS\n");
+
+ return 0;
+}
+
+