Skip to content

feat(syscall): add clone3 support#122

Open
Mivik wants to merge 10 commits intoStarry-OS:mainfrom
Mivik:clone3
Open

feat(syscall): add clone3 support#122
Mivik wants to merge 10 commits intoStarry-OS:mainfrom
Mivik:clone3

Conversation

@Mivik
Copy link
Contributor

@Mivik Mivik commented Feb 28, 2026

Description

Building upon #79, this PR:

  • Fixed compilation error
  • Added some clone3-specific checks
  • Implemented thread-specific pidfd support, ensuring correct pidfd is returned when clone is invoked with the CLONE_THREAD | CLONE_PIDFD flags.

Copilot AI review requested due to automatic review settings February 28, 2026 06:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends StarryOS’s task/syscall layer to support the clone3 syscall and improves pidfd handling (including a thread-specific pidfd path for CLONE_THREAD | CLONE_PIDFD), plus related exit notification plumbing.

Changes:

  • Added sys_clone3 implementation and wired it into syscall dispatch.
  • Refactored clone implementation around a unified CloneArgs/CloneFlags path and added thread-specific pidfd creation.
  • Introduced a per-thread exit PollSet and expanded pidfd_open/PidFd to support thread pidfds and nonblocking mode.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
kernel/src/task/ops.rs Wakes a per-thread exit event during thread exit.
kernel/src/task/mod.rs Adds exit_event to Thread for exit notification.
kernel/src/syscall/task/mod.rs Registers and re-exports the new clone3 module.
kernel/src/syscall/task/clone3.rs Implements sys_clone3 argument parsing and dispatch into unified clone logic.
kernel/src/syscall/task/clone.rs Refactors clone into CloneArgs::do_clone, adds new clone flags, and adds thread/process pidfd creation.
kernel/src/syscall/mod.rs Adds syscall dispatch case for Sysno::clone3.
kernel/src/syscall/fs/pidfd.rs Adds pidfd_open flags parsing (thread + nonblock) and thread pidfd creation.
kernel/src/file/pidfd.rs Adds thread/process pidfd constructors, nonblocking state, and changes polling/exit tracking mechanism.
build-dora.sh Adds a local build/deploy helper script for a specific environment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants