|
From: Julian S. <js...@ac...> - 2003-05-12 00:03:26
|
> However... I managed to recreate the exact same problem with another
> testcase. The new testcase contains the same code, but runs in a
> different thread. Script is attached.
Er, yes. There's definitely some still wrong with errno handling
on both my glibc-2.3.2 systems. The attached test program I made
doesn't work properly -- the perror calls print different stuff when
running on V. I'll look into it more tomorrow night. The strange
thing is the numbers returned by the errno uses are right, it's just
that when perror reads errno it gets junk.
Nick, can you lmk if it works on R H 7.1? Thx,
J
#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;
}
|