Writes sectors into a file using DFS, sleeping until completion.
#include <dfs.h> int dfs_write ( int fildes, uint32_t startingSector, size_t sectorCount, const void *buffer );
(IN) Specifies the file handle returned from a prior dfs_sopen or dfs_creat call for the indicated file.
(IN) Specifies the starting sector number in the file (logical offset from beginning of the file) where the write operation is to begin.
(IN) Specifies the number of sectors to be written from the buffer.
(IN) Points to a contiguous buffer area large enough to contain the number of sectors to be written.
If successful, returns 0. Otherwise, returns a nonzero error code:
For possible DFS errors, see Section 13.4.5, DFS Return Values.
This function performs a write of one or more sectors using a logical zero-based sector offset into the indicated file. Since this function is blocking, control is returned to the caller after all writes relating to the requested write function are completed. It is not possible to write beyond the end of the allocated area of a file, or in holes where no blocks are allocated. This function sets a new file size if a write is issued to allocated file space beyond the current file size.