Close() - Multitech MultiConnect MTPCIE-H5 Series Developer's Manual

Hide thumbs Also See for MultiConnect MTPCIE-H5 Series:
Table of Contents

Advertisement

USING LINUX WITH H5 DEVICES
Parameters:
fildes – file descriptor
buf – destination buffer pointer
nbyte – number of bytes that write() attempts to write
Returns:
The number of bytes actually written if the operation is completed successfully, otherwise it is -1.
Example
Write strlen(value_to_be_written) bytes from the buffer pointed by
value_to_be_written to the file
associated with the open file descriptor, fd.
char value_to_be_written[] = "dummy_write";
if (write(fd, value_to_be_written, strlen(value_to_be_written)) < 0)
{
/* Error Management Routine */
} else {
/* Value Written */
}

close()

The close() function shall deallocate the file descriptor indicated by fildes. To deallocate means to make the file
descriptor available for return by subsequent calls to open() or other functions that allocate file descriptors.
Header File
unistd.h
Prototype:
int close(int fildes);
Parameters:
fildes - file descriptor
Returns:
0 if successful, otherwise it is -1.
Example
Close the ttyACMx file.
if(close(fd) < 0)
{
/* Error Management Routine */
} else {
/* File Closed */
}
78
®
MultiConnect
PCIe MTPCIE-H5/MTPCIE-BW Developer Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MultiConnect MTPCIE-H5 Series and is the answer not in the manual?

Questions and answers

Table of Contents