Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
55
of
174
5.6.3.4. s
size_t read(…)
Reads requested size of bytes from the device starting from the offset set in
lseek
.
Note!
For iterative read operations,
lseek
must be called to set page offset
before
each
read operation.
Note!
The character buffer location handed to
read
must be 32-bit aligned.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
.
buf
void *
in
Character buffer where to store the data
nbytes
size_t
in
Number of bytes to read into
buf
.
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.6.3.5. s
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
ssize_t
in
Number of bytes to write from
buf
.