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

Function db_capture_zeropad

freebsd/ddb/db_capture.c:248–257  ·  view source on GitHub ↗

* Zero out any bytes left in the last block of the DDB capture buffer. This * is run shortly before writing the blocks to disk, rather than when output * capture is stopped, in order to avoid injecting nul's into the middle of * output. */

Source from the content-addressed store, hash-verified

246 * output.
247 */
248static void
249db_capture_zeropad(void)
250{
251 u_int len;
252
253 len = min(TEXTDUMP_BLOCKSIZE, (db_capture_bufsize -
254 db_capture_bufoff) % TEXTDUMP_BLOCKSIZE);
255 bzero(db_capture_buf + db_capture_bufoff, len);
256 db_capture_bufpadding = len;
257}
258
259/*
260 * Reset capture state, which flushes buffers.

Callers 1

db_capture_dumpFunction · 0.85

Calls 2

minFunction · 0.85
bzeroFunction · 0.85

Tested by

no test coverage detected