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

Add Support for Process's ParentProcessId on FreeBSD #28679

Closed
bgribaudo opened this issue Feb 13, 2019 · 9 comments
Closed

Add Support for Process's ParentProcessId on FreeBSD #28679

bgribaudo opened this issue Feb 13, 2019 · 9 comments

Comments

@bgribaudo
Copy link
Contributor

Request/Need

Implement private instance method Process.ParentProcessId method on FreeBSD. Presumably this will involve adding an interop method that calls the appropriate native API method.

Background

Currently, this method is not supported on FreeBSD (e.g. throws a PlatformNotSupportedException). This lack blocks Kill(entireProcessTree: true) from being supported on FreeBSD.

Related: dotnet/corefx#34147 (comment)

@bgribaudo
Copy link
Contributor Author

/cc: @tmds @danmosemsft

@wfurt
Copy link
Member

wfurt commented Feb 15, 2019

do you have simple code to run to reproduce this @bgribaudo ?

@bgribaudo
Copy link
Contributor Author

Off the top of my head, maybe just try calling process.Kill(entireProcessTree: true) on a process instance?

@am11
Copy link
Member

am11 commented Apr 16, 2019

I think this FreeBSD implementation will fill the gap: https://github.com/am11/corefx/commit/fe9254b980ae777a0d7c08b6290b1026259cec86.

I didn't open a pull request due to the blocker that we are unable to build CoreFX on FreeBSD; hitting package restore errors (https://github.com/dotnet/corefx/issues/2046#issuecomment-481739054). If building CoreFX via source-build is a viable option with release/3.0 branch, I can attempt @wfurt, @dagood (on a private VM for now).

Otherwise, we can park it until the whole azure-pipelines-agent -> core-setup -> core-sdk -> corefx,coreclr chain is unblocked. 😢

@bgribaudo
Copy link
Contributor Author

Thanks for working on this, @am11! It will be nice to see this supported on another platform.

@wfurt
Copy link
Member

wfurt commented Apr 16, 2019

I would probably add ppid to proc_stats instead of dragging unsafe code to Process.cs. I'll see what I can do about the build. It would be nice to have it back.

@am11
Copy link
Member

am11 commented Apr 16, 2019

Agree, your approach is much cleaner @wfurt: https://github.com/am11/corefx/commit/871cf28?w=1
(remove ?w=1 to compare with whitespace/formatting changes)

@am11
Copy link
Member

am11 commented Jan 8, 2020

The property was implemented in master branch, can be closed.

@danmoseley
Copy link
Member

Thanks @am11

@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the Future milestone Feb 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants