MCPcopy Create free account
hub / github.com/F-Stack/f-stack / textdump_dump_config

Function textdump_dump_config

freebsd/ddb/db_textdump.c:302–326  ·  view source on GitHub ↗

* Dump kernel configuration. */

Source from the content-addressed store, hash-verified

300 * Dump kernel configuration.
301 */
302static void
303textdump_dump_config(struct dumperinfo *di)
304{
305 u_int count, fullblocks, len;
306
307 len = strlen(kernconfstring);
308 textdump_mkustar(textdump_block_buffer, TAR_CONFIG_FILENAME, len);
309 (void)textdump_writenextblock(di, textdump_block_buffer);
310
311 /*
312 * Write out all full blocks directly from the string, and handle any
313 * left-over bits by copying it to out to the local buffer and
314 * zero-padding it.
315 */
316 fullblocks = len / TEXTDUMP_BLOCKSIZE;
317 for (count = 0; count < fullblocks; count++)
318 (void)textdump_writenextblock(di, kernconfstring + count *
319 TEXTDUMP_BLOCKSIZE);
320 if (len % TEXTDUMP_BLOCKSIZE != 0) {
321 bzero(textdump_block_buffer, TEXTDUMP_BLOCKSIZE);
322 bcopy(kernconfstring + count * TEXTDUMP_BLOCKSIZE,
323 textdump_block_buffer, len % TEXTDUMP_BLOCKSIZE);
324 (void)textdump_writenextblock(di, textdump_block_buffer);
325 }
326}
327#endif /* INCLUDE_CONFIG_FILE */
328
329/*

Callers 1

textdump_dumpsysFunction · 0.85

Calls 3

textdump_mkustarFunction · 0.85
textdump_writenextblockFunction · 0.85
bzeroFunction · 0.85

Tested by

no test coverage detected