cap_primitives/rustix/fs/
symlink_unchecked.rs

1use rustix::fs::symlinkat;
2use std::path::Path;
3use std::{fs, io};
4
5/// *Unsandboxed* function similar to `symlink`, but which does not perform
6/// sandboxing.
7pub(crate) fn symlink_unchecked(
8    old_path: &Path,
9    new_start: &fs::File,
10    new_path: &Path,
11) -> io::Result<()> {
12    Ok(symlinkat(old_path, new_start, new_path)?)
13}