184 •
Application Examples
Example of Reading and Writing from the NVRAM
•
•
int close(int fd);
This function closes the open file which is a reference to the file
descriptor.
fd: File descriptor returned by the
off_t lseek(int fd, off_t offset, int mode);
This function sets the position pointer to any byte within the file and
returns the current position in the file.
fd: File descriptor returned by the
offset: Position within the file from which the bytes are read and written.
mode:
SEEK_SET: Within the file, both read/write operations start from the
offset value (in bytes).
SEEK_CUR: Within the file, both read/write operations start from the
current position + offset value.
SEEK_END: Within the file, both read/write operations start from the last
byte + offset value (here the offset is usually "0" or negative value).
function.
open
function.
open
WAGO-I/O-SYSTEM 750
Linux Fieldbus Coupler