Deleted Added
full compact
uipc_sockbuf.c (90227) uipc_sockbuf.c (92751)
1/*
2 * Copyright (c) 1982, 1986, 1988, 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 * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
1/*
2 * Copyright (c) 1982, 1986, 1988, 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 * @(#)uipc_socket2.c 8.1 (Berkeley) 6/10/93
34 * $FreeBSD: head/sys/kern/uipc_sockbuf.c 90227 2002-02-05 02:00:56Z dillon $
34 * $FreeBSD: head/sys/kern/uipc_sockbuf.c 92751 2002-03-20 04:09:59Z jeff $
35 */
36
37#include "opt_param.h"
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/domain.h>
41#include <sys/file.h> /* for maxfiles */
42#include <sys/kernel.h>

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

50#include <sys/stat.h>
51#include <sys/socket.h>
52#include <sys/socketvar.h>
53#include <sys/signalvar.h>
54#include <sys/sysctl.h>
55#include <sys/aio.h> /* for aio_swake proto */
56#include <sys/event.h>
57
35 */
36
37#include "opt_param.h"
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/domain.h>
41#include <sys/file.h> /* for maxfiles */
42#include <sys/kernel.h>

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

50#include <sys/stat.h>
51#include <sys/socket.h>
52#include <sys/socketvar.h>
53#include <sys/signalvar.h>
54#include <sys/sysctl.h>
55#include <sys/aio.h> /* for aio_swake proto */
56#include <sys/event.h>
57
58int maxsockets;
59
60void (*aio_swake)(struct socket *, struct sockbuf *);
61
62/*
63 * Primitive routines for operating on sockets and socket buffers
64 */
65
66u_long sb_max = SB_MAX; /* XXX should be static */
67

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

999SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW, 0, "IPC");
1000
1001/* This takes the place of kern.maxsockbuf, which moved to kern.ipc. */
1002static int dummy;
1003SYSCTL_INT(_kern, KERN_DUMMY, dummy, CTLFLAG_RW, &dummy, 0, "");
1004
1005SYSCTL_INT(_kern_ipc, KIPC_MAXSOCKBUF, maxsockbuf, CTLFLAG_RW,
1006 &sb_max, 0, "Maximum socket buffer size");
58void (*aio_swake)(struct socket *, struct sockbuf *);
59
60/*
61 * Primitive routines for operating on sockets and socket buffers
62 */
63
64u_long sb_max = SB_MAX; /* XXX should be static */
65

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

997SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW, 0, "IPC");
998
999/* This takes the place of kern.maxsockbuf, which moved to kern.ipc. */
1000static int dummy;
1001SYSCTL_INT(_kern, KERN_DUMMY, dummy, CTLFLAG_RW, &dummy, 0, "");
1002
1003SYSCTL_INT(_kern_ipc, KIPC_MAXSOCKBUF, maxsockbuf, CTLFLAG_RW,
1004 &sb_max, 0, "Maximum socket buffer size");
1007SYSCTL_INT(_kern_ipc, OID_AUTO, maxsockets, CTLFLAG_RD,
1008 &maxsockets, 0, "Maximum number of sockets avaliable");
1009SYSCTL_INT(_kern_ipc, KIPC_SOCKBUF_WASTE, sockbuf_waste_factor, CTLFLAG_RW,
1010 &sb_efficiency, 0, "");
1005SYSCTL_INT(_kern_ipc, KIPC_SOCKBUF_WASTE, sockbuf_waste_factor, CTLFLAG_RW,
1006 &sb_efficiency, 0, "");
1011
1012/*
1013 * Initialise maxsockets
1014 */
1015static void init_maxsockets(void *ignored)
1016{
1017 TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
1018 maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters));
1019}
1020SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL);