For my OS lab we have linux at college and the question is to find the factors of a number and pass it use pipe function from child to main process. I googled up the syntax of pipe and I find it difficult to understand the idea. You need a file pointer and all to pass an array back using pipe? Isn't the mechanism as simple as passing arguments to functions or returning values from a function? Please help
jeevsmyd
-2
Junior Poster
Recommended Answers
Jump to Postwell by fork() you'll create a child process.
the pipe works like this: on one end you write something and on the other end you read.
the pipe is done like this, I'll write it in pseudocode:int a2b pipe(a2b) if fork()==0 then write(a2b[1], information, size) …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.