streams.c (109153) | streams.c (109623) |
---|---|
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 * | 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 109153 2003-01-13 00:33:17Z dillon $ | 33 * $FreeBSD: head/sys/dev/streams/streams.c 109623 2003-01-21 08:56:16Z alfred $ |
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> --- 320 unchanged lines hidden (view full) --- 362 /* 363 * mpfixme: lock socketbuffer here 364 */ 365 if (so->so_emuldata) { 366 return so->so_emuldata; 367 } 368 369 /* Allocate a new one. */ | 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> --- 320 unchanged lines hidden (view full) --- 362 /* 363 * mpfixme: lock socketbuffer here 364 */ 365 if (so->so_emuldata) { 366 return so->so_emuldata; 367 } 368 369 /* Allocate a new one. */ |
370 st = malloc(sizeof(struct svr4_strm), M_TEMP, M_WAITOK); | 370 st = malloc(sizeof(struct svr4_strm), M_TEMP, 0); |
371 st->s_family = so->so_proto->pr_domain->dom_family; 372 st->s_cmd = ~0; 373 st->s_afd = -1; 374 st->s_eventmask = 0; 375 /* 376 * avoid a race where we loose due to concurrancy issues 377 * of two threads trying to allocate the so_emuldata. 378 */ --- 50 unchanged lines hidden --- | 371 st->s_family = so->so_proto->pr_domain->dom_family; 372 st->s_cmd = ~0; 373 st->s_afd = -1; 374 st->s_eventmask = 0; 375 /* 376 * avoid a race where we loose due to concurrancy issues 377 * of two threads trying to allocate the so_emuldata. 378 */ --- 50 unchanged lines hidden --- |