It seems as though the following calls do what you\'d expect (close the stream and not allow any further input - anything waiting for input on the stream returns error), but
DO NOT DO a close on fileno(FILE*). FILE is a buffering object. Looking into its implementation and meddling with its state carries all the caveats and dangers that would come with similar misbehavior on any other software module.