Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ibd5a7abf40e56d8e57c7b51a5dd9495c51bd9624
*/
int rseq_mempool_range_init_numa(void *addr, size_t len, int cpu, int numa_flags);
+/*
+ * rseq_mempool_get_max_nr_cpus: Get the max_nr_cpus value configured for a pool.
+ *
+ * Returns a value >= 0 for a per-cpu pool.
+ * Returns -1, errno=EINVAL if the mempool is NULL or if the pool has a
+ * global pool type.
+ */
+int rseq_mempool_get_max_nr_cpus(struct rseq_mempool *mempool);
+
#ifdef __cplusplus
}
#endif
attr->max_nr_cpus = 0;
return 0;
}
+
+int rseq_mempool_get_max_nr_cpus(struct rseq_mempool *mempool)
+{
+ if (!mempool || mempool->attr.type != MEMPOOL_TYPE_PERCPU) {
+ errno = EINVAL;
+ return -1;
+ }
+ return mempool->attr.max_nr_cpus;
+}