trivialleak.stderr.exp trivialleak.vgtest \
tronical.stderr.exp tronical.vgtest \
weirdioctl.stderr.exp weirdioctl.stdout.exp weirdioctl.vgtest \
- metadata.stderr.exp metadata.stdout.exp metadata.vgtest
+ metadata.stderr.exp metadata.stdout.exp metadata.vgtest \
+ threadederrno.stderr.exp threadederrno.stdout.exp threadederrno.vgtest
check_PROGRAMS = \
badaddrvalue badfree badjump badloop buflen_check clientperm \
overlap pushfpopf \
realloc1 realloc2 sigaltstack signal2 supp1 supp2 suppfree \
trivialleak tronical weirdioctl \
- mismatches new_override metadata
+ mismatches new_override metadata threadederrno
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
tronical_SOURCES = tronical.S
weirdioctl_SOURCES = weirdioctl.c
metadata_SOURCES = metadata.c
+threadederrno_SOURCES = threadederrno.c
+threadederrno_LDADD = -lpthread
# C++ ones
mismatches_SOURCES = mismatches.cpp
--- /dev/null
+
+#include <pthread.h>
+#include <stdio.h>
+#include <errno.h>
+
+
+
+void* thr2 ( void* v )
+{
+ FILE* f = fopen("bogus2", "r");
+ printf("f2 = %p, errno2 = %d\n", f, errno);
+ perror("wurble2");
+ return NULL;
+}
+
+void* thr3 ( void* v )
+{
+ FILE* f = fopen("bogus3", "r");
+ printf("f3 = %p, errno3 = %d\n", f, errno);
+ perror("wurble3");
+ return NULL;
+}
+
+
+int main ( void )
+{
+ FILE* f;
+ pthread_t tid2, tid3;
+ pthread_create(&tid2, NULL, &thr2, NULL);
+ pthread_create(&tid3, NULL, &thr3, NULL);
+ f = fopen("bogus", "r");
+ printf("f1 = %p, errno1 = %d\n", f, errno);
+ perror("wurble1");
+ pthread_join(tid2, NULL);
+ pthread_join(tid3, NULL);
+ return 0;
+}
+