CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
7.3.1.
open
Description
Opens the front LED device. The call will return a file descriptor used in subsequent calls such as
write() or close().
Include files
#include <fctnl.h>
Syntax
int open(
const char *pathname,
int flags
)
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 write.
7.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 write.
www.crosscontrol.com
39