linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: Peter Schiffer <pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: clone(2) should be clone(3)
Date: Sun, 7 Apr 2013 15:03:06 -0400	[thread overview]
Message-ID: <201304071503.07751.vapier@gentoo.org> (raw)
In-Reply-To: <CAKgNAkiRHNZsnWj0J3hizbMRtnq6yAbJpFSr0x_-77bu_9eFXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: Text/Plain, Size: 2418 bytes --]

On Sunday 07 April 2013 06:15:18 Michael Kerrisk (man-pages) wrote:
> On Fri, Apr 5, 2013 at 6:01 PM, Peter Schiffer wrote:
> > it looks like the clone(2) man page is describing glibc implementation
> > and not the system call. So I guess it should be moved to the section 3
> > and a new man page for clone(2) syscall should be created in section 2.
> > 
> > The clone(2) syscall is defined like this:
> > 
> > SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
> >                  int __user *, parent_tidptr,
> >                  int __user *, child_tidptr,
> >                  int, tls_val)
> > 
> > (I'm sorry, but I don't have a patch this time.)
> 
> The general tendency is to document all system calls in section 2, and
> if there are some differences caused by wrapper functions, then they
> are noted on the page.
> 
> I admint that clone(2) is an unusual case. The signature given at the
> top of the page is for the wrapper (and later the difference to the
> syscall raw interface are described). However, the details are
> primarily about the underlying kernel interface, so I'm inclined to
> leave the page where it is.

i think his point is that the syscall doesn't take a func pointer.  it is 
userspace (the C lib) that takes care of making the clone syscall and then 
calling the function.  the man page doesn't mention this anywhere that i see.

the notes section does refer to this as being a "system call" instead of a 
"system call wrapper" when discussing ia64.

also, the quoted syscall signature isn't the whole story.  there's actually 
more variants:
#ifdef __ARCH_WANT_SYS_CLONE
#ifdef CONFIG_CLONE_BACKWARDS
SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
         int __user *, parent_tidptr,
         int, tls_val,
         int __user *, child_tidptr)
#elif defined(CONFIG_CLONE_BACKWARDS2)
SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
         int __user *, parent_tidptr,
         int __user *, child_tidptr,
         int, tls_val)
#else
SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
         int __user *, parent_tidptr,
         int __user *, child_tidptr,
         int, tls_val)
...

these arches don't define __ARCH_WANT_SYS_CLONE:
	blackfin ia64 m68k sparc

and i gave up enumerating all the other edge cases :)
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-04-07 19:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 16:01 clone(2) should be clone(3) Peter Schiffer
     [not found] ` <515EF542.8090200-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-07 10:15   ` Michael Kerrisk (man-pages)
     [not found]     ` <CAKgNAkiRHNZsnWj0J3hizbMRtnq6yAbJpFSr0x_-77bu_9eFXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-07 19:03       ` Mike Frysinger [this message]
     [not found]         ` <201304071503.07751.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-16  5:42           ` Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkjQ1PfvrVgJ_UXUerG9MzLAoUt9ixgS07L9LAroCW7_Jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-16 15:37               ` Mike Frysinger
     [not found]                 ` <201304161137.49482.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-17  6:45                   ` Michael Kerrisk (man-pages)
2013-04-09 18:08       ` Peter Schiffer
     [not found]         ` <51645912.5080602-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-09 18:11           ` Mike Frysinger
     [not found]             ` <201304091411.12265.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-09 18:57               ` Peter Schiffer
2013-04-16  5:27           ` Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkha5NvRZzDBQAbFMVD+yoBVYVaUb3LVwm84STUnLByiKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-17 15:12               ` Peter Schiffer

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=201304071503.07751.vapier@gentoo.org \
    --to=vapier-abrp7r+bbdudnm+yrofe0a@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pschiffe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).