Commit 551b7d1a authored by Kevin Wolf's avatar Kevin Wolf

libc: lio_compat_read_nonblock()

+ libc: Eine neue Read-Funktion, die nicht blockiert, und sowohl mit
  LIOv1- als auch LIOv2-Dateien tut.
Signed-off-by: Kevin Wolf's avatarKevin Wolf <kevin@tyndur.org>
parent f5b3518c
......@@ -226,6 +226,10 @@ int lio_compat_close(io_resource_t* io_res);
ssize_t lio_compat_read(void* dest, size_t blocksize, size_t blockcount,
io_resource_t* io_res);
/** Liest aus einer Ressource ohne zu blockieren. */
ssize_t lio_compat_read_nonblock(void* dest, size_t size,
io_resource_t* io_res);
/** Liest aus einer Ressource, ohne den Dateizeiger zu verändern */
ssize_t lio_compat_readahead(void* dest, size_t size, io_resource_t* io_res);
......
......@@ -270,6 +270,16 @@ ssize_t lio_compat_read(void* dest, size_t blocksize, size_t blockcount,
return lio1_read_fn(dest, blocksize, blockcount, io_res, "IO_READ ");
}
ssize_t lio_compat_read_nonblock(void* dest, size_t size,
io_resource_t* io_res)
{
if (IS_LIO2(io_res)) {
return lio_readf(io_res->lio2_stream, 0, size, dest, LIO_REQ_FILEPOS);
}
return lio1_read_fn(dest, 1, size, io_res, "IO_READ ");
}
/**
* Schreibt in eine Ressource
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment