Subversion Repositories Kolibri OS

Rev

Rev 6330 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright (C) KolibriOS team 2004-2024. All rights reserved.
  3.  * Distributed under terms of the GNU General Public License
  4. */
  5.  
  6. #include <sys/types.h>
  7. #include <errno.h>
  8. #include <sys/ksys.h>
  9.  
  10. int write_file(const char *path, const void *buff,
  11.                size_t offset, size_t count, size_t *writes)
  12. {
  13.     ksys_file_status_t st = _ksys_file_write(path, offset, count, buff);
  14.     *writes = st.rw_bytes;
  15.     if(!st.status)
  16.         return 0;
  17.     else if (st.status == KSYS_FS_ERR_8)
  18.         return ENOSPC;
  19.     return -1;
  20. }
  21.