Closing a Stream

The close(2)
interface closes a device and dismantles the associated stream when the last
open reference to the stream is closed. The exit(2)
interface terminates the user process and closes all open files.