|
47 | 47 | <refname>sd_journal_enumerate_data</refname> |
48 | 48 | <refname>sd_journal_restart_data</refname> |
49 | 49 | <refname>SD_JOURNAL_FOREACH_DATA</refname> |
| 50 | + <refname>sd_journal_set_data_threshold</refname> |
| 51 | + <refname>sd_journal_get_data_threshold</refname> |
50 | 52 | <refpurpose>Read data fields from the current journal entry</refpurpose> |
51 | 53 | </refnamediv> |
52 | 54 |
|
|
81 | 83 | <paramdef>size_t <parameter>length</parameter></paramdef> |
82 | 84 | </funcprototype> |
83 | 85 |
|
| 86 | + <funcprototype> |
| 87 | + <funcdef>int <function>sd_journal_set_data_threshold</function></funcdef> |
| 88 | + <paramdef>sd_journal* <parameter>j</parameter></paramdef> |
| 89 | + <paramdef>size_t <parameter>sz</parameter></paramdef> |
| 90 | + </funcprototype> |
| 91 | + |
| 92 | + <funcprototype> |
| 93 | + <funcdef>int <function>sd_journal_get_data_threshold</function></funcdef> |
| 94 | + <paramdef>sd_journal* <parameter>j</parameter></paramdef> |
| 95 | + <paramdef>size_t* <parameter>sz</parameter></paramdef> |
| 96 | + </funcprototype> |
84 | 97 | </funcsynopsis> |
85 | 98 | </refsynopsisdiv> |
86 | 99 |
|
|
102 | 115 | <function>sd_journal_enumerate_data()</function>, or |
103 | 116 | the read pointer is altered. Note that the data |
104 | 117 | returned will be prefixed with the field name and |
105 | | - '='.</para> |
| 118 | + '='. Also note that by default data fields larger than |
| 119 | + 64K might get truncated to 64K. This threshold may be |
| 120 | + changed and turned off with |
| 121 | + <function>sd_journal_set_data_threshold()</function> (see |
| 122 | + below).</para> |
106 | 123 |
|
107 | 124 | <para><function>sd_journal_enumerate_data()</function> |
108 | 125 | may be used to iterate through all fields of the |
|
128 | 145 | <citerefentry><refentrytitle>sd_journal_next</refentrytitle><manvolnum>3</manvolnum></citerefentry> |
129 | 146 | (or related call) has been called at least |
130 | 147 | once, in order to position the read pointer at a valid entry.</para> |
| 148 | + |
| 149 | + <para><function>sd_journal_set_data_threshold()</function> |
| 150 | + may be used to change the data field size threshold |
| 151 | + for data returned by |
| 152 | + <function>sd_journal_get_data()</function>, |
| 153 | + <function>sd_journal_enumerate_data()</function> and |
| 154 | + <function>sd_journal_enumerate_unique()</function>. This |
| 155 | + threshold is a hint only: it indicates that the client |
| 156 | + program is interested only in the initial parts of the |
| 157 | + data fields, up to the threshold in size -- but the |
| 158 | + library might still return larger data objects. That |
| 159 | + means applications should not rely exclusively on this |
| 160 | + setting to limit the size of the data fields returned, |
| 161 | + but need to apply a explicit size limit on the |
| 162 | + returned data as well. This threshold defaults to 64K |
| 163 | + by default. To retrieve the complete data fields this |
| 164 | + threshold should be turned off by setting it to 0, so |
| 165 | + that the library always returns the complete data |
| 166 | + objects. It is recommended to set this threshold as |
| 167 | + low as possible since this relieves the library from |
| 168 | + having to decompress large compressed data objects in |
| 169 | + full.</para> |
| 170 | + |
| 171 | + <para><function>sd_journal_get_data_threshold()</function> |
| 172 | + returns the currently configured data field size |
| 173 | + threshold.</para> |
131 | 174 | </refsect1> |
132 | 175 |
|
133 | 176 | <refsect1> |
|
144 | 187 | read, 0 when no more fields are known, or a negative |
145 | 188 | errno-style error |
146 | 189 | code. <function>sd_journal_restart_data()</function> |
147 | | - returns nothing.</para> |
| 190 | + returns |
| 191 | + nothing. <function>sd_journal_set_data_threshold()</function> |
| 192 | + and <function>sd_journal_get_threshold()</function> |
| 193 | + return 0 on success or a negative errno-style error |
| 194 | + code.</para> |
148 | 195 | </refsect1> |
149 | 196 |
|
150 | 197 | <refsect1> |
151 | 198 | <title>Notes</title> |
152 | 199 |
|
153 | 200 | <para>The <function>sd_journal_get_data()</function>, |
154 | | - <function>sd_journal_enumerate_data()</function> and |
155 | | - <function>sd_journal_restart_data()</function> |
| 201 | + <function>sd_journal_enumerate_data()</function>, |
| 202 | + <function>sd_journal_restart_data()</function>, |
| 203 | + <function>sd_journal_set_data_threshold()</function> |
| 204 | + and |
| 205 | + <function>sd_journal_get_data_threshold()</function> |
156 | 206 | interfaces are available as shared library, which can |
157 | 207 | be compiled and linked to with the |
158 | 208 | <literal>libsystemd-journal</literal> |
|
0 commit comments