use fileno comparison only as an alternative and when available