74
The examples used in this chapter are
• simple_copy.c is a small program that copies a 4KiB block from a
source file to a destination file on persistent memory.
• full_copy.c is a more complete copy program, copying
the entire file.
• manpage.c is the simple example used in the libpmem man page.
Using the Library
To use libpmem, start by including the appropriate header, as shown in Listing 6-1.
Listing 6-1. Including the libpmem headers
32
33 / *
34 * simple_copy.c
35 *
36 * usage: simple_copy src-file dst-file
37 *
38 * Reads 4KiB from src-file and writes it to dst-file.
39 * /
40
41 #include
42 #include
43 #include
44 #include
45 #include
46 #include
47 #ifndef _WIN32
48 #include
49 #else
50 #include
51 #endif
52 #include
53 #include
Chapter 6 libpmem: low-level persistent memory support
Précédent

- 102/457

Suivant