2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
15 int pipe(int *pipedes
)
27 if ((rdesc
= malloc(sizeof(fdesc
))) == NULL
)
29 if ((wdesc
= malloc(sizeof(fdesc
))) == NULL
) {
34 if (Pipe("PIPEFS:", &reader
, &writer
) != DOSTRUE
) {
35 errno
= IoErr2errno(IoErr());
41 pipedes
[0] = __getfdslot(__getfirstfd(0));
43 rdesc
->flags
= O_RDONLY
;
45 __setfdesc(pipedes
[0], rdesc
);
47 pipedes
[1] = __getfdslot(__getfirstfd(pipedes
[0]));
49 wdesc
->flags
= O_WRONLY
;
51 __setfdesc(pipedes
[1], wdesc
);