MCPcopy Create free account
hub / github.com/MemNixFS/MemNixFS / pid_count_producer

Function pid_count_producer

tests/c_api/sample_plugin.cpp:37–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37static int pid_count_producer(lmpfs_handle_t eng, lmpfs_plugin_buffer_t* out) {
38 int n = lmpfs_process_count(eng);
39 char buf[64];
40 int len = std::snprintf(buf, sizeof(buf), "%d processes visible\n", n);
41 if (len < 0) return -1;
42 out->length = (size_t)len;
43 out->data = std::malloc(out->length);
44 if (!out->data) return -1;
45 std::memcpy(out->data, buf, out->length);
46 out->free_fn = nullptr;
47 return 0;
48}
49
50/* ---- required init export ---------------------------------------------- */
51

Callers

nothing calls this directly

Calls 1

lmpfs_process_countFunction · 0.85

Tested by

no test coverage detected