Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The file module has functions to assign and flush a file buffer that are equivalents to POSIX API functions (see and Listing - File Module Function and Listing - POSIX API Equivalent); the primary difference is the advantage of valuable return error codes to the application.


Code Block
languagecpp
titleListing - File Module Function
linenumberstrue
void FSFile_BufAssign (FS_FILE    *p_file,
                       void       *p_buf,
                       FS_FLAGS    mode,
                       CPU_SIZE_T  size,
                       FS_ERR     *p_err);
 
void FSFile_BufFlush (FS_FILE  *p_file,
                      FS_ERR   *p_err);



Code Block
languagecpp
titleListing - POSIX API Equivalent
linenumberstrue

int fs_setvbuf (FS_FILE   *stream,
                char      *buf,
                int        mode,
                fs_size_t  size);


 int fs_fflush (FS_FILE  *stream);


For more information about and an example of configuring a file buffer, see Configuring a File Buffer - POSIX.