fixed fcreat() implementation