Skip to content

Comments

feat: Initial WSL1 support#4

Merged
facekapow merged 1 commit intodarlinghq:mainfrom
trungnt2910:dev/trungnt2910/wsl1-support
Aug 22, 2022
Merged

feat: Initial WSL1 support#4
facekapow merged 1 commit intodarlinghq:mainfrom
trungnt2910:dev/trungnt2910/wsl1-support

Conversation

@trungnt2910
Copy link
Contributor

Part of darlinghq/darling#1206.

  • Implemented an alternative to pidfd_open for kernels older than 5.3.
    mldr should send a "lifetime pipe" to darlingserver during process start.
    When the process dies, darlingserver should receive a POLLHUP event.
  • Set increased_limit.rlim_cur to default_limit.rlim_max on systems without
    /proc/sys/fs/nr_open. On WSL1, this greatly increases the number of open file
    descriptors available.
  • For systems without NSpid in /proc/self/status, implemented a way to manage
    thread IDs in darlingserver during checkin. darlingserver should receive a hint
    address on the thread's stack, and then compare it with a stack pointer retrieved using
    PTRACE_GETREGS
  • Avoided sending socket messages when msg_hdr.msg_name->sun_path is an empty string.
    A null msg_name is used instead, otherwise, on some systems, this would fail with EINVAL.

- Implemented an alternative to pidfd_open for kernels older than 5.3.
mldr should send a "lifetime pipe" to darlingserver during process start.
When the process dies, darlingserver should receive a POLLHUP event.
- Set increased_limit.rlim_cur to default_limit.rlim_max on systems without
/proc/sys/fs/nr_open. On WSL1, this greatly increases the number of open file
descriptors available.
- For systems without NSpid in /proc/self/status, implemented a way to manage
thread IDs in darlingserver during checkin. darlingserver should receive a hint
address on the thread's stack, and then compare it with a stack pointer retrieved using
PTRACE_GETREGS
- Avoided sending socket messages when msg_hdr.msg_name->sun_path is an empty string.
A null msg_name is used instead, otherwise, on some systems, this would fail with EINVAL.
Copy link
Member

@facekapow facekapow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks great! Let me just do some testing to ensure this doesn't break Darling on non-WSL1.

@facekapow facekapow merged commit 94c3758 into darlinghq:main Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants