1 /* Make sure we use the POSIX version of strerror_r() on Linux. */
2 #define _XOPEN_SOURCE 600
10 void* thr2 ( void* v
)
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
);
19 void* thr3 ( void* v
)
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
);
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
);