Skip to content

feat(fcntl): implement F_SETSIG/F_GETSIG#1880

Open
jiuyue486 wants to merge 2 commits intoDragonOS-Community:masterfrom
jiuyue486:claude/fix-pr-issues-eSVIq
Open

feat(fcntl): implement F_SETSIG/F_GETSIG#1880
jiuyue486 wants to merge 2 commits intoDragonOS-Community:masterfrom
jiuyue486:claude/fix-pr-issues-eSVIq

Conversation

@jiuyue486
Copy link
Copy Markdown

Implement the F_SETSIG/F_GETSIG fcntl commands so userspace can pick
the signal delivered for asynchronous I/O notifications. arg == 0
keeps the SIGIO default; values in (0, SIGRTMAX] override it.

  • Add a per-File fasync_signum (AtomicI32), preserved across
    try_clone.
  • Validate the raw usize arg against SIGRTMAX to avoid 64-bit
    values whose low 32 bits accidentally fall in [0, SIGRTMAX] from
    being silently accepted. Look up the fd first so EBADF wins over
    EINVAL, matching Linux fs/fcntl.c.
  • Cover defaults, set/get round-trip, the SIGRTMAX boundary, invalid
    values, and invalid fd in a new fcntl_signal dunitest.

flynojy and others added 2 commits April 26, 2026 07:49
Implement the F_SETSIG/F_GETSIG fcntl commands so userspace can pick
the signal delivered for asynchronous I/O notifications. arg == 0
keeps the SIGIO default; values in (0, SIGRTMAX] override it.

- Add a per-File `fasync_signum` (AtomicI32), preserved across
  `try_clone`.
- Validate the raw `usize` arg against `SIGRTMAX` to avoid 64-bit
  values whose low 32 bits accidentally fall in [0, SIGRTMAX] from
  being silently accepted. Look up the fd first so EBADF wins over
  EINVAL, matching Linux `fs/fcntl.c`.
- Cover defaults, set/get round-trip, the SIGRTMAX boundary, invalid
  values, and invalid fd in a new `fcntl_signal` dunitest.
@github-actions github-actions Bot added enhancement New feature or request test Unitest/User space test labels Apr 26, 2026
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.

2 participants