Support Socket.DuplicateAndClose through pidfd_getfd on Linux

Open
#113,701 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp, linux

Research direction

Read the pidfd_getfd(2) documentation and related issue #1760, then trace the existing DuplicateAndClose implementation in the runtime. Done means determining whether pidfd_getfd can implement DuplicateAndClose on Linux, including the stated ptrace-permission concern.

Written by the indexing model from the issue text.

Description

area-System.Net.Sockets help wanted

Related: https://github.com/dotnet/runtime/issues/1760

Syscall:
https://man7.org/linux/man-pages/man2/pidfd_getfd.2.html

It should be possible to use this syscall to implement DuplicateAndClose, it seems with it Linux no longer fundamentally differs from Windows' WSADuplicateSocket. Though I can imagine the ptrace permission requirement may be problematic.

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.