sys_socket.c (36735) | sys_socket.c (41086) |
---|---|
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.17 1998/03/28 10:33:07 bde Exp $ | 34 * $Id: sys_socket.c,v 1.18 1998/06/07 17:11:40 dfr Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/file.h> 40#include <sys/protosw.h> 41#include <sys/socket.h> 42#include <sys/socketvar.h> 43#include <sys/filio.h> /* XXX */ 44#include <sys/sockio.h> 45#include <sys/stat.h> 46#include <sys/uio.h> | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/file.h> 40#include <sys/protosw.h> 41#include <sys/socket.h> 42#include <sys/socketvar.h> 43#include <sys/filio.h> /* XXX */ 44#include <sys/sockio.h> 45#include <sys/stat.h> 46#include <sys/uio.h> |
47#include <sys/filedesc.h> |
|
47 48#include <net/if.h> 49#include <net/route.h> 50 51static int soo_read __P((struct file *fp, struct uio *uio, 52 struct ucred *cred)); 53static int soo_write __P((struct file *fp, struct uio *uio, 54 struct ucred *cred)); --- 54 unchanged lines hidden (view full) --- 109 so->so_snd.sb_flags &= ~SB_ASYNC; 110 } 111 return (0); 112 113 case FIONREAD: 114 *(int *)data = so->so_rcv.sb_cc; 115 return (0); 116 | 48 49#include <net/if.h> 50#include <net/route.h> 51 52static int soo_read __P((struct file *fp, struct uio *uio, 53 struct ucred *cred)); 54static int soo_write __P((struct file *fp, struct uio *uio, 55 struct ucred *cred)); --- 54 unchanged lines hidden (view full) --- 110 so->so_snd.sb_flags &= ~SB_ASYNC; 111 } 112 return (0); 113 114 case FIONREAD: 115 *(int *)data = so->so_rcv.sb_cc; 116 return (0); 117 |
117 case SIOCSPGRP: 118 so->so_pgid = *(int *)data; | 118 case FIOSETOWN: 119 return (fsetown(*(int *)data, &so->so_sigio)); 120 121 case FIOGETOWN: 122 *(int *)data = fgetown(so->so_sigio); |
119 return (0); 120 | 123 return (0); 124 |
125 case SIOCSPGRP: 126 return (fsetown(-(*(int *)data), &so->so_sigio)); 127 |
|
121 case SIOCGPGRP: | 128 case SIOCGPGRP: |
122 *(int *)data = so->so_pgid; | 129 *(int *)data = -fgetown(so->so_sigio); |
123 return (0); 124 125 case SIOCATMARK: 126 *(int *)data = (so->so_state&SS_RCVATMARK) != 0; 127 return (0); 128 } 129 /* 130 * Interface/routing/protocol specific ioctls: --- 45 unchanged lines hidden --- | 130 return (0); 131 132 case SIOCATMARK: 133 *(int *)data = (so->so_state&SS_RCVATMARK) != 0; 134 return (0); 135 } 136 /* 137 * Interface/routing/protocol specific ioctls: --- 45 unchanged lines hidden --- |