On Tue, 06 Sep 2005 17:15:51 +0800, "Sat." said: Not a kernel problem, please consult an intro-to-C list next time.... > if(!(pid=fork())){ > ...... > printk("in child process"); > ...... > }else{ > ..... > printk("in father process"); > ..... > } > > values., and do nothing . so the bridge between the new process and > its following code, printk("in child process"), seems disappear I'm assuming you actually meant printf() (which is the userspace stdio call) rather than printk() (which is the inside-the-kernel variant). 'man setbuf' - most likely the output of the child process is buffered and never actually output before it exits. You want to set stdout to be line-buffered or unbuffered, or write to stderr (unbuffered by default) rather than stdout.
Attachment:
pgp4sZmWBMebn.pgp
Description: PGP signature
- Follow-Ups:
- Re: what will connect the fork() with its following code ? a simple example below:
- From: Bernd Petrovitsch <[email protected]>
- Re: what will connect the fork() with its following code ? a simple example below:
- References:
- Prev by Date: [PATCH] ppc32: Fix Kconfig mismerge
- Next by Date: Re: RFC: i386: kill !4KSTACKS
- Previous by thread: Re: what will connect the fork() with its following code ? a simple example below:
- Next by thread: Re: what will connect the fork() with its following code ? a simple example below:
- Index(es):