CrossCore XA
Revision: 1.0
Programmers Guide
Date: Jul 1, 10
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 mmap.
8.3.3.
mmap
Description
Maps accelerometer device into a memory for user access.
Include files
#include <sys/mman.h>
#include <smb380face.h>
Syntax
void* mmap(
void *start,
size_t length,
int prot,
int flags,
int fd,
off_t offset
)
Parameters
start
Start of the virtual address. NULL=Let kernel choose
length
Length of the mapped memory
prot
Desired memory protections
flags
Flags to determne whether updates to the mapping are visible to other processes
mapping the same region
fd File
descriptor
offset
Offset of the file where mapping should start
count
Number of bytes to write to the front LED device
Return value
On success, the number of written bytes is returned. In case of errors, -1 is returned and errno is set
appropriately.
www.crosscontrol.com
44