Subject: re: bi-directional pipes?
To: Jorgen Lundman <lundman@lundman.net>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 02/05/2003 14:37:01
The same socketpair Matthew Green pointed out is also (possibly)
uni-directional?
no, i was pointing out the old sys_pipe() call that is a frontend
to the socketpair code. see kern/uipc_syscalls.c:sys_pipe():
if ((error = falloc(p, &rf, &fd)) != 0)
goto free2;
retval[0] = fd;
rf->f_flag = FREAD;
rf->f_type = DTYPE_SOCKET;
rf->f_ops = &socketops;
rf->f_data = (caddr_t)rso;
if ((error = falloc(p, &wf, &fd)) != 0)
goto free3;
wf->f_flag = FWRITE;
wf->f_type = DTYPE_SOCKET;
wf->f_ops = &socketops;
wf->f_data = (caddr_t)wso;
retval[1] = fd;
if ((error = unp_connect2(wso, rso)) != 0)
goto free4;
socketpair(2) itself is correctly bi-directional!