nix-rust / nix

Rust friendly bindings to *nix APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linkat doesn't support AT_EMPTY_PATH, making it incompatible with O_TMPFILE

vlovich opened this issue · comments

If you want to linkat a file created with O_TMPFILE and without O_EXCL, then you need to pass an empty path for oldpath, the O_TMPFILE fd, and AT_EMPTY_PATH. However, the linkat flags are an enum and don't support AT_EMPTY_PATH to be provided.

The alternate workaround is to blindly assume that the proc filesystem is mounted (& mounted at /proc) & construct a path to the O_TMPFILE fd with follow symlinks set to true.

However, the linkat flags are an enum and don't support AT_EMPTY_PATH to be provided.

Try bumping your Nix dependency to 0.28.0, you can specify AT_EMPTY_PATH now

https://docs.rs/nix/latest/nix/unistd/fn.linkat.html

Close this issue but feel free to reopen it if you think it is still not resolved