2024-01-04 23:20:35 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) KolibriOS team 2004-2024. All rights reserved.
|
|
|
|
* Distributed under terms of the GNU General Public License
|
|
|
|
*/
|
2014-05-11 00:12:19 +02:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
2024-01-04 23:20:35 +01:00
|
|
|
#include <sys/ksys.h>
|
2014-05-11 00:12:19 +02:00
|
|
|
|
|
|
|
int read_file(const char *path, void *buff,
|
|
|
|
size_t offset, size_t count, size_t *reads)
|
|
|
|
{
|
2024-01-04 23:20:35 +01:00
|
|
|
ksys_file_status_t st = _ksys_file_read(path, offset, count, buff);
|
|
|
|
*reads = st.rw_bytes;
|
|
|
|
return st.status == KSYS_FS_ERR_EOF ? 0 : st.status;
|
|
|
|
}
|