mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 20:24:35 +03:00
Solaris: add kstat lookup wrappers
The system interfaces kstat_lookup() and kstat_data_lookup() take a non-constant string parameter, but passing string literals is valid. Add wrapper functions to ignore all the const-discard warnings.
This commit is contained in:

committed by
cgzones

parent
4676e35f42
commit
fdda291a0e
@ -11,6 +11,7 @@ in the source distribution for its full text.
|
||||
|
||||
#include "config.h" // IWYU pragma: keep
|
||||
|
||||
#include <kstat.h>
|
||||
#include <libproc.h>
|
||||
#include <signal.h>
|
||||
#include <stdbool.h>
|
||||
@ -109,4 +110,16 @@ static inline void Platform_gettime_monotonic(uint64_t* msec) {
|
||||
Generic_gettime_monotonic(msec);
|
||||
}
|
||||
|
||||
static inline void* kstat_data_lookup_wrapper(kstat_t* ksp, const char* name) {
|
||||
IGNORE_WCASTQUAL_BEGIN
|
||||
return kstat_data_lookup(ksp, (char*)name);
|
||||
IGNORE_WCASTQUAL_END
|
||||
}
|
||||
|
||||
static inline kstat_t* kstat_lookup_wrapper(kstat_ctl_t* kc, const char* ks_module, int ks_instance, const char* ks_name) {
|
||||
IGNORE_WCASTQUAL_BEGIN
|
||||
return kstat_lookup(kc, (char*)ks_module, ks_instance, (char*)ks_name);
|
||||
IGNORE_WCASTQUAL_END
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user