Usually, file are accessed using various functions. However, these seems to incur a lot of overhead. Therefore, for fast access, you would use mmap() to map certain variable to the memory address and lseek() would be used to move within that file.
There can be an example of this since usually this file is mapped to DRAM and it is volatile. To write this on the disk, you would use msync(). Failure can happen during the process, which is Failure-Atomic msync(). Terence Kelly seems to be actively working on this.