close Function

Close a file.

Include

None

Prototype

int close(int handle);

Argument

handle handle referring to an opened file

Return Value

Returns ‘0’ if the file is successfully closed. A return value of ‘-1’ indicates an error.

Remarks

This helper function is called by the fclose() Standard C Library function.

Default Behavior

As distributed, this function passes the file handle to the simulator, which issues a close in the host file system.

File

close.c