

close()                COHERENT System Call               close()




Close a file

iinntt cclloossee(_f_d) iinntt _f_d;

close closes the file identified by the file descriptor _f_d, which
was returned by ccrreeaatt, dduupp,  ooppeenn, or ppiippee.  close also frees the
associated file descriptor.

Because each program can have only a limited number of files open
at any given time,  programs that process many files should close
files whenever  possible.  The function  exit automatically calls
fclose for  all open files;  however, the system  call _exit does
not.

***** Example *****

For an example of this function, see the entry for open.

***** See Also *****

COHERENT system calls, creat(), open()

***** Diagnostics *****

close returns -1  if an error occurs, such as  its being handed a
bad file descriptor; otherwise, it returns zero.






























COHERENT Lexicon                                           Page 1


