Download raw body.
openat(2) is mostly useless, sadly
> From: "Theo de Raadt" <deraadt@openbsd.org>
> Date: Fri, 30 May 2025 19:17:46 -0600
>
> Steffen Nurpmeso <steffen@sdaoden.eu> wrote:
>
> > I would not use ENOTTY for F_BELOW on !DIR, maybe ENOTDIR is
> > better.
>
> >From errno(2) manpage:
>
> 20 ENOTDIR Not a directory. A component of the specified pathname
> existed, but it was not a directory, when a directory was
> expected.
>
> F_BELOW is fcntl(2).
>
> int
> fcntl(int fd, int cmd, ...);
>
> But there is no pathname. Yes it is partly vague, but then grep the whole
> tree for ENOTDIR and always anticipates a pathname at a higher level.
Note that openat(2) says:
[ENOTDIR] The path argument specifies a relative path and the fd
argument is a valid file descriptor but it does not
reference a directory.
So here ENOTDIR does apply to a file descriptor.
openat(2) is mostly useless, sadly