I have done the following steps..
created socket
bound the socket
socket listens
socket accept..(here it returns always -1)
On failure, accept sets errno to indicate the reason for
the failure. What is the value returned in errno?
MV
--
I do not want replies; please follow-up to the group.
how to retrive errorno ???
>>
>> On failure, accept sets errno to indicate the reason for
>> the failure. What is the value returned in errno?
>>
>
> how to retrive errorno ???
>
Note: it's "errno", not "errorno"
Try "man errno"
You might also want to try "man perror" and "man accept"
I found it.....
#include <error.h>
printf("%d",errno);
Please don't quote sig blocks.
Read your documentation with more care.
It's <errno.h>, not <error.h>.
>
> I found it.....
> #include <error.h>
>
> printf("%d",errno);
That will work. But likely your next question will be:
"what does error code XX mean?"
If you use perror(), it will print out a text string
corresponding to the error, and that should make it
easier for you to figure out what is going wrong.
Thanx..before than I was using google to understand the error code...