Re: [PATCH] prctl.2: Fix typo

Stefan Puiu
2023-10-31T14:32:14Z

Hi Alex and Bruno,

On Tue, Oct 31, 2023 at 4:06 PM Alejandro Colomar <alx@kernel.org> wrote:
>
> Hi Bruno,
>
> On Sun, Oct 29, 2023 at 09:51:55PM +0100, Bruno Haible wrote:
> > The synopsis of the prctl.2 page has:
> >
> > int prctl(int option, ...
> >
> > This makes no sense, because
> > - the first argument is not optional; it is mandatory.
> > - the title of the page is "operations on a process or thread".
> >
> > It is thus clear that the first argument indicates the operation to perform.
> >
> > Find attached the correction.
>
> Agree. I've seen there are other similarly incorrect uses of the word
> "option" where "operation" should have been used in the same page (but
> there are some that are correctly used). Would you mind checking the
> entire page for those other replacements?

Hmm, 'option' is not the same as 'optional'. I guess the first
parameter can be seen as an 'option' passed to prctl() along with some
other parameters, right?

Also, there are multiple occurrences of 'option' in the page (e.g.
'This option is mainly intended...'), so only changing the argument
name would introduce an inconsistency in the page. The argument is
also called '__option' in glibc headers on my system (in
/usr/include/x86_64-linux-gnu/sys/prctl.h):

/* Control process execution. */
#ifndef __USE_TIME_BITS64
extern int prctl (int __option, ...) __THROW;
#else
# ifdef __REDIRECT
extern int __REDIRECT_NTH (prctl, (int __option, ...), __prctl_time64);

So, I would say I'm not sure this improves things.

Just my 2 cents,
Stefan.