#include <spawn.h> int Qp0zPipe(int fildes[2]);Service Program Name: QP0ZSPWN
The Qp0zPipe() function creates a data pipe that can be used by two processes. One end of the pipe is represented by the file descriptor returned in fildes[0]. The other end of the pipe is represented by the file descriptor returned in fildes[1]. Data that is written to one end of the pipe can be read from the other end of the pipe in a first-in-first-out basis. Both ends of the pipe are open for reading and writing.
The Qp0zPipe() function is often used with the spawn() function to allow the parent and child processes to send data to each other.
None.
0 | Qp0zPipe() was successful. |
-1 | Qp0zPipe() was not successful. The errno variable is set to indicate the error. |
If Qp0zPipe() is not successful, errno usually indicates one of the following errors. Under some conditions, errno could indicate an error other than those listed here.
Error condition | Additional information |
---|---|
[EFAULT] | |
[EINVAL] | |
[EIO] | |
[EMFILE] | |
[ENFILE] | |
[ENOBUFS] | |
[EOPNOTSUPP] | |
[EUNKNOWN] |
The i5/OS implementation of the Qp0zPipe()function is based on sockets rather than pipes and, therefore, uses socket descriptors. There are several differences:
After calling the fstat() function using one of the file descriptors returned on a Qp0zPipe() call, when the st_mode from the stat structure is passed to the S_ISFIFO() macro, the return value indicates FALSE. When the st_mode from the stat structure is passed to S_ISSOCK(), the return value indicates TRUE.
The file descriptors returned on a Qp0zPipe() call can be used with the send(), recv(), sendto(), recvfrom(), sendmsg(), and recvmsg() functions.
If you want to use the traditional implementation of pipes, in which the descriptors returned are pipe descriptors instead of socket descriptors, use the pipe() function.
Top | UNIX-Type APIs | APIs by category |