Using the Clone() System Call
Joey Bernard is a self-described uber-geek. He has one degree in physics and is working on a second degree in computer science. He hopes to become a fully ordained priest of the Church of Tux. All donations will be accepted.
email: ljeditors@ssc.com
Joey Bernard has a background in both physics and computer science. This serves him well in his day job as a computational research consultant at the University of New Brunswick. He also teaches computational physics and parallel programming.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- New Products
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- Validate an E-Mail Address with PHP, the Right Way
- New Products
- Trying to Tame the Tablet
- Tech Tip: Really Simple HTTP Server with Python
- git-annex assistant
3 hours 3 min ago - direct cable connection
3 hours 25 min ago - Agreed on AirDroid. With my
3 hours 36 min ago - I just learned this
3 hours 40 min ago - enterprise
4 hours 10 min ago - not living upto the mobile revolution
7 hours 1 min ago - Deceptive Advertising and
7 hours 37 min ago - Let\'s declare that you have
7 hours 38 min ago - Alterations in Contest Due
7 hours 39 min ago - At a numbers mindset, your
7 hours 40 min ago



Comments
nice article
Good read .
I think when we use clone()
I think when we use clone() , it is a wrapper in C-library. Then after calling this wrapper , it in turn calls the actual clone(2) system call. If this is true then you have to mention it properly.
Looking for ur future & early updations, I remain.
Jayashree K J.
Bangalore ( NTPL ).
31st May, 2006.
How can Joey Bernard will be
How can Joey Bernard will be able to become a fully ordained priest of the Church of Tux, because his current profession is as a computer scientist ???????
How can Joey Bernard will be
How can Joey Bernard will be able to become a fully ordained priest of the Church of Tux, because his current profession is as a computer scientist ???????
Re: Using the Clone() System Call
WOW! i have been looking for manual for clone for weeeks!!! its been driving me up the wall!!!!!!!!!!!!!!!!!!! thankyou so much!!!
Leon
great article.
truely a good article.
Herr Fähnders, hier ist doch
Herr Fähnders, hier ist doch alles auf Englisch! :(((((
Hier ist die Uebersetzung:
Hier ist die Uebersetzung:
http://babelfish.altavista.com/babelfish/trurl_pagecontent?url=http%3A%2...
Viel Spass beim Lesen
Re: Using the Clone() System Call
I've come back from the proverbial grave. While googling myself, I came across this verrry old article I had written. With more experience under my belt, I realize I was very stupid in parts of this article. I will be posting a link to an updated version here in the next few weeks if anyone who finds this article wants a corrected version.
Re: Using the Clone() System Call
Please do post an updated version. I found this article very helpful.
Re: Using the Clone() System Call
Hi
Kindly send me updated link
Please do the necessary changes u r mentioning
also can u mention some link i could use for clone()
I am a university student
Thanks
Vipul
u03138@cs.unipune.ernet.in
Re: Using the Clone() System Call
I was wondering why in the source code (listing 2) do you use a void **, when void * could very well be used for the child stack pointer
Rohit
Hey, the stack grows downwards!
Hi,
I'm Pablo, a humble reader from Argentina.
I found your article very interesting, however I couldn't run the code from figure 2. I did compiled it, but the execution of the clone call, lead to a segmentation fault.
I took a look at the clone's man page and it said that the you should pass a pointer to the stack pointer of the task, not the beginning of the stack.
So, as the stack decreases, and it's empty when the thread begins, the right address would not be child_stack, but child_stack + 65383.
Only that way the code runs fine.
Hope it helps.
Regarding child_stack of clone
How you are calculating as 65383.
How much should we need to allocate for malloc.
how to calculate malloc size.
Re: Hey, the stack grows downwards!
Well, it worked for me. I overlooked the -static option to cc the first time and got a segmentation fault.
Re: Hey, the stack grows downwards!
Using:
child_stack + 65383
still segments for me. Where does 65383
come in? 4 * 16384 -> 65536 anyhow!
child_stack + 4000
works for me i.e. address is a definitely safe
one to use.
David (djjohn@essex.ac.uk)
Re: Hey, the stack grows downwards!
You should write instead:
#define CHILD_STACK_SIZE 16384
clone( child_process, child_stack + CHILD_STACK_SIZE / sizeof( void ** ), CLONE_VM | CLONE_FILES, NULL );
Which is equivalent to CHILD_STACK_SIZE / 4 on most systems.
Re: Hey, the stack grows downwards!
Hi I am manjeet,
even I faced the same problem (of segmentation fault) but
couldnt get out of it even after changing the child_stack pointer ...
Re: Using the Clone() System Call
I am Chupacabra! Fear my use of the Clone() System Call!
CNN.com