| 35 | } |
| 36 | |
| 37 | static 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 |
nothing calls this directly
no test coverage detected