mirror of https://mirror.osredm.com/root/redis.git
zmalloc_get_rss openbsd implementation (#10149)
Add support for getting the RSS in OpenBSD
This commit is contained in:
parent
3720de78c9
commit
834fa5870c
|
@ -467,10 +467,16 @@ size_t zmalloc_get_rss(void) {
|
||||||
|
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
|
||||||
|
#if defined(__OpenBSD__)
|
||||||
|
#define kinfo_proc2 kinfo_proc
|
||||||
|
#define KERN_PROC2 KERN_PROC
|
||||||
|
#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
|
||||||
|
#endif
|
||||||
|
|
||||||
size_t zmalloc_get_rss(void) {
|
size_t zmalloc_get_rss(void) {
|
||||||
struct kinfo_proc2 info;
|
struct kinfo_proc2 info;
|
||||||
size_t infolen = sizeof(info);
|
size_t infolen = sizeof(info);
|
||||||
|
|
Loading…
Reference in New Issue