CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
5.3.1.
open
Description
Opens the PWR device. The call will return a file descriptor used in subsequent calls such as read()
and ioctl().
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 ioctl.
5.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.
www.crosscontrol.com
30