sys_socket.c (14546) | sys_socket.c (17096) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1990, 1993 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 * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 | 1/* 2 * Copyright (c) 1982, 1986, 1990, 1993 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 * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93 |
34 * $Id: sys_socket.c,v 1.6 1995/12/14 08:31:49 phk Exp $ | 34 * $Id: sys_socket.c,v 1.7 1996/03/11 15:12:43 davidg Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/queue.h> 39#include <sys/systm.h> 40#include <sys/proc.h> 41#include <sys/file.h> 42#include <sys/mbuf.h> --- 90 unchanged lines hidden (view full) --- 133 * Interface/routing/protocol specific ioctls: 134 * interface and routing ioctls should have a 135 * different entry since a socket's unnecessary 136 */ 137 if (IOCGROUP(cmd) == 'i') 138 return (ifioctl(so, cmd, data, p)); 139 if (IOCGROUP(cmd) == 'r') 140 return (rtioctl(cmd, data, p)); | 35 */ 36 37#include <sys/param.h> 38#include <sys/queue.h> 39#include <sys/systm.h> 40#include <sys/proc.h> 41#include <sys/file.h> 42#include <sys/mbuf.h> --- 90 unchanged lines hidden (view full) --- 133 * Interface/routing/protocol specific ioctls: 134 * interface and routing ioctls should have a 135 * different entry since a socket's unnecessary 136 */ 137 if (IOCGROUP(cmd) == 'i') 138 return (ifioctl(so, cmd, data, p)); 139 if (IOCGROUP(cmd) == 'r') 140 return (rtioctl(cmd, data, p)); |
141 return ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL, 142 (struct mbuf *)cmd, (struct mbuf *)data, (struct mbuf *)0)); | 141 return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd, data, 0)); |
143} 144 145int 146soo_select(fp, which, p) 147 struct file *fp; 148 int which; 149 struct proc *p; 150{ --- 36 unchanged lines hidden (view full) --- 187int 188soo_stat(so, ub) 189 register struct socket *so; 190 register struct stat *ub; 191{ 192 193 bzero((caddr_t)ub, sizeof (*ub)); 194 ub->st_mode = S_IFSOCK; | 142} 143 144int 145soo_select(fp, which, p) 146 struct file *fp; 147 int which; 148 struct proc *p; 149{ --- 36 unchanged lines hidden (view full) --- 186int 187soo_stat(so, ub) 188 register struct socket *so; 189 register struct stat *ub; 190{ 191 192 bzero((caddr_t)ub, sizeof (*ub)); 193 ub->st_mode = S_IFSOCK; |
195 return ((*so->so_proto->pr_usrreq)(so, PRU_SENSE, 196 (struct mbuf *)ub, (struct mbuf *)0, 197 (struct mbuf *)0)); | 194 return ((*so->so_proto->pr_usrreqs->pru_sense)(so, ub)); |
198} 199 200/* ARGSUSED */ 201static int 202soo_close(fp, p) 203 struct file *fp; 204 struct proc *p; 205{ 206 int error = 0; 207 208 if (fp->f_data) 209 error = soclose((struct socket *)fp->f_data); 210 fp->f_data = 0; 211 return (error); 212} | 195} 196 197/* ARGSUSED */ 198static int 199soo_close(fp, p) 200 struct file *fp; 201 struct proc *p; 202{ 203 int error = 0; 204 205 if (fp->f_data) 206 error = soclose((struct socket *)fp->f_data); 207 fp->f_data = 0; 208 return (error); 209} |