Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
100
of
174
Return value
Description
>0
A file descriptor for the device.
- 1
see
errno
values
errno values
ENOENT
Invalid filename
EEXIST
Device already opened.
Table 5-6 - open flag symbols
Symbol
Description
O_RDONLY
Open for reading only
O_WRONLY
Open writing only
O_RDWR
Open for reading and writing
5.12.3.2. Function
int close(…)
Closes access to the device.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
.
Return value
Description
0
Device closed successfully
-1
see
errno
values
errno values
EBADF
The file descriptor
fd
is not an open file descriptor
5.12.3.3. Function
off_t lseek(…)
Sets page offset for read/ write operations.
NOTE:
The interface is not strictly POSIX, as the offset argument is expected to be given in
pages and not bytes.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
.
offset
off_t
in
Page number. (
NOTE:
Not bytes!)
whence
Int
in
Must be set to SEEK_SET.
Return value
Description
offset
Page number
- 1
see
errno
values
errno values
EBADF
The file descriptor
fd
is not an open file descriptor
EINVAL
whence
is not a proper value.
EOVERFLOW
The resulting file offset would overflow
off_t
.