O'Reilly logo

Solaris™ Internals: Core Kernel Components by Richard McDougall, Jim Mauro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.5. Memory Mapped File I/O

File I/O discussed so far is done with the read, write, and lseek system calls to perform I/O on behalf of a process and to copy the data to or from the process's address space. The I/O is performed into a kernel buffer and then copied to or from the process's address space, as illustrated in Figure 11.3.

Figure 11.3. File Read with read(2)

The new memory architecture first introduced with SunOS 3.2 allows a new way of doing file I/O, that is, by mapping a file directly into the process's address space. The mmap system call allows us to map a range of a file into a process's address space; then, the file can be accessed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required