in reply to return file descriptor from function
Could you give a little more of the "bigger picture"? ...some context will lead to more useful answers. We need to know more about what you're trying to do.
Dave