Porting to OS/2: Case #6 pipe()
Pipes are used for IPC(inter-process-communication). OS/2 kLIBC also supports them. However, there are some differences. First, kLIBC's anonymous pipe which is provided by pipe() does not support non-blocking mode. Second, it does not work with select(). To overcome these, there are two ways. One is to use a name pipe and the other one is to use socketpair(). Named pipe Named pipe is a IPC method based on server and client communication. Server side creates a name pipe, client side opens it, then communicate each other. Although this is IPC method, it is possible to use a named pipe in one process. We can create non-blocking pipes with this. However, this has a problem. First, select() does not work as well, because a named pipe is not a socket. Instead, you can use native APIs such as DosWaitNPipe(). Second, some kLIBC io functions such as fcntl() do not work. In this case, you can use DosSetNPHState() or DosSetFHState() APIs. socketpair() socketpair() is a IPC met...