The file module has functions to assign and flush a file buffer that are equivalents to POSIX API functions; the primary difference is the advantage of valuable return error codes to the application.
For more information about and an example of configuring a file buffer, see Configuring a File Buffer - POSIX.