Page 1 of 1

shells forking?

Posted: Fri Apr 11, 2008 4:09 pm
by naminator
Hi,

I am reading Tanenbaum's book at the moment on modern operating systems. He is taliking about system calls and he implies that when a command is entered into a shell on a POSIX system, the shell forks a new process. Is this true and if so why?

Thanks

Posted: Fri Apr 11, 2008 4:53 pm
by iammisc
when you enter into a command in a UNIX shell the shell forks itself and then exec()'s the new program. IIRC this is the only way to start a brand new process on a POSIX system.

Posted: Fri Apr 11, 2008 5:05 pm
by naminator
Oh, I see, I didn't think about not being able to create a process any other way, Thanks for your help.