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 87725 2001-12-12 09:35:33Z alfred $
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, ap->a_td);
178 if (error) {
179 free(fip, M_VNODE);
180 vp->v_fifoinfo = NULL;
181 return (error);
182 }
183 fip->fi_readsock = rso;
184 error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0, ap->a_td);
185 if (error) {
186 (void)soclose(rso);
187 free(fip, M_VNODE);
188 vp->v_fifoinfo = NULL;
189 return (error);
190 }
191 fip->fi_writesock = wso;
192 error = unp_connect2(wso, rso);
--- 407 unchanged lines hidden ---
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 87725 2001-12-12 09:35:33Z alfred $
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, ap->a_td);
178 if (error) {
179 free(fip, M_VNODE);
180 vp->v_fifoinfo = NULL;
181 return (error);
182 }
183 fip->fi_readsock = rso;
184 error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0, ap->a_td);
185 if (error) {
186 (void)soclose(rso);
187 free(fip, M_VNODE);
188 vp->v_fifoinfo = NULL;
189 return (error);
190 }
191 fip->fi_writesock = wso;
192 error = unp_connect2(wso, rso);
--- 407 unchanged lines hidden ---