Skip to content

Conversation

@WyZ0125
Copy link

@WyZ0125 WyZ0125 commented Dec 9, 2025

Description

This PR adds initial support for the clone3 system call in StarryOS.

The implementation introduces the basic clone3 syscall path and supports
a commonly used subset of clone3 flags, enabling user programs and tests
to create new processes using the modern clone3 interface.

This work lays the groundwork for improving Linux compatibility and enables
future support for thread creation and synchronization primitives built on
top of clone3 (e.g., futex-based threading).

Implementation

  • Added a new clone3 syscall handler and integrated it into the syscall
    dispatch framework.
  • Implemented validation and handling for core clone3 arguments and flags,
    including:
    • process creation semantics
    • exit_signal
    • CLONE_PARENT_SETTID
    • CHILD_CLEARTID
  • Ensured compatibility with existing process/task infrastructure.
  • Explicitly rejected unsupported or conflicting flag combinations to match
    expected Linux error semantics where possible.

Some Linux features related to clone3 (e.g., session/process group semantics
and PR_SET_CHILD_SUBREAPER) are not yet supported in StarryOS and are
documented as known limitations.

Additional Context

  • The implementation has been tested with user-space clone3 test programs
    and passes basic functionality tests.
  • Certain advanced Linux behaviors are intentionally left for future work and
    do not block the correctness of this initial clone3 support.
  • Some advanced Linux semantics are intentionally deferred to keep this PR
    focused on establishing a correct and minimal clone3 syscall foundation.

@AsakuraMizu
Copy link
Contributor

AsakuraMizu commented Dec 9, 2025

Plz do not close and reopen one pr over and over again... 😢

@WyZ0125
Copy link
Author

WyZ0125 commented Dec 9, 2025

Plz do not close and reopen one pr over and over again... 😢

Im SORRY. Some bugs fixed and I am adapting to the contribution process. Sorry teacher.

@WyZ0125
Copy link
Author

WyZ0125 commented Dec 9, 2025

Plz do not close and reopen one pr over and over again... 😢

I have tested the Asterinas testing program as per your request, and the main functional test results have been recorded in the discussion: https://github.com/orgs/Starry-OS/discussions/21

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