Re: [PATCH v5 2/3] man/man2/prctl.2, PR_FUTEX_HASH_SET_SLOTS.2const: Document PR_FUTEX_HASH_SET_SLOTS

From: Alejandro Colomar
Date: Tue Aug 19 2025 - 07:21:06 EST


Hi Sebastian,

On Tue, Aug 19, 2025 at 01:02:42PM +0200, Alejandro Colomar wrote:
> On Tue, Aug 19, 2025 at 09:17:27AM +0200, Sebastian Andrzej Siewior wrote:
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> > ---
> > man/man2const/PR_FUTEX_HASH_SET_SLOTS.2const | 67 ++++++++++++++++++++
> > 1 file changed, 67 insertions(+)
> > create mode 100644 man/man2const/PR_FUTEX_HASH_SET_SLOTS.2const
> >
> > diff --git a/man/man2const/PR_FUTEX_HASH_SET_SLOTS.2const b/man/man2const/PR_FUTEX_HASH_SET_SLOTS.2const
> > new file mode 100644
> > index 0000000000000..93af27cbd5e5e
> > --- /dev/null
> > +++ b/man/man2const/PR_FUTEX_HASH_SET_SLOTS.2const
> > @@ -0,0 +1,67 @@
> > +.\" Copyright, the authors of the Linux man-pages project
> > +.\"
> > +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
> > +.\"
> > +.TH PR_FUTEX_HASH_SET_SLOTS 2const (date) "Linux man-pages (unreleased)"
> > +.SH NAME
> > +PR_FUTEX_HASH_SET_SLOTS
> > +\-
> > +set the size of the private hash
> > +.SH LIBRARY
> > +Standard C library
> > +.RI ( libc ,\~ \-lc )
> > +.SH SYNOPSIS
> > +.nf
> > +.BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */"
> > +.B #include <sys/prctl.h>
> > +.P
> > +.B int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS,
> > +.BI " unsigned long " hash_size ", unsigned long " hash_flags ");

I see that it is implemented in the kernel as

static int
futex_hash_allocate(unsigned int hash_slots, unsigned int flags)
{
...
}

But PR_FUTEX_HASH is implemented as

int
futex_hash_prctl(unsigned long arg2, unsigned long arg3,
unsigned long arg4)
{
...
}

Should we document is as a u_int, or a u_long? Is that mismatch a bug,
or is it on purpose?


Cheers,
Alex

--
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature