1COREDUMPERPARAMETERS(3) Library Functions Manual COREDUMPERPARAMETERS(3)
2
3
4
6 ClearCoreDumpParameters, SetCoreDumpLimited, SetCoreDumpCompressed,
7 SetCoreDumpLimitedByPriority, SetCoreDumpNotes - functions to initial‐
8 ize and set fields in a CoreDumpParameters structure.
9
11 #include “google/coredumper.h”
12
13 void ClearCoreDumpParameters(struct CoreDumpParameters *params);
14
15 int SetCoreDumpLimited(struct CoreDumpParameters *params, size_t
16 max_length);
17
18 int SetCoreDumpLimitedByPriority(struct CoreDumpParameters
19 *params, size_t max_length);
20
21 int SetCoreDumpCompressed(struct CoreDumpParameters *
22 params, const struct CoredumpCompressor
23 *compressors, struct CoredumperCompressor
24 **selected_compressor);
25
26 int SetCoreDumpNotes(struct CoreDumpParameters *params,
27 struct CoredumperNote *notes, int note_count);
28
30 These functions must be used to set the attributes in a CoreDumpParame‐
31 ters structure. Combinations of these functions may be used together.
32 For instance to produce a compressed core dump with additional notes
33 you should call ClearCoreDumpParameters(), SetCoreDumpCompressed() and
34 SetCoreDumpNotes().
35
36 The ClearCoreDumpParameters() function clears the given core dumper
37 parameters structure to its default values.
38
39 The SetCoreDumpLimited() function sets the attributes in params to pro‐
40 duce core files of at most max_length bytes when called with WriteCore‐
41 DumpWith(). This must not be used with SetCoreDumpLimitedByPriority().
42
43 The SetCoreDumpLimitedByPriority() function sets the attributes in
44 params to produce core files of at most max_length bytes when called
45 with WriteCoreDumpWith(). This differs from normal limiting by truncat‐
46 ing the largest memory segments first as opposed to truncating the
47 whole core file. This must not be used with SetCoreDumpLimited() or
48 SetCoreDumpCompressed().
49
50 The SetCoreDumpCompressed() function sets the attributes in params to
51 produce a compressed core dump when called with GetCoreDumpWith() or
52 WriteCoreDumpWith(). Its arguments match the ones passed to GetCom‐
53 pressedCoreDump().
54
55 The SetCoreDumpNotes() function sets the attributes in params to add
56 additional notes to core dumps when called with GetCoreDumpWith() or
57 WriteCoreDumpWith(). The notes are specified as an array of the Core‐
58 dumperNote structure:
59
60 struct CoredumperNote {
61 const char *name; // The vendor name
62 unsigned int type; // A vendor specific type
63 unsigned int description_size; // The size of the description field
64 const void *description; // The note data
65 };
66
67 The name, including a terminating null character, will be 4 byte
68 aligned. The type is a user chosen value. The description_size speci‐
69 fies the amount of bytes to write from the description pointer in mem‐
70 ory to the core dump note. The description will be padded to be 4 byte
71 aligned.
72
74 On success 0 will be returned. On error -1 will be returned and errno
75 will be set appropriately.
76
78 The most common reason for an error is that incompatable parameters are
79 combined.
80
82 GetCoreDump(3), GetCoreDumpWith(3), GetCompressedCoreDump(3),
83 WriteCoreDump(3), WriteCoreDumpWith(3), WriteCoreDumpLimited(3),
84 WriteCoreDumpLimitedByPriority(3), and WriteCompressedCoreDump(3).
85
86
87
88 Mar 11, 2008 COREDUMPERPARAMETERS(3)