LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-13-2016, 11:11 PM   #1
Sibasish
LQ Newbie
 
Registered: Feb 2016
Posts: 1

Rep: Reputation: Disabled
Unhappy fork(fork()) is it possible...!!!


if it is possible how it works..???
 
Old 02-14-2016, 02:29 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 11,353

Rep: Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418Reputation: 3418
I do not really understand what do you want to achieve. It is possible in general.

Last edited by pan64; 02-14-2016 at 12:15 PM.
 
Old 02-14-2016, 10:21 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 9,704
Blog Entries: 7

Rep: Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399Reputation: 2399
have you tried it?
why shouldn't it work.
Code:
#!/bin/bash

function fork {
	 fork 
}

fork
 
Old 02-14-2016, 11:09 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,021

Rep: Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776Reputation: 1776
It is posssible, albeit with some complaints from the C compiler since fork() does not take an argument, but what are you trying to accomplish? The process tree you would end up with after fork(fork()) is
Code:
                parent
                  /\
                 /  \
                /    \
             child1 child2
                       \
                        \
                      child3

Last edited by rknichols; 02-14-2016 at 11:10 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: HTML5: To Fork or Not to Fork LXer Syndicated Linux News 1 07-25-2012 07:58 PM
FORK vishnu anand Linux - Newbie 1 01-05-2012 03:16 PM
Regarding Fork() sankumar Programming 2 12-19-2008 08:02 AM
using fork() culin Programming 12 01-17-2007 10:59 PM
more on fork() feetyouwell Programming 6 09-17-2004 11:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration