dts
August 6, 2004, 5:11am
1
Hello,
I need to make a lib with pthread, when I run my make file all is good. But when I run my test program, I test errno in the begining and is already set to 251. Is it normal ??? What can I modify in my Makefile to have errno set to 0 ???
Thanks
$make
gcc -D_REENTRANT -shared -fpic -lpthread gas_configuration.c gas_acquisition.c -o libgas_fifos.sl
gcc -L. -lgas_fifos testComm.c -o test
$./test
Begin
errno : 251
$
dts
August 6, 2004, 6:00am
2
I need to test errno to know if my recvfrom return EAGAIN.
my code :
retour = recvfrom(t_sockets[indice].socket, payload, FRAME_LENGTH, O_NONBLOCK, &t_sockets[indice].sin_remote, &size_addr);
if(retour >= 0)
{
.......
}
else
{
printf("errno %d\n", errno);
if(errno != EAGAIN)
{
perror("Error in recvfrom");
}
}
How can I correct the problem ??
Thanks for your help.
dts
August 6, 2004, 6:20am
3
Originally posted by Driver
Are you absolutely sure the code you posted matches the code you are using? Because the error message indicates that errno compares uneven to EAGAIN even though it IS EAGAIN.
What does printf("%d\n", EAGAIN); tell you?
11
Error in recvfrom: Resource temporarily unavailable
dts
August 6, 2004, 9:51am
4
I have resolved my problem. I use Multi-threaded and I have gorget the option with gcc :
-D_REENTRANT
Thankes for your help