![Texas TMS320C6000 Programmer'S Reference Manual Download Page 67](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844067.webp)
Full Duplex Pipes Programming Interface
3-35
Sockets and Stream IO API
3.4.2
Pipe API Functions
Since pipes share file descriptor and IO functions with sockets, the only pipe
oriented function is the creation of the connected pair.
Create a Full Duplex Pipe
pipe
Syntax
int pipe( int *fd1, int *fd2 );
Parameter(s)
fd1
File descriptor to first end of pipe
fd2
File descriptor to second end of pipe
Return Value
File descriptor or –1 on error. A more detailed error code can be found by call-
ing fdError().
Description
Creates a pre-connected full duplex pipe. The returned file descriptors can be
used with all the “fd” file descriptor functions, as well as the send() and recv()
socket functions.
Pipes are connection oriented, so like TCP, a read or write call can return EN-
OTCONN when the connection is broken by one side or the other.
Note that BOTH file descriptors must be closed to correctly close down
(and free) a pipe.