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 83366 2001-09-12 08:38:13Z julian $
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>
--- 342 unchanged lines hidden (view full) ---
384 }
385 return;
386 }
387
388 TAILQ_FOREACH(e, &svr4_head, entries)
389 if (e->p == p && e->cookie == cookie) {
390 TAILQ_REMOVE(&svr4_head, e, entries);
391 DPRINTF(("svr4_delete_socket: %s [%p,%d,%d]\n",
392 e->sock.sun_path, p, e->dev, e->ino));
393 free(e, M_TEMP);
394 return;
395 }
396}
397
398static int
399svr4_soo_close(struct file *fp, struct thread *td)
400{
401 struct socket *so = (struct socket *)fp->f_data;
402
403 /* CHECKUNIT_DIAG(ENXIO);*/
404
405 svr4_delete_socket(td->td_proc, fp);
406 free(so->so_emuldata, M_TEMP);
407 return soo_close(fp, td);
408 return (0);
409}
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 83366 2001-09-12 08:38:13Z julian $
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>
--- 342 unchanged lines hidden (view full) ---
384 }
385 return;
386 }
387
388 TAILQ_FOREACH(e, &svr4_head, entries)
389 if (e->p == p && e->cookie == cookie) {
390 TAILQ_REMOVE(&svr4_head, e, entries);
391 DPRINTF(("svr4_delete_socket: %s [%p,%d,%d]\n",
392 e->sock.sun_path, p, e->dev, e->ino));
393 free(e, M_TEMP);
394 return;
395 }
396}
397
398static int
399svr4_soo_close(struct file *fp, struct thread *td)
400{
401 struct socket *so = (struct socket *)fp->f_data;
402
403 /* CHECKUNIT_DIAG(ENXIO);*/
404
405 svr4_delete_socket(td->td_proc, fp);
406 free(so->so_emuldata, M_TEMP);
407 return soo_close(fp, td);
408 return (0);
409}