Skip to content

Conversation

gwr
Copy link
Contributor

@gwr gwr commented Jun 27, 2025

SunOS process and thread support (native)

Read binary psinfo for System.Diagnostic.Process on SunOS
Alternate approach using src/native/libs/System.Native

Add native/libs/System.Native/pal_io.c etc.
Add src/libraries/Common/src/Interop/SunOS/procfs
Add src/libraries/System.Diagnostics.Process

Thanks for initial prototype help from:
Austin Wise AustinWise@gmail.com

am11 and others added 9 commits June 24, 2025 13:39
Update eng/Subsets.props

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
  dotnet/runtime/src/native/minipal/debugger.c:127:5: error: implicit declaration of function 'snprintf' [-Werror=implicit-function-declaration]
    127 |     snprintf(statusFilename, sizeof(statusFilename), "/proc/%d/status", getpid());
        |     ^~~~~~~~
  src/native/minipal/thread.h:73:23: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     73 |         tid = (size_t)(void*)pthread_self();
        |                       ^~~~~~~~~~~~~~~~~~~~~
 src/native/libs/System.Native/pal_mount.c:164:38: error: 'struct statvfs' has no member named 'f_type'
    164 |         *formatType = (int64_t)(stats.f_type);
        |                                      ^
  /home/gwr/dotnet/runtime/src/coreclr/pal/src/thread/thread.cpp:1367:5: error: 'cid' was not declared in this scope
   1367 |     cid = CLOCK_THREAD_CPUTIME_ID;
        |     ^~~
 src/coreclr/vm/appdomain.hpp:1934:40: error: declaration of 'constexpr SystemDomain** const cdac_data<SystemDomain>::SystemDomain' changes meaning of 'SystemDomain' [-Wchanges-meaning]
   1934 |     static constexpr PTR_SystemDomain* SystemDomain = &SystemDomain::m_pSystemDomain;
        |                                        ^~~~~~~~~~~~
  src/coreclr/vm/appdomain.hpp:1934:56: note: used here to mean 'class SystemDomain'
   1934 |     static constexpr PTR_SystemDomain* SystemDomain = &SystemDomain::m_pSystemDomain;
        |                                                        ^~~~~~~~~~~~
  src/coreclr/vm/appdomain.hpp:1629:7: note: declared here
   1629 | class SystemDomain final
        |       ^~~~~~~~~~~~
 on illumos with gcc 13.3 cross copmiler
 coreclr/runtime/amd64/AllocFast.S: Assembler messages:
  coreclr/runtime/amd64/AllocFast.S:237: Error: missing ')'
  /runtime/src/coreclr/tools/superpmi/mcs/verbmerge.cpp: In static member function 'static bool verbMerge::DirectoryFilterDirectories(FilterArgType*)':
  /runtime/src/coreclr/tools/superpmi/mcs/verbmerge.cpp:188:19: error: 'verbMerge::FilterArgType' {aka 'struct dirent'} has no member named 'd_type'
    188 |     if (findData->d_type == DT_DIR)
        |                   ^~~~~~

and similar a few other places in this file

Let FilterArgType use struct FindData to simplify filters.
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 27, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 27, 2025
@gwr
Copy link
Contributor Author

gwr commented Jun 27, 2025

Please Ignore all but the last commit. The others are in #117023 and are in this branch to let it build.

Read binary psinfo for System.Diagnostic.Process on SunOS
Alternate approach using src/native/libs/System.Native

Add native/libs/System.Native/pal_io.c etc.
Add src/libraries/Common/src/Interop/SunOS/procfs
Add src/libraries/System.Diagnostics.Process

Thanks for initial prototype help from:
Austin Wise <AustinWise@gmail.com>
@jkotas jkotas added area-System.Diagnostics.Process and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jun 27, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

@gwr
Copy link
Contributor Author

gwr commented Jun 28, 2025

I decided to go with this version (using src/native/libs/System.Native C functions) in my earlier pull request #105403

@gwr gwr closed this Jun 28, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Diagnostics.Process community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants