Document number
204911
Version
Rev. K
Issue date
2016-10-11
Sirius Breadboard User Manual
www.aacmicrotec.com
Page
44
of
106
Return value
Description
>0
Number of bytes that were read.
- 1
see
errno
values
errno values
EBADF
The file descriptor
fd
is not an open file
descriptor
EINVAL
Page offset set in
lseek
is out of range
or
nbytes
is too large and reaches a page
that is out of range.
EBUSY
Device is busy with previous read/write
operation.
5.7.2.5.
size_t write(…)
Writes requested size of bytes to the device starting from the offset set in
lseek
.
Note!
For iterative write operations,
lseek
must be called to set page offset before each
write operation.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
.
buf
void *
in
Character buffer to read data from
nbytes
size_t
in
Number of bytes to write from
buf
.
Return value
Description
>0
Number of bytes that were written.
- 1
see
errno
values
errno values
EBADF
The file descriptor
fd
is not an open file
descriptor
EINVAL
Page offset set in
lseek
is out of range or
nbytes
is too large and reaches a page
that is out of range.
EAGAIN
Driver failed to write data. Try again.
5.7.2.6.
int ioctl(…)
Additional supported operations via POSIX Input/Output Control API.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open.
cmd
int
in
Command defined in subchapters 5.7.2.6.1 to
5.7.2.6.9.
value
void *
in
The value relating to command operation as
defined in subchapters 5.7.2.6.1 to 5.7.2.6.9.
5.7.2.6.1. Bad block check
Checks if the given block is a bad block.