Skip to content

Handle CWD as a globally available field#641

Merged
natoscott merged 7 commits intohtop-dev:masterfrom
BenBE:global_platform_cwd
May 27, 2021
Merged

Handle CWD as a globally available field#641
natoscott merged 7 commits intohtop-dev:masterfrom
BenBE:global_platform_cwd

Conversation

@BenBE
Copy link
Copy Markdown
Member

@BenBE BenBE commented May 25, 2021

No description provided.

@BenBE
Copy link
Copy Markdown
Member Author

BenBE commented May 25, 2021

The code for *BSDProcessList_updateCwd is identical on DragonFlyBSD, FreeBSD and also NetBSD (AFAIRTFM, plz check @fraggerfox). On OpenBSD it's essentially identical with the only difference being the MIB passed in to the sysctl. So basically we could generate the full function body via a macro in generic/ that takes the name of the field to write, the MIB initializer and be done with it. The field to write is also interesting, as for at least DragonFly, FreeBSD and NetBSD the *BSDProcessList_updateExe function is essentially the same, also just differing in the MIB being passed.

@BenBE BenBE force-pushed the global_platform_cwd branch 2 times, most recently from 30b294d to 0806d15 Compare May 25, 2021 17:46
@BenBE BenBE added this to the 3.0.6 milestone May 25, 2021
@BenBE BenBE added code quality ♻️ Code quality enhancement enhancement Extension or improvement to existing feature labels May 25, 2021
@BenBE BenBE force-pushed the global_platform_cwd branch 3 times, most recently from 836c6e4 to d0ce9e0 Compare May 25, 2021 19:15
@BenBE BenBE requested review from cgzones, fasterit and natoscott May 25, 2021 19:28
Comment thread solaris/SolarisProcessList.c Outdated
@BenBE BenBE force-pushed the global_platform_cwd branch from d0ce9e0 to a22d801 Compare May 25, 2021 19:34
@BenBE BenBE force-pushed the global_platform_cwd branch from a22d801 to c752c54 Compare May 25, 2021 19:55
Copy link
Copy Markdown
Member

@fasterit fasterit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on MacOS as requested. Builds and works fine.

Copy link
Copy Markdown
Member

@natoscott natoscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BenBE LGTM too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality ♻️ Code quality enhancement enhancement Extension or improvement to existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants