Skip to content

Add symlinkat, renameatx_np, and unlinkat system call wrappers to the _NIOFileSystem module#3524

Open
stepan-ulyanin wants to merge 4 commits intoapple:mainfrom
stepan-ulyanin:backport-copy-to-niofilesystem
Open

Add symlinkat, renameatx_np, and unlinkat system call wrappers to the _NIOFileSystem module#3524
stepan-ulyanin wants to merge 4 commits intoapple:mainfrom
stepan-ulyanin:backport-copy-to-niofilesystem

Conversation

@stepan-ulyanin
Copy link
Contributor

@stepan-ulyanin stepan-ulyanin commented Feb 26, 2026

Ports the added system calls from NIOFS (from #3505) to _NIOFileSystem:

Adds three new system call wrappers for the symlinkat, renameatx_np, and unlinkat system calls.

Motivation:

_NIOFileSystem module is around for backward compatibility - hence, we are porting the new feature to it.

Modifications:

Exactly same as in #3505 but applied to the _NIOFileSystem:

Related to #3403 and #3470. This PR adds syscall wrappers needed to atomically overwrite existing files or symlinks at the destination during copy operations. On Linux, atomic overwrites require a "copy to temp file, then rename" strategy. We use the *at family of syscalls (which operate relative to directory file descriptors) to avoid TOCTOU race conditions.

@stepan-ulyanin stepan-ulyanin marked this pull request as ready for review February 26, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant