How to get the file descriptor of a handle?