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

How to implement System.Diagnostics.Process on FreeBSD? #14725

Closed
ghuntley opened this issue Jun 16, 2015 · 15 comments
Closed

How to implement System.Diagnostics.Process on FreeBSD? #14725

ghuntley opened this issue Jun 16, 2015 · 15 comments

Comments

@ghuntley
Copy link
Member

This issue is to discuss how we can implement System.Diagnostics.Process on FreeBSD which does not have procfs by enabled by default as it should be considered deprecated.

Reference Material

/cc: @janhenke @saper @jasonwilliams200OK @josteink

@stephentoub
Copy link
Member

The FreeBSD process information implementation within Mono

Thanks for the info, but please be careful linking to such code... to my knowledge, code in that area of Mono is under a license not compatible with MIT.

@meebey
Copy link

meebey commented Jun 16, 2015

@stephentoub that statement isn't correct. the MIT license is liberal enough that combined work of LGPLed code and MIT code effectively becomes LGPL.

@stephentoub
Copy link
Member

What I meant is that is that this corefx codebase is covered by the MIT license; you couldn't take code from areas of the Mono codebase covered by LGPL and just commit it to corefx.

@meebey
Copy link

meebey commented Jun 16, 2015

Technically you can, but the .NET Foundation will probably object such contribution, yes :)

@stephentoub
Copy link
Member

Which means you can't 😉 It will not be merged.

@saper
Copy link
Contributor

saper commented Jun 16, 2015

I wrote this code, you can treat it as public domain, it is no different from the manual page examples.

I hope it helps :)

@ghuntley
Copy link
Member Author

Tip-off from jasonwilliams200OK:

AFAIK, io.js team had similar challenges with FreeBSD process management.

https://github.com/nodejs/io.js/blob/master/deps/uv/src/unix/freebsd.c (MIT)

@ghost
Copy link

ghost commented Oct 3, 2015

@sokket, is System.Diagnostics.Process anywhere on the shim radar? :)
( hopefully not, but ) I think this one is going to be bit more challenging than dotnet/corefx#3471.

@jonmill
Copy link
Contributor

jonmill commented Oct 6, 2015

Sorry for the late response, I was on vacation the last few days...

@jasonwilliams200OK Yup, my goal is to get all the native calls shim'd, System.Diagnostics.Process included :). Is this specific one blocking you guys?

@ghost
Copy link

ghost commented Oct 6, 2015

@sokket, welcome back! :D
Yup this is one of those assemblies, which are not building. Besides that there are some types which would probably require special .FreeBSD.cs partial classes:

  • System.Diagnostics.ProcessManager
  • System.Diagnostics.ThreadInfo
  • System.IO.FileSystemWatcher
  • System.Net.SocketAddress (alright, this one was added recently)

For the rest of the congress of assemblies, which are successfully building, we are unable to test due to dotnet/buildtools#300 (and maybe other unknown factors too: https://github.com/dotnet/coreclr/issues/1633#issuecomment-143669303).

@jonmill
Copy link
Contributor

jonmill commented Oct 7, 2015

I did an initial investigation into FileSystemWatcher and wrote about it in #14716, but the tldr; is that the FreeBSD version would work very differently from the OSX and Linux implementations today. We have some options for how to mitigate that written up in the bug.

I'm currently working on shim'ing the ProcessInfo and ThreadInfo native calls over, but it looks like FreeBSD does not have the OSX system calls or ProcFS like on Linux. My refactor should make it simple for new platforms (such as FreeBSD 😄) to be brought up and working, as long as someone knows the correct native calls for that platform. If anyone on this thread knows the correct calls for retrieving process information, shoot me an email and (if they're trivial to add) I can add them to the PAL layer with my current pack

@saper
Copy link
Contributor

saper commented Oct 8, 2015

I have written the Mono implementation in mono/mono#1864. Feel free to use that (I have added a comment to dedicate this to public domain). Actually you should be able to use a (superior in my opinion) sysctl interface also on MacOSX (with some little changes).

Mono currently does not even require /proc to be mounted on FreeBSD now and the use of /proc is discouraged on this system.

@jonmill
Copy link
Contributor

jonmill commented Oct 8, 2015

I had to roll back some of the refactoring changes so I won't be able to get this into my current pack, unfortunately :(

@josteink
Copy link
Member

With the task of moving to shims done, should this issue too be closed?

@Priya91
Copy link
Contributor

Priya91 commented Dec 7, 2016

Closing this issue, given that mono implementations can be used now, and also shim work is done. Please open new issue with current data on Freebsd support if required.

@Priya91 Priya91 closed this as completed Dec 7, 2016
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 5, 2021
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

8 participants