
TIP675-SW-42 – VxWorks Device Driver
Page 15 of 31
4.2 close()
NAME
close() – close a device or file
SYNOPSIS
int close
(
int
fd
)
DESCRIPTION
This function closes opened devices.
PARAMETER
fd
This file descriptor specifies the device to be closed. The file descriptor has been returned by
the
open()
function.
EXAMPLE
int
fd;
int
retval;
…
/*----------------
close the device
----------------*/
retval = close(fd);
if (retval == ERROR)
{
/* Handle error */
}
…