Re: Trouble with pipe function

From: Alwyn (dt015a1979_at_mac.com.invalid)
Date: 11/01/04


Date: Mon, 01 Nov 2004 11:29:51 +0000

In article <Xns959425D612A3Bkensuhotmailcom@207.115.63.158>, Chris
Schumacher <kensu__@hotmail.com> wrote:
>
> That brings about an interesting question, though...
> Is it possible to create pipes using C/C++? Or do you need something more
> low-level to do that? (what I'm asking is if, without using any
> implementation specific code or system calls, can you write a program that
> can pipe in or pipe out information?)

Inter-process communication is a kernel function. In other words, there
is no way one process can communicate with another without the help of
the kernel, which manages them all.

The best you can do in plain standard C or C++ is to write a file,
which can then be read by another process.

> Unix was written in C, but were the pipes part fo the code that had to be
> rewritten in assembler every time the system was ported?

I haven't looked at the source code of the original Unix, but I see no
reason why the part that implements pipes couldn't have been written in
C, which may or may not call subroutines written in assembler. Only the
lowest-level stuff needs to be in assembly language, and that tends to
be very little.

Alwyn