LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (http://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   rdstate() is dumping core on Linux 2.6.x kernel (http://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/rdstate-is-dumping-core-on-linux-2-6-x-kernel-836901/)

Lkpaturi@tcs 10-08-2010 03:43 AM

rdstate() is dumping core on Linux 2.6.x kernel
 
Hi,

I build my executable on a 2.4.x kernel and was running as expected on the same system. Where as when I tried to run it on 2.6.x kernel it was dumping core :( and the stack trace shows rdstate()

My code check the stream status before calling socket read() function. I'm using

ios *x;

if((x->rdstate() & ios::badbit) != 0)
{
return 0;
}
else
{
....
...
sock->read(...)
..
..
}


When I observed there is diff in rdstate() output on 2.4.x & 2.6.x linux servers


On 2.6.x kernel
ios --> rdstate():0 badbit:4 failbit:2 eofbit:1 ==> for good conditon

ios --> rdstate():192 badbit:4 failbit:2 eofbit:1 ==> for bad condition


On 2.4.x kernel
ios --> rdstate():172 badbit:4 failbit:2 eofbit:1 ==> for good condition

ios --> rdstate():14 badbit:4 failbit:2 eofbit:1 ==> for bad condition





I'd like to know whey rdstate() is returning diff values for diff kernels. Any help would be greatly appreciated

TB0ne 10-08-2010 07:51 AM

Don't post the same question multiple times. Duplicate post reported.

XavierP 10-08-2010 11:39 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 01:44 AM.