Ritesh wrote:

>Hello gurus, 
>
>i just wanted to understand popen() functionality in detail. 
>per my understanding, this is similar to fork and when called from inside the 
>program (lets say parent), it opens a file descriptor (pipe) and executes the 
>passed argumnet in a forked (child) process. 
>
>  
>
That's about it, see

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libbc/libc/gen/common/popen.c

>however, i have following doubts.
>  
>
Questions?

>1. the parent process which calls this, is it blocked until the popen(cmd) 
>(lets say its invoking 'cmd' shell script) is completed? 
>  
>
No, otherwise it wouldn't be able to read output form the child.

>2. is there any timer associated with this call? i mean lets say i am 
>executing a script through popen and that script goes in a loop, what happens 
>to the parent process? 
>
>  
>
Nothing, there isn't a timer.

Ian
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to