Deleted Added
full compact
svr4_socket.c (109153) svr4_socket.c (109623)
1/*
2 * Copyright (c) 1998 Mark Newton
3 * Copyright (c) 1996 Christos Zoulas.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
1/*
2 * Copyright (c) 1998 Mark Newton
3 * Copyright (c) 1996 Christos Zoulas.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $FreeBSD: head/sys/compat/svr4/svr4_socket.c 109153 2003-01-13 00:33:17Z dillon $
31 * $FreeBSD: head/sys/compat/svr4/svr4_socket.c 109623 2003-01-21 08:56:16Z alfred $
32 */
33
34/*
35 * In SVR4 unix domain sockets are referenced sometimes
36 * (in putmsg(2) for example) as a [device, inode] pair instead of a pathname.
37 * Since there is no iname() routine in the kernel, and we need access to
38 * a mapping from inode to pathname, we keep our own table. This is a simple
39 * linked list that contains the pathname, the [device, inode] pair, the

--- 93 unchanged lines hidden (view full) ---

133 * avoiding expensive atomic operations in the common case.
134 */
135 while (svr4_str_initialized != 2)
136 if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) {
137 TAILQ_INIT(&svr4_head);
138 atomic_store_rel_int(&svr4_str_initialized, 2);
139 }
140
32 */
33
34/*
35 * In SVR4 unix domain sockets are referenced sometimes
36 * (in putmsg(2) for example) as a [device, inode] pair instead of a pathname.
37 * Since there is no iname() routine in the kernel, and we need access to
38 * a mapping from inode to pathname, we keep our own table. This is a simple
39 * linked list that contains the pathname, the [device, inode] pair, the

--- 93 unchanged lines hidden (view full) ---

133 * avoiding expensive atomic operations in the common case.
134 */
135 while (svr4_str_initialized != 2)
136 if (atomic_cmpset_acq_int(&svr4_str_initialized, 0, 1)) {
137 TAILQ_INIT(&svr4_head);
138 atomic_store_rel_int(&svr4_str_initialized, 2);
139 }
140
141 e = malloc(sizeof(*e), M_TEMP, M_WAITOK);
141 e = malloc(sizeof(*e), M_TEMP, 0);
142 e->cookie = NULL;
143 e->dev = st->st_dev;
144 e->ino = st->st_ino;
145 e->p = td->td_proc;
146
147 if ((error = copyinstr(path, e->sock.sun_path,
148 sizeof(e->sock.sun_path), &len)) != 0) {
149 DPRINTF(("svr4_add_socket: copyinstr failed %d\n", error));

--- 44 unchanged lines hidden ---
142 e->cookie = NULL;
143 e->dev = st->st_dev;
144 e->ino = st->st_ino;
145 e->p = td->td_proc;
146
147 if ((error = copyinstr(path, e->sock.sun_path,
148 sizeof(e->sock.sun_path), &len)) != 0) {
149 DPRINTF(("svr4_add_socket: copyinstr failed %d\n", error));

--- 44 unchanged lines hidden ---