* Dump kernel configuration. */
| 300 | * Dump kernel configuration. |
| 301 | */ |
| 302 | static void |
| 303 | textdump_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 | /* |
no test coverage detected