PDA

View Full Version : process programming...



kimes
June 22nd, 2005, 06:31 PM
I've just learned about fork ...
Is there any simple project that I can make unlike meaningless 'hello world' printing..?
Thanks in advance

uidzer0org
June 23rd, 2005, 01:55 AM
int main()
{
int return_value;

printf(``Forking process$\backslash$n'');
fork();
printf(``The process id is %d
and return value is %d$\backslash$n",
getpid(), return_value);
execl(``/bin/ls/'',``ls'',``-l'',0);
printf(``This line is not printed$\backslash$n'');
}

modify this for your enjoyment

buffbikedude
June 26th, 2005, 10:57 PM
How about an HTTP server that accepts multiple connections? If the file asked for is executable, you could run the executable as a separate process using CGI.

jerome bettis
June 27th, 2005, 04:20 AM
you could write a simple unix shell like i did here: http://www.ubuntuforums.org/showthread.php?t=43562