All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org,
	libc-alpha@sourceware.org
Subject: Re: [PATCH v5 11/35] clone.2: Use syscall(SYS_...); for system calls without a wrapper
Date: Mon, 5 Apr 2021 13:31:25 +0200	[thread overview]
Message-ID: <ea89a939-06fe-6995-a06c-5cea74d6af9d@gmail.com> (raw)
In-Reply-To: <20210404115847.78166-12-alx.manpages@gmail.com>

Hi Alex,

On 4/4/21 1:58 PM, Alejandro Colomar wrote:
> The CLONE_* constants seem to be available from either
> <linux/sched.h> or <sched.h>, and since clone3() already
> includes <linux/sched.h> for 'struct clone_args', <sched.h>
> is not really needed, AFAICS; however, to avoid confussion,
> I also included <sched.h> for clone3() for consistency:

I think that's a good decision.

> clone() is getting CLONE_* from <sched.h>, and it would confuse
> the reader if clone3() got the same CLONE_* constants from a
> different header.

Agreed.

Patch applied.

Thanks,

Michael


> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/clone.2 | 17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/man2/clone.2 b/man2/clone.2
> index fa7d1103e..f455c97d8 100644
> --- a/man2/clone.2
> +++ b/man2/clone.2
> @@ -56,13 +56,13 @@ clone, __clone2, clone3 \- create a child process
>  .PP
>  /* For the prototype of the raw clone() system call, see NOTES */
>  .PP
> -.BI "long clone3(struct clone_args *" cl_args ", size_t " size );
> -.fi
> +.BR "#include <linux/sched.h>" "    /* Definition of " "struct clone_args" " */"
> +.BR "#include <sched.h>" "          /* Definition of " CLONE_* " constants */"
> +.BR "#include <sys/syscall.h>" "    /* Definition of " SYS_* " constants */"
> +.B #include <unistd.h>
>  .PP
> -.IR Note :
> -There is no glibc wrapper for
> -.BR clone3 ();
> -see NOTES.
> +.BI "long syscall(SYS_clone3, struct clone_args *" cl_args ", size_t " size );
> +.fi
>  .SH DESCRIPTION
>  These system calls
>  create a new ("child") process, in a manner similar to
> @@ -1541,11 +1541,6 @@ One use of these systems calls
>  is to implement threads: multiple flows of control in a program that
>  run concurrently in a shared address space.
>  .PP
> -Glibc does not provide a wrapper for
> -.BR clone3 ();
> -call it using
> -.BR syscall (2).
> -.PP
>  Note that the glibc
>  .BR clone ()
>  wrapper function makes some changes
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

  reply	other threads:[~2021-04-05 11:31 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-03 19:39 [PATCH v4 00/35] SYNOPSIS: Use syscall(SYS_...); and fix '#include's Alejandro Colomar
2021-04-03 19:39 ` [PATCH v4 01/35] system_data_types.7: Add 'struct sockaddr' Alejandro Colomar
2021-04-03 19:39 ` [PATCH v4 02/35] sockaddr.3: New link to system_data_types(7) Alejandro Colomar
2021-04-03 19:39 ` [PATCH v4 03/35] system_data_types.7: Add 'socklen_t' Alejandro Colomar
2021-04-03 19:39 ` [PATCH v4 04/35] socklen_t.3: New link to system_data_types(7) Alejandro Colomar
2021-04-03 19:39 ` [PATCH v4 05/35] access.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:39 ` [PATCH v4 06/35] add_key.2: Remove unused include Alejandro Colomar
2021-04-03 19:39 ` [PATCH v4 07/35] alloc_hugepages.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 08/35] arch_prctl.2: " Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 09/35] arch_prctl.2: SYNOPSIS: Remove unused includes Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 10/35] capget.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 11/35] clone.2: " Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 12/35] delete_module.2: Add missing include Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 13/35] dup.2: SYNOPSIS: Use consistent comments through pages Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 14/35] execveat.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 15/35] exit_group.2: Use 'noreturn' in prototypes Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 16/35] exit_group.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 17/35] fanotify_init.2: Add comment: why more than one include is needed Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 18/35] fcntl.2: Remove unused include Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 19/35] futex.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 20/35] futimesat.2: ffix Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 21/35] getdents.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 22/35] getpriority.2: Remove unused include Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 23/35] getrlimit.2, getrusage.2: " Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 24/35] getunwind.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 25/35] get_robust_list.2: " Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 26/35] delete_module.2: " Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 27/35] init_module.2: " Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 28/35] io_cancel.2: " Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 29/35] ioctl_fat.2: Make clear why is each header exactly needed Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 30/35] ioctl_fat.2: ffix Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 31/35] ioctl_ficlonerange.2: Make clear why is each header exactly needed Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 32/35] ioctl_fideduperange.2: Make clear why exactly is each header needed Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 33/35] ioctl_fslabel.2: ffix Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 34/35] ioctl_fslabel.2: Make clear why exactly is each header needed Alejandro Colomar
2021-04-03 19:40 ` [PATCH v4 35/35] ioctl_getfsmap.2: " Alejandro Colomar
2021-04-04 11:58 ` [PATCH v5 00/35] SYNOPSIS: Use syscall(SYS_...); and fix '#include's Alejandro Colomar
2021-04-05 11:49   ` Michael Kerrisk (man-pages)
2021-04-11 19:23     ` Alejandro Colomar (man-pages)
2021-04-11 19:30       ` Alejandro Colomar (man-pages)
2021-04-12  6:17     ` Florian Weimer
2021-04-12  6:39       ` Jakub Wilk
2021-04-12  9:09       ` Alejandro Colomar (man-pages)
2021-04-21  5:41         ` Florian Weimer
2021-04-24 15:46           ` Alejandro Colomar (man-pages)
2021-04-04 11:58 ` [PATCH v5 01/35] system_data_types.7: Add 'struct sockaddr' Alejandro Colomar
2021-04-05 10:40   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 02/35] sockaddr.3: New link to system_data_types(7) Alejandro Colomar
2021-04-04 11:58 ` [PATCH v5 03/35] system_data_types.7: Add 'socklen_t' Alejandro Colomar
2021-04-05 10:40   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 04/35] socklen_t.3: New link to system_data_types(7) Alejandro Colomar
2021-04-05 10:41   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 05/35] access.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-05 11:17   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 06/35] add_key.2: Remove unused include Alejandro Colomar
2021-04-05 10:51   ` Michael Kerrisk (man-pages)
2021-04-05 10:55   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 07/35] alloc_hugepages.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-05 11:22   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 08/35] arch_prctl.2: " Alejandro Colomar
2021-04-05 11:25   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 09/35] arch_prctl.2: SYNOPSIS: Remove unused includes Alejandro Colomar
2021-04-05 11:26   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 10/35] capget.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-05 11:29   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 11/35] clone.2: " Alejandro Colomar
2021-04-05 11:31   ` Michael Kerrisk (man-pages) [this message]
2021-04-04 11:58 ` [PATCH v5 12/35] delete_module.2: Add missing include Alejandro Colomar
2021-04-05 10:48   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 13/35] dup.2: SYNOPSIS: Use consistent comments through pages Alejandro Colomar
2021-04-05 11:32   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 14/35] execveat.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-05 11:33   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 15/35] exit_group.2: Use 'noreturn' in prototypes Alejandro Colomar
2021-04-05 10:43   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 16/35] exit_group.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-05 11:36   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 17/35] fanotify_init.2: Add comment: why more than one include is needed Alejandro Colomar
2021-04-05 10:50   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 18/35] fcntl.2: Remove unused include Alejandro Colomar
2021-04-05 10:44   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 19/35] futex.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-04 11:58 ` [PATCH v5 20/35] futimesat.2: ffix Alejandro Colomar
2021-04-05 10:42   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 21/35] getdents.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-05 11:37   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 22/35] getpriority.2: Remove unused include Alejandro Colomar
2021-04-05 10:49   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 23/35] getrlimit.2, getrusage.2: " Alejandro Colomar
2021-04-05 10:48   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 24/35] getunwind.2: Use syscall(SYS_...); for system calls without a wrapper Alejandro Colomar
2021-04-05 11:37   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 25/35] get_robust_list.2: " Alejandro Colomar
2021-04-05 11:39   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 26/35] delete_module.2: " Alejandro Colomar
2021-04-05 11:41   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 27/35] init_module.2: " Alejandro Colomar
2021-04-05 11:41   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 28/35] io_cancel.2: " Alejandro Colomar
2021-04-05 11:43   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 29/35] ioctl_fat.2: Make clear why is each header exactly needed Alejandro Colomar
2021-04-05 11:02   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 30/35] ioctl_fat.2: ffix Alejandro Colomar
2021-04-05 11:03   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 31/35] ioctl_ficlonerange.2: Make clear why is each header exactly needed Alejandro Colomar
2021-04-05 11:13   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 32/35] ioctl_fideduperange.2: Make clear why exactly is each header needed Alejandro Colomar
2021-04-05 11:16   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 33/35] ioctl_fslabel.2: ffix Alejandro Colomar
2021-04-05 11:10   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 34/35] ioctl_fslabel.2: Make clear why exactly is each header needed Alejandro Colomar
2021-04-05 11:04   ` Michael Kerrisk (man-pages)
2021-04-04 11:58 ` [PATCH v5 35/35] ioctl_getfsmap.2: " Alejandro Colomar
2021-04-05 11:10   ` Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea89a939-06fe-6995-a06c-5cea74d6af9d@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=alx.manpages@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.