Comment 2 for bug 374769

Charlie,

I have isolated the bug that occurred in a large application into a small
file, that I have included in my problem report.
In case you have not received it, here is the file again. Copy it into a
text editor window, save it as errkill.c, compile and run it: you will
see that the program prints the message corresponding to EPERM
instead of that of ESRCH, contrarily to what the man page of
pthread_join states:

------------------------file errkill.c-----------------------------------------
#include <pthread.h>
#include <stdio.h>
#include <string.h>

void* victim(void* data){
   return NULL;
}

main (){
   pthread_t th;
   int err;
   pthread_create(&th,NULL,victim,0);
   pthread_join(th,NULL);
   if (err = pthread_kill(th,0) != 0){
       printf("pthread_kill %s\n",strerror(err));
   }
}
----------------------------end of file--------------------------------------

$ gcc errkill.c -o errkill.exe -lpthread
$ ./errkill.exe
pthread_kill Operation not permitted