johalun / sysctl-rs

A simplified Rust interface to the sysctl system call
MIT License
51 stars 23 forks source link

implement variant of Ctl that strictly uses sysctlbyname #55

Closed StephanvanSchaik closed 2 years ago

StephanvanSchaik commented 2 years ago

sysctl-rs makes extensive use of sysctl oidfmt to look up the type and format of sysctls. Unfortunately, this is not allowed on non-jailbroken iOS as any such calls return -EPERM. Instead, we should be using sysctlbyname on iOS, which means that we are way more restricted since we cannot look up the type or format, and as such the user will have to provide these for full iOS support. In addition, the original implementation does work on jailbroken iOS, so we want to keep that option available (e.g. you could first try using Ctl::new() and then fallback to Ctl::new_with_type() to support both).

This PR changes the following things:

johalun commented 2 years ago

Solid PR, thank you!