Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thoughts on sysctls that take arguments? #51

Open
inferiorhumanorgans opened this issue Apr 7, 2022 · 3 comments
Open

Thoughts on sysctls that take arguments? #51

inferiorhumanorgans opened this issue Apr 7, 2022 · 3 comments

Comments

@inferiorhumanorgans
Copy link

e.g. from the sysctl manpage:

         int i, mib[4];
           size_t len;
           struct kinfo_proc kp;

           /* Fill out the first three components of the mib */
           len = 4;
           sysctlnametomib("kern.proc.pid", mib, &len);

           /* Fetch and print entries for pid's < 100 */
           for (i = 0; i < 100; i++) {
                   mib[3] = i;
                   len = sizeof(kp);
                   if (sysctl(mib, 4, &kp, &len, NULL, 0) == -1)
                           perror("sysctl");
                   else if (len > 0)
                           printkproc(&kp);
           }
@orhun
Copy link

orhun commented Apr 10, 2022

Can you elaborate what you mean?

@inferiorhumanorgans
Copy link
Author

Some sysctls like kern.proc.pid take an argument (mib[3]) and I was wondering if you had any thoughts/plans about implementing support for that.

@johalun
Copy link
Owner

johalun commented Apr 18, 2022

No plans myself to implement that at this time. PRs are always welcome though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants