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.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> |
47#include <sys/filedesc.h> |
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 |
118 case FIOSETOWN: 119 return (fsetown(*(int *)data, &so->so_sigio)); 120 121 case FIOGETOWN: 122 *(int *)data = fgetown(so->so_sigio); |
123 return (0); 124 |
125 case SIOCSPGRP: 126 return (fsetown(-(*(int *)data), &so->so_sigio)); 127 |
128 case SIOCGPGRP: |
129 *(int *)data = -fgetown(so->so_sigio); |
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 --- |