From: "Jacques A. Vidrine" <nectar at FreeBSD.org> > The application is broken. You must only check errno if you get an > error indication from the library call. errno is only meaningful after a syscall error. it is also well known that stdio uses isatty(3) (or equivelant) that may set errno to ENOTTY.