Skip to Main Content
Hands-On System Programming with Linux
book

Hands-On System Programming with Linux

by Kaiwan N. Billimoria, Tigran Aivazian
October 2018
Beginner content levelBeginner
794 pages
19h 23m
English
Packt Publishing
Content preview from Hands-On System Programming with Linux

SIDEBAR :: Testing the memcpy() C program

Now that we better understand the what and why of a VM system, let's go back to the buggy pseudocode example we considered at the beginning of this chapter: the case where we used memcpy(3) to copy some memory but specified the wrong destination address (and it would have overwritten the OS itself in our fictional physical-memory-only system).

A conceptually similar C program, but which runs on Linux—a full-fledged virtual-memory-enabled OS—is shown and tried out here. Let's see how the buggy program works on Linux:

$ cat mem_app1buggy.c/* * mem_app1buggy.c * *************************************************************** * This program is part of the source code released for the book * "Linux System ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming Techniques

Linux System Programming Techniques

Jack-Benny Persson
Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini

Publisher Resources

ISBN: 9781788998475Supplemental Content