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

Function kvmd_init

tools/netstat/main.c:773–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

771
772#ifndef FSTACK
773static int
774kvmd_init(void)
775{
776 char errbuf[_POSIX2_LINE_MAX];
777
778 if (kvmd != NULL)
779 return (0);
780
781 kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
782 if (setgid(getgid()) != 0)
783 xo_err(-1, "setgid");
784
785 if (kvmd == NULL) {
786 xo_warnx("kvm not available: %s", errbuf);
787 return (-1);
788 }
789
790 return (0);
791}
792
793/*
794 * Resolve symbol list, return 0 on success.

Callers 5

kresolve_listFunction · 0.85
kset_dpcpuFunction · 0.85
kreadFunction · 0.85
kread_counterFunction · 0.85
kread_countersFunction · 0.85

Calls 2

xo_errFunction · 0.85
xo_warnxFunction · 0.85

Tested by

no test coverage detected