sewardj | 58bef2e | 2003-07-13 11:13:37 +0000 | [diff] [blame] | 1 | |
| 2 | #include <pthread.h> |
| 3 | #include <stdio.h> |
| 4 | #include <errno.h> |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 5 | #include <string.h> |
sewardj | 58bef2e | 2003-07-13 11:13:37 +0000 | [diff] [blame] | 6 | |
| 7 | |
| 8 | void* thr2 ( void* v ) |
| 9 | { |
| 10 | FILE* f = fopen("bogus2", "r"); |
nethercote | ceaeb3b | 2004-01-21 17:34:56 +0000 | [diff] [blame] | 11 | printf("f = %p, errno = %d (%s)\n", f, errno, strerror(errno)); |
sewardj | 58bef2e | 2003-07-13 11:13:37 +0000 | [diff] [blame] | 12 | return NULL; |
| 13 | } |
| 14 | |
| 15 | void* thr3 ( void* v ) |
| 16 | { |
| 17 | FILE* f = fopen("bogus3", "r"); |
nethercote | ceaeb3b | 2004-01-21 17:34:56 +0000 | [diff] [blame] | 18 | printf("f = %p, errno = %d (%s)\n", f, errno, strerror(errno)); |
sewardj | 58bef2e | 2003-07-13 11:13:37 +0000 | [diff] [blame] | 19 | return NULL; |
| 20 | } |
| 21 | |
| 22 | |
| 23 | int 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"); |
nethercote | b973698 | 2004-01-21 17:40:16 +0000 | [diff] [blame] | 30 | printf("f = %p, errno = %d (%s)\n", f, errno, strerror(errno)); |
sewardj | 58bef2e | 2003-07-13 11:13:37 +0000 | [diff] [blame] | 31 | pthread_join(tid2, NULL); |
| 32 | pthread_join(tid3, NULL); |
| 33 | return 0; |
| 34 | } |
| 35 | |