On 10/31/25 09:14, Pavel Cahyna wrote:
To me it also seems it would make more sense to have just something like this instead of the complete openat2
Yes, for GNU Tar the FreeBSD API is better. I don't know why the Linux kernel went a different way.
wouldn't it be enough for tar to use openat2 (or open_beneath or whatever wrapper) and fstat / fchmod / mkdirat on the fd returned
No, because you can't use openat to make directories, etc. It's good only for opening existing files, for creating regular files and (perhaps; I haven't checked) for statting them.
