1PMEMLOG_APPEND(3) PMDK Programmer's Manual PMEMLOG_APPEND(3)
2
3
4
6 pmemlog_append(), pmemlog_appendv() - append bytes to the persistent
7 memory resident log file
8
10 #include <libpmemlog.h>
11
12 int pmemlog_append(PMEMlogpool *plp, const void *buf, size_t count);
13 int pmemlog_appendv(PMEMlogpool *plp, const struct iovec *iov, int iovcnt);
14
16 The pmemlog_append() function appends count bytes from buf to the cur‐
17 rent write offset in the log memory pool plp. Calling this function is
18 analogous to appending to a file. The append is atomic and cannot be
19 torn by a program failure or system crash.
20
21 The pmemlog_appendv() function appends to the log memory pool plp from
22 the scatter/gather list iov in a manner similar to writev(2). The en‐
23 tire list of buffers is appended atomically, as if the buffers in iov
24 were concatenated in order. The append is atomic and cannot be torn by
25 a program failure or system crash.
26
28 On success, pmemlog_append() and pmemlog_appendv() return 0. On error,
29 they return -1 and set errno appropriately.
30
32 EINVAL The vector count iovcnt is less than zero.
33
34 ENOSPC There is no room for the data in the log file.
35
36 EROFS The log file is open in read-only mode.
37
39 Since libpmemlog(7) is designed as a low-latency code path, many of the
40 checks routinely done by the operating system for writev(2) are not
41 practical in the library's implementation of pmemlog_appendv(). No at‐
42 tempt is made to detect NULL or incorrect pointers, for example.
43
45 writev(2), libpmemlog(7) and <https://pmem.io>
46
47
48
49PMDK - pmemlog API version 1.1 2020-01-31 PMEMLOG_APPEND(3)