mirror of
https://github.com/aristocratos/btop.git
synced 2024-09-28 22:21:35 +02:00
arg_max should be int on macos
This commit is contained in:
parent
0b5a931a6d
commit
c60fc29f0f
@ -108,7 +108,7 @@ namespace Shared {
|
|||||||
uint64_t totalMem;
|
uint64_t totalMem;
|
||||||
long pageSize, clkTck, coreCount, physicalCoreCount;
|
long pageSize, clkTck, coreCount, physicalCoreCount;
|
||||||
int totalMem_len;
|
int totalMem_len;
|
||||||
size_t arg_max;
|
int arg_max;
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
//? Shared global variables init
|
//? Shared global variables init
|
||||||
@ -1237,7 +1237,8 @@ namespace Proc {
|
|||||||
string proc_args;
|
string proc_args;
|
||||||
proc_args.resize(Shared::arg_max);
|
proc_args.resize(Shared::arg_max);
|
||||||
int mib[] = {CTL_KERN, KERN_PROCARGS2, (int)pid};
|
int mib[] = {CTL_KERN, KERN_PROCARGS2, (int)pid};
|
||||||
if (sysctl(mib, 3, proc_args.data(), &Shared::arg_max, NULL, 0) == 0) {
|
size_t argmax = Shared::arg_max;
|
||||||
|
if (sysctl(mib, 3, proc_args.data(), &argmax, NULL, 0) == 0) {
|
||||||
int argc;
|
int argc;
|
||||||
memcpy(&argc, &proc_args[0], sizeof(argc));
|
memcpy(&argc, &proc_args[0], sizeof(argc));
|
||||||
if (size_t null_pos = proc_args.find('\0', sizeof(argc)); null_pos != string::npos) {
|
if (size_t null_pos = proc_args.find('\0', sizeof(argc)); null_pos != string::npos) {
|
||||||
|
Loading…
Reference in New Issue
Block a user