Deleted Added
sdiff udiff text old ( 130480 ) new ( 130653 )
full compact
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

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

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)sys_socket.c 8.1 (Berkeley) 6/10/93
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/sys_socket.c 130480 2004-06-14 18:16:22Z rwatson $");
34
35#include "opt_mac.h"
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/file.h>
40#include <sys/filedesc.h>
41#include <sys/mac.h>

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

126 struct ucred *active_cred;
127 struct thread *td;
128{
129 register struct socket *so = fp->f_data;
130
131 switch (cmd) {
132
133 case FIONBIO:
134 if (*(int *)data)
135 so->so_state |= SS_NBIO;
136 else
137 so->so_state &= ~SS_NBIO;
138 return (0);
139
140 case FIOASYNC:
141 if (*(int *)data) {
142 so->so_state |= SS_ASYNC;
143 so->so_rcv.sb_flags |= SB_ASYNC;
144 so->so_snd.sb_flags |= SB_ASYNC;
145 } else {
146 so->so_state &= ~SS_ASYNC;
147 so->so_rcv.sb_flags &= ~SB_ASYNC;
148 so->so_snd.sb_flags &= ~SB_ASYNC;
149 }
150 return (0);
151
152 case FIONREAD:
153 *(int *)data = so->so_rcv.sb_cc;
154 return (0);
155
156 case FIOSETOWN:

--- 90 unchanged lines hidden ---