Add some file descriptor handling API functions