Re: [PATCH v2] rust: alloc: satisfy `aligned_alloc` requirements

Danilo Krummrich
2025-02-06T18:58:02Z

On Thu, Feb 06, 2025 at 07:20:20PM +0100, Miguel Ojeda wrote:
> On Thu, Feb 6, 2025 at 7:04 PM Danilo Krummrich <dakr@kernel.org> wrote:
> >
> > I previously checked man posix_memalign(3) and it says:
> >
> > ERRORS
> > EINVAL The alignment argument was not a power of two, or was not a
> > multiple of sizeof(void *).
>
> Yeah, but that may not apply to `alligned_alloc` as far as I can see.

What makes you think so?

AFAICS, the man page applies for posix_memalign, aligned_alloc, memalign,
valloc and pvalloc.

In case behavior differs between the functions, this is stated explicitly, e.g.
in the "RETURN VALUE" section.

The "ERRORS" setion does not differentiate, hence it should apply to all the
functions above, including aligned_alloc.

Do I miss anything?