use posix fd input instead of cin