Hi ,
I have downloaded the GNU portable thread library
pth-1.3.7 on NetBSD1.4.1
I am trying to create a simple thread program, but
thread is not created.
pthread_create returns 0 (success), but no thread
is created. Errno is
set to 4, which is EINTR.
Pls help/guide me in this regard. I have no clue of
what is happening :-(
I am putting the code with the mail.
Thanks in Advance
Rajnish
#include <pthread.h>
#include <pth.h> #include <stdio.h> #include <errno.h> static void *func(void *arg)
{ printf("Inside the child Thread\n"); sleep(1); return (void *)NULL; } extern int errno;
int main()
{ pthread_t thdId; int retVal = -1; retVal = pth_init();
printf("retVal for the pth_init is %d\n", retVal); retVal = pthread_create(&thdId, NULL, func, NULL); printf("Errno set is %d\n",
errno);
sleep(20); } |