This very well could be considered "Too Far Off Topic" but not entirely sure because this question is only answerable by someone who is well familiar with FreeBSD, not just macOS and Darwin. If it is too far off topic feel free to close this, and I'll try not to cry lol.
I want to port system libraries and OS-level features of FreeBSD to macOS and Darwin. More specifically process handling code. Stuff that uses sysctl() and the implementation of that function is much more limited on mac. So I wanted to add features mac is missing that FreeBSD has, basically.
The only thing I can think of in particular, that I actually need for my projects, is getting the environment block from a given process id. This can be done on both FreeBSD and macOS but on mac it's more limited. On FreeBSD you can get the environment variables from a given pid in their current state at any given point in time, where as with mac KERN_PROCARGS2 and KERN_PROCARGS only allow getting the environment block of a process id when the process initially started from the command line that launched it, so if a environment variable was added or an existing one changed since process creation, you would have no way to get that information on mac.
Does anyone know if stuff like this is possible to port from FreeBSD to mac? All I want to know is if it is possible without reverse engineering macOS. Since Darwin and the macOS kernel is open source it would seem it is possible? Or am I missing something?
I want to port system libraries and OS-level features of FreeBSD to macOS and Darwin. More specifically process handling code. Stuff that uses sysctl() and the implementation of that function is much more limited on mac. So I wanted to add features mac is missing that FreeBSD has, basically.
The only thing I can think of in particular, that I actually need for my projects, is getting the environment block from a given process id. This can be done on both FreeBSD and macOS but on mac it's more limited. On FreeBSD you can get the environment variables from a given pid in their current state at any given point in time, where as with mac KERN_PROCARGS2 and KERN_PROCARGS only allow getting the environment block of a process id when the process initially started from the command line that launched it, so if a environment variable was added or an existing one changed since process creation, you would have no way to get that information on mac.
Does anyone know if stuff like this is possible to port from FreeBSD to mac? All I want to know is if it is possible without reverse engineering macOS. Since Darwin and the macOS kernel is open source it would seem it is possible? Or am I missing something?