Hey, does anybody know how to check whether the file descriptor is valid?