blob: 9d9b0fffa834590e840504bd6f6b15d89ca936b2 [file] [log] [blame]
sewardj58bef2e2003-07-13 11:13:37 +00001
2#include <pthread.h>
3#include <stdio.h>
4#include <errno.h>
fitzhardinge98abfc72003-12-16 02:05:15 +00005#include <string.h>
sewardj58bef2e2003-07-13 11:13:37 +00006
7
8void* thr2 ( void* v )
9{
10 FILE* f = fopen("bogus2", "r");
sewardj4bdd5052006-10-17 01:28:48 +000011 printf("f = %ld, errno = %d (%s)\n", (long)f, errno, strerror(errno));
sewardj58bef2e2003-07-13 11:13:37 +000012 return NULL;
13}
14
15void* thr3 ( void* v )
16{
17 FILE* f = fopen("bogus3", "r");
sewardj4bdd5052006-10-17 01:28:48 +000018 printf("f = %ld, errno = %d (%s)\n", (long)f, errno, strerror(errno));
sewardj58bef2e2003-07-13 11:13:37 +000019 return NULL;
20}
21
22
23int main ( void )
24{
25 FILE* f;
26 pthread_t tid2, tid3;
27 pthread_create(&tid2, NULL, &thr2, NULL);
28 pthread_create(&tid3, NULL, &thr3, NULL);
29 f = fopen("bogus", "r");
sewardj4bdd5052006-10-17 01:28:48 +000030 printf("f = %ld, errno = %d (%s)\n", (long)f, errno, strerror(errno));
sewardj58bef2e2003-07-13 11:13:37 +000031 pthread_join(tid2, NULL);
32 pthread_join(tid3, NULL);
33 return 0;
34}
35