Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • O OSKernel2026-StellaOS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • StellaOS
  • OSKernel2026-StellaOS
  • Merge requests
  • !13

feat(fs): support O_CLOEXEC, fd table limit, and fix pipe2/dup3/dup

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged StellaOS requested to merge feature/fs_syscall into main May 28, 2026
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 11
  • O_CLOEXEC (close-on-exec):

    • Add FdEntry wrapper around Arc with per-fd cloexec field, keeping FD_CLOEXEC independent from the shared open file description
    • FdTable::close_on_exec() closes all cloexec-marked fds during exec()
    • sys_openat/sys_pipe2: parse O_CLOEXEC from user flags, set on new fd; strip O_CLOEXEC before passing to VfsFile.flags
    • sys_dup3: set/clear cloexec based on flags argument
    • sys_dup: always clear cloexec on new fd (POSIX)
  • O_NONBLOCK for pipe2:

    • make_pipe() now accepts OpenFlags, passes O_NONBLOCK to VfsFile via new_dev_with_flags(); read end uses O_RDONLY, write end O_WRONLY
    • Existing WouldBlock -> EAGAIN logic in sys_read/sys_write applies
  • FdTable limit (RLIMIT_NOFILE):

    • Add limit field (default 256), try_alloc_fd/try_insert return Option
    • All syscall-layer callers return EMFILE when fd table exhausted
    • sys_dup3 checks newfd < limit, returns EBADF on violation
    • Manual Default impl ensures limit is set correctly
  • Rename SysErrNo -> SyscallErrNo for clarity

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feature/fs_syscall