arm64 front end: ufbm/sfbm: handle plain shifts explicitly
[valgrind.git] / none / tests / threadederrno.c
blobffc735e13908223a624b54ed6b2deb1be6637983
1 /* Make sure we use the POSIX version of strerror_r() on Linux. */
2 #define _XOPEN_SOURCE 600
4 #include <pthread.h>
5 #include <stdio.h>
6 #include <errno.h>
7 #include <string.h>
10 void* thr2 ( void* v )
12 char errstr[128];
13 FILE* f = fopen("bogus2", "r");
14 strerror_r(errno, errstr, sizeof(errstr));
15 printf("f = %ld, errno = %d (%s)\n", (long)f, errno, errstr);
16 return NULL;
19 void* thr3 ( void* v )
21 char errstr[128];
22 FILE* f = fopen("bogus3", "r");
23 strerror_r(errno, errstr, sizeof(errstr));
24 printf("f = %ld, errno = %d (%s)\n", (long)f, errno, errstr);
25 return NULL;
29 int main ( void )
31 char errstr[128];
32 FILE* f;
33 pthread_t tid2, tid3;
34 pthread_create(&tid2, NULL, &thr2, NULL);
35 pthread_create(&tid3, NULL, &thr3, NULL);
36 f = fopen("bogus", "r");
37 strerror_r(errno, errstr, sizeof(errstr));
38 printf("f = %ld, errno = %d (%s)\n", (long)f, errno, errstr);
39 pthread_join(tid2, NULL);
40 pthread_join(tid3, NULL);
41 return 0;