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

Function fail_point_sysctl_status

freebsd/kern/kern_fail.c:923–952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

921}
922
923int
924fail_point_sysctl_status(SYSCTL_HANDLER_ARGS)
925{
926 struct fail_point *fp;
927 struct sbuf sb, *sb_check;
928
929 fp = arg1;
930
931 sb_check = sbuf_new(&sb, NULL, 1024, SBUF_AUTOEXTEND);
932 if (sb_check != &sb)
933 return (ENOMEM);
934
935 sbuf_set_drain(&sb, (sbuf_drain_func *)fail_sysctl_drain_func, req);
936
937 /* Retrieving. */
938 fail_point_get(fp, &sb, true);
939
940 sbuf_finish(&sb);
941 sbuf_delete(&sb);
942
943 /**
944 * Lock protects any new entries from being garbage collected before we
945 * can link them to the fail point.
946 */
947 sx_xlock(&sx_fp_set);
948 fail_point_garbage_collect();
949 sx_xunlock(&sx_fp_set);
950
951 return (0);
952}
953
954int
955fail_sysctl_drain_func(void *sysctl_args, const char *buf, int len)

Callers

nothing calls this directly

Calls 6

sbuf_newFunction · 0.85
sbuf_set_drainFunction · 0.85
fail_point_getFunction · 0.85
sbuf_finishFunction · 0.85
sbuf_deleteFunction · 0.85

Tested by

no test coverage detected