1/*
2 * Copyright (c) 1998 Mark Newton
3 * Copyright (c) 1994 Christos Zoulas
4 * Copyright (c) 1997 Todd Vierling
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 16 unchanged lines hidden (view full) ---
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * Stolen from NetBSD /sys/compat/svr4/svr4_net.c. Pseudo-device driver
30 * skeleton produced from /usr/share/examples/drivers/make_pseudo_driver.sh
31 * in 3.0-980524-SNAP then hacked a bit (but probably not enough :-).
32 *
33 * $FreeBSD: head/sys/dev/streams/streams.c 85653 2001-10-29 01:22:15Z dillon $
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/kernel.h> /* SYSINIT stuff */
39#include <sys/conf.h> /* cdevsw stuff */
40#include <sys/malloc.h> /* malloc region definitions */
41#include <sys/file.h>
--- 217 unchanged lines hidden (view full) ---
259
260 default:
261 return EOPNOTSUPP;
262 }
263
264 if ((error = falloc(td, &fp, &fd)) != 0)
265 return error;
266
267 if ((error = socreate(family, &so, type, protocol, td)) != 0) {
268 p->p_fd->fd_ofiles[fd] = 0;
269 ffree(fp);
270 return error;
271 }
272
273 fp->f_data = (caddr_t)so;
274 fp->f_flag = FREAD|FWRITE;
275 fp->f_ops = &svr4_netops;
--- 134 unchanged lines hidden ---
2 * Copyright (c) 1998 Mark Newton
3 * Copyright (c) 1994 Christos Zoulas
4 * Copyright (c) 1997 Todd Vierling
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 16 unchanged lines hidden (view full) ---
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * Stolen from NetBSD /sys/compat/svr4/svr4_net.c. Pseudo-device driver
30 * skeleton produced from /usr/share/examples/drivers/make_pseudo_driver.sh
31 * in 3.0-980524-SNAP then hacked a bit (but probably not enough :-).
32 *
33 * $FreeBSD: head/sys/dev/streams/streams.c 85653 2001-10-29 01:22:15Z dillon $
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/kernel.h> /* SYSINIT stuff */
39#include <sys/conf.h> /* cdevsw stuff */
40#include <sys/malloc.h> /* malloc region definitions */
41#include <sys/file.h>
--- 217 unchanged lines hidden (view full) ---
259
260 default:
261 return EOPNOTSUPP;
262 }
263
264 if ((error = falloc(td, &fp, &fd)) != 0)
265 return error;
266
267 if ((error = socreate(family, &so, type, protocol, td)) != 0) {
268 p->p_fd->fd_ofiles[fd] = 0;
269 ffree(fp);
270 return error;
271 }
272
273 fp->f_data = (caddr_t)so;
274 fp->f_flag = FREAD|FWRITE;
275 fp->f_ops = &svr4_netops;
--- 134 unchanged lines hidden ---