Skip to content

feat(ipc/sem): add semaphore support for dragonOS - #2172

Open
mistcoversmyeyes wants to merge 4 commits into
DragonOS-Community:masterfrom
mistcoversmyeyes:feat/ipc-sem-2142
Open

feat(ipc/sem): add semaphore support for dragonOS#2172
mistcoversmyeyes wants to merge 4 commits into
DragonOS-Community:masterfrom
mistcoversmyeyes:feat/ipc-sem-2142

Conversation

@mistcoversmyeyes

@mistcoversmyeyes mistcoversmyeyes commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Related

Summary

  • Implement the x86_64 System V semaphore syscalls: semget, semctl, semop, and semtimedop.
  • Add semaphore-set management to IPC namespaces.
  • Extract and reuse common System V IPC permission checks.

Scope

  • Match the Linux 6.6 x86_64 ABI and observable behavior.
  • SEM_UNDO is out of scope and currently returns ENOSYS.

Acceptance

  • Valid semaphore syscall requests no longer return ENOSYS.
  • semop and semtimedop share consistent operation semantics.
  • Creation, lookup, control, removal, and permission checks match Linux behavior.
  • Multi-operation requests execute atomically.
  • Blocking operations wake correctly after value changes or IPC_RMID.
  • Nonblocking, timeout, signal, invalid-argument, and removed-set errors match Linux behavior.
  • Concurrent access avoids races, lost wake-ups, use-after-free, and resource leaks.
  • Existing DragonOS CI tests pass.

Testing

  • Added 43 System V semaphore dunitests.
  • QEMU guest test: 43/43 passed.
  • Format, Clippy, multi-architecture builds, Dunitest, and Integration Test CI passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 8, 2026
Comment thread kernel/src/ipc/syscall/sys_semop.rs
@github-actions github-actions Bot added the test Unitest/User space test label Aug 19, 2026
@mistcoversmyeyes
mistcoversmyeyes marked this pull request as ready for review August 19, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request test Unitest/User space test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ipc): Implement System V semaphore syscalls on x86_64

2 participants