Implement private instance method Process.ParentProcessId method on FreeBSD. Presumably this will involve adding an interop method that calls the appropriate native API method.
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: https://github.com/dotnet/corefx/pull/34147#discussion_r248261306
/cc: @tmds @danmosemsft
do you have simple code to run to reproduce this @bgribaudo ?
Off the top of my head, maybe just try calling process.Kill(entireProcessTree: true) on a process instance?
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. 馃槩
Thanks for working on this, @am11! It will be nice to see this supported on another platform.
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.
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)
The property was implemented in master branch, can be closed.
Thanks @am11
Most helpful comment
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.