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

Function vn_fill_junk

freebsd/kern/vfs_vnops.c:2517–2533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2515}
2516
2517static inline void
2518vn_fill_junk(struct kinfo_file *kif)
2519{
2520 size_t len, olen;
2521
2522 /*
2523 * Simulate vn_fullpath returning changing values for a given
2524 * vp during e.g. coredump.
2525 */
2526 len = (arc4random() % (sizeof(kif->kf_path) - 2)) + 1;
2527 olen = strlen(kif->kf_path);
2528 if (len < olen)
2529 strcpy(&kif->kf_path[len - 1], "$");
2530 else
2531 for (; olen < len; olen++)
2532 strcpy(&kif->kf_path[olen], "A");
2533}
2534
2535int
2536vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif)

Callers 1

vn_fill_kinfo_vnodeFunction · 0.85

Calls 1

arc4randomFunction · 0.50

Tested by

no test coverage detected