/* This isn't too useful in an environment without "fork", but in any case
   with the current Amiga PIPE: device, we MUST open the Read side first.
*/
#include <fcntl.h>
#include <errno.h>

char PiPeTeMp[] = "PIPE:uxp-XXXXXX";
int pipe (int *d)
{
    char p[32];

    strcpy(p, PiPeTeMp);
    if (mktemp(p))
	if ((d[0] = open(p,O_RDONLY)) >= 0)
	    if ((d[1] = open(p,O_WRONLY)) >= 0)
		return(0);

    errno = EMFILE;
    return(-1);
}
