close
Closes a file or stream
#include <unistd.h>
int close (
int handle);
When an error occurs while closing the file, a value of -1 is returned. Otherwise, a value of 0 is returned.
If an error occurs, errno is set to:
If the function does not complete successfully, NetWareErrno is set.
This function also works on the DOS partition.
The handle value is the file handle returned by a successful execution of the open, sopen, or creat function. After a file is closed, the file handle is no longer valid and should not be reused.
UNIX STREAMS: If a Stream file is closed and the calling process had previously registered to receive a SIGPOLL signal for events associated with that file, the calling process is unregistered for events associated with the file.
The last close for a Stream causes the Stream associated with handle to be dismantled.