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

Function S_pagesizes

tools/sysctl/sysctl.c:881–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879}
880
881static int
882S_pagesizes(size_t l2, void *p)
883{
884 char buf[256];
885 u_long *ps;
886 size_t l;
887 int i;
888
889 l = snprintf(buf, sizeof(buf), "{ ");
890 ps = p;
891 for (i = 0; i * sizeof(*ps) < l2 && ps[i] != 0 && l < sizeof(buf);
892 i++) {
893 l += snprintf(&buf[l], sizeof(buf) - l,
894 "%s%lu", i == 0 ? "" : ", ", ps[i]);
895 }
896 if (l < sizeof(buf))
897 (void)snprintf(&buf[l], sizeof(buf) - l, " }");
898
899 printf("%s", buf);
900
901 return (0);
902}
903
904#ifdef __amd64__
905#ifdef FSTACK

Callers

nothing calls this directly

Calls 2

snprintfFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected