CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
Parameters
pathname
Path to the device file
flags
Parameter flag must include one of the following access modes: O_RDONLY,
O_WRONLY or O_RDWR
Return value
The new file descriptor if successful. In case of errors, -1 is returned and errno is set appropriately.
Example
See example of ioctl.
4.3.2.
close
Description
Closes the file descriptor.
Include files
#include <unistd.h>
Syntax
int close(
int fd
)
Parameters
fd File
descriptor
Return value
Returns zero on success. In case of errors, -1 is returned and errno is set appropriately.
Example
See example of ioctl.
4.3.3.
read
Description
Reads data from the digital I/O-device. Note that the returned data is in a textual format that shows
the status of all the digital-in signals described in the I/O map section. For example of data output,
look at the last example listing in this chapter.
Include files
#include <unistd.h>
Syntax
ssize_t read(
int fd,
void *buf,
size_t count,
)
www.crosscontrol.com
25