The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
(lmgrd) Can't open /usr/tmp/.flexlm/lmgrdl.4081, errno: 24 return_user UNIX and Linux Applications 2 05-02-2008 06:47 AM
Hi errno in sys/stat.h vijlak High Level Programming 6 11-11-2006 06:13 PM
CRITICAL 11/08/05 12:06:26 _getsockopt reports error. errno: 239 niks.20 High Level Programming 0 11-14-2005 10:25 AM
login error after sys-unconfig, errno = 13 roing UNIX for Dummies Questions & Answers 14 02-08-2004 08:25 AM
Getting errno in a Multithreaded program S.Vishwanath High Level Programming 2 03-25-2002 06:58 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 08-06-2004
dts dts is offline
Registered User
 

Join Date: Aug 2004
Posts: 4
errno pb

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
$
Reply With Quote
Forum Sponsor
  #2  
Old 08-06-2004
dts dts is offline
Registered User
 

Join Date: Aug 2004
Posts: 4
I need to test errno to know if my recvfrom return EAGAIN.

my code :
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");
     }
}
Quote:
251
Error in recvfrom: Resource temporarily unavailable
How can I correct the problem ??

Thanks for your help.
Reply With Quote
  #3  
Old 08-06-2004
dts dts is offline
Registered User
 

Join Date: Aug 2004
Posts: 4
Quote:
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

Quote:
What happens if you omit the printf() and have the if-test execute immediately afterwards?
Error in recvfrom: Resource temporarily unavailable
Reply With Quote
  #4  
Old 08-06-2004
dts dts is offline
Registered User
 

Join Date: Aug 2004
Posts: 4
I have resolved my problem. I use Multi-threaded and I have gorget the option with gcc :
-D_REENTRANT

Thankes for your help
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0