fcntl(sockfd,F_GETFD,0)
doesn't detect a bad file descriptor whereas select
on the same sock fd gives bad file descriptor
error.
Asked
Active
Viewed 858 times
0

alk
- 69,737
- 10
- 105
- 255

user1495948
- 65
- 2
- 9
-
Could you give some more info? Under what conditions does it happen? What is the value of sockfd? How and when do you do perform this check? – Maksim Skurydzin Oct 13 '12 at 11:21
-
I have a server and a client .At the server side the socket is not closed but during select it gives bad file descriptor error.The check to find which of the fd had gone bad using fcntl doesnt give any error. – user1495948 Oct 13 '12 at 11:35
-
2More likely there is something wrong with your select code. How about you post it? – user207421 Oct 13 '12 at 12:29
-
What is errno set to when using select()? Is it `(errno == EBADF)`? – askmish Oct 19 '12 at 11:13
-
Are you using select() with threads? Where are you creating the socket? Little bit of code will help. – askmish Oct 19 '12 at 11:19