1/* 2 * Copyright (c) 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 |
34 * $FreeBSD: head/sys/fs/fifofs/fifo_vnops.c 88739 2001-12-31 17:45:16Z rwatson $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/unistd.h> 40#include <sys/kernel.h> 41#include <sys/lock.h> 42#include <sys/malloc.h> --- 126 unchanged lines hidden (view full) --- 169 struct fifoinfo *fip; 170 struct thread *td = ap->a_td; 171 struct socket *rso, *wso; 172 int error; 173 174 if ((fip = vp->v_fifoinfo) == NULL) { 175 MALLOC(fip, struct fifoinfo *, sizeof(*fip), M_VNODE, M_WAITOK); 176 vp->v_fifoinfo = fip; |
177 error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0, 178 ap->a_td->td_proc->p_ucred, ap->a_td); |
179 if (error) { 180 free(fip, M_VNODE); 181 vp->v_fifoinfo = NULL; 182 return (error); 183 } 184 fip->fi_readsock = rso; |
185 error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0, 186 ap->a_td->td_proc->p_ucred, ap->a_td); |
187 if (error) { 188 (void)soclose(rso); 189 free(fip, M_VNODE); 190 vp->v_fifoinfo = NULL; 191 return (error); 192 } 193 fip->fi_writesock = wso; 194 error = unp_connect2(wso, rso); --- 407 unchanged lines hidden --- |