/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#include	<unistd.h>
#include	"stream.h"


int
s_open_pipe(STREAM * p[2])
{
int pfd[2];
	if ( pipe(pfd) < 0 )
		return -1;
	p[0] = s_open_descripter(pfd[0],&s_pipe_table);
	p[1] = s_open_descripter(pfd[1],&s_pipe_table);
	return 0;
}

