<aside>
💡 An unnamed pipe
is accessible only by the process that created the pipe and its child processes. An unnamed pipe does not have to be opened before it can be used**. It is a temporary file that lasts only until the last file descriptor that references it is closed.** You can create an unnamed pipe by calling the pipe()
function.
https://www.ibm.com/docs/en/zos/2.4.0?topic=operations-pipe-io
</aside>
pipex
과제에서 활용하게 되는 파이프이다.
pipe()
함수를 통해 pipe
시스템 콜을 호출 할 수 있다.
파이프는 단방향으로 작동하여 한 프로세스는 Read 혹은 Write 만, 상대 프로세스는 Write 혹은 Read만 가능하다.
File descriptor
를 통해서 파이프에 연결되기 때문에, File descriptor
를 통해 read()
, write()
함수 등을 이용하게 된다.
PIPE type
의 FIFO
파일을 하나 생성하여 해당 파일을 통해 프로세스간에 통신을 이룬다.pipe()
를 통해서 파이프를 개설했다면, named PIPE의 경우 mkfifo()
함수를 통해서 named PIPE 파일을 생성한다.open
하여 read/write
작업을 수행한다. (half-duplex이기 때문에 두 프로세스간 full-duplex로 작동하기 위해서는 두 개의 파이프가 필요하다.)