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

BIF for more detailed process information #9265

Open
hauleth opened this issue Jan 7, 2025 · 0 comments
Open

BIF for more detailed process information #9265

hauleth opened this issue Jan 7, 2025 · 0 comments
Labels
enhancement stalled waiting for input by the Erlang/OTP team team:VM Assigned to OTP team VM

Comments

@hauleth
Copy link
Contributor

hauleth commented Jan 7, 2025

Is your feature request related to a problem? Please describe.

In systemd integration library it would be useful to have access to process effective user ID and process effective group ID. Unfortunately there is only a way to get process ID (weirdly, it is returned as a string instead of a number).

Describe the solution you'd like

I have created a library that provides such functionality via NIF. It provides simple function os_process:info/0 that returns map containing process information (in this case it is for macOS):

#{pid => 62192,
  priority => #{process => 0,user => -1,process_group => 0},
  pgid => 62192,parent_pid => 62068,uid => 502,gid => 20,
  effective_uid => 502,effective_gid => 20}

The always present field is pid and rest is OS dependant.

Describe alternatives you've considered

Have separate function for each of the information kinds, but as getting that informations from the OS should be fairly cheap, then I think that single call with everything at once should be simpler and more useful. Alternatively we can have info/1 that would allow us to fetching only single fields.

@jhogberg jhogberg added the stalled waiting for input by the Erlang/OTP team label Jan 8, 2025
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement stalled waiting for input by the Erlang/OTP team team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

3 participants