kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: cakturk@gmail.com (Cihangir Akturk)
To: kernelnewbies@lists.kernelnewbies.org
Subject: fork
Date: Mon, 18 Apr 2016 11:18:50 +0300	[thread overview]
Message-ID: <20160418081850.GA12586@portege.ulakbim.gov.tr> (raw)
In-Reply-To: <CAKfJ7K+ZFvYdFRefFn3=orALwOAmT2H6N6jdOf_z4E_+YVPSeQ@mail.gmail.com>

On Mon, Apr 18, 2016 at 12:18:00PM +0530, Nitin Varyani wrote:
> Linux kernel development by Robert Love describes the fork process as
> 
> fork() -> clone() -> do_fork() -> copy_process()
> 
> I am unable to find the clone() system call in linux 3.13.
> Can someone explain the proper flow of fork() system call initiated by the
> user?
> 
> Where can I find the libc implementation for fork()? I want the code of all
> the functions involved in fork.

There are a couple of libc implemetations out there, say musl,
dietlibc, uClibc and so on. But If you mean GNU libc aka. glibc
then this is what you are looking for:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/nptl/fork.c;h=1a68cbd6476b3268b5b7ac09ae60c35ce7069219;hb=HEAD#l47

__libc_fork() calls clone() syscall internally using a bit of
assembler magic.

  parent reply	other threads:[~2016-04-18  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  6:48 fork Nitin Varyani
2016-04-18  7:12 ` fork Alex Wilson
2016-04-18  8:18 ` Cihangir Akturk [this message]
2020-01-09 10:35 Fork Christophe DUMONT
2020-01-09 10:47 ` Fork Valentin Vidić

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=20160418081850.GA12586@portege.ulakbim.gov.tr \
    --to=cakturk@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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).