Re: Linux process...

Glynn Clements <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
beginner_h4x3r wrote:

> Okay, so the child process was not actually access it's parent
> variable, the child given a copy (i have learned about Copy On Write
> mechanism too).  But it is like a C language issue: we can access any
> variable which declared in that function in this case main() function.
> So in my code, when i try to access stack_int variable in child
> process, it's not wrong, compiler even recognize this as 'valid'
> approach... How about my conclusion?

What about it? If you compile with warnings enabled, gcc will tell you
that the first printf() is using the value of an uninitialised
variable.

-- 
Glynn Clements <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.