Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
Knowing if a file descriptor is open
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
jorba101
New Member
Join Date:
Jun 2008
Posts:
86
#1
Knowing if a file descriptor is open
Nov 20 '08, 08:32 AM
Is there any way, using fcntl() to know whether a filedescriptor is open or closed (*NIX environment)
ashitpro
Recognized Expert
Contributor
Join Date:
Aug 2007
Posts:
542
#2
Nov 20 '08, 11:00 AM
Can't you use select() system call?
If you pass the closed file descriptor as parameter it will return the -1 indicating the error. And errno will be set to EBADF
Regards,
Ash
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment