SysClose

From WhitixDoc

Jump to: navigation, search

SysClose closes a file descriptor that has been previously opened by SysOpen.

Contents

Syntax

int SysClose(
    int fd
)

Parameters

  • fd. A valid file descriptor, which must be between zero and the maximum number of file descriptors allocated to the process.

Returns

Zero, if the filesystem object was closed successfully. If the filesystem object cannot be opened, one of the standard error codes will be returned.

Example

The following example closes the standard out file descriptor.

int ret=SysClose(0);
 
if (ret < 0)
{
    /* Failure */
}


Personal tools