Deleted Added
full compact
kern_sysctl.c (38864) kern_sysctl.c (38869)
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Mike Karels at Berkeley Software Design, Inc.
7 *
8 * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD

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

32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Mike Karels at Berkeley Software Design, Inc.
7 *
8 * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD

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

32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
40 * $Id: kern_sysctl.c,v 1.75 1998/08/24 08:39:38 dfr Exp $
40 * $Id: kern_sysctl.c,v 1.76 1998/09/05 14:30:10 bde Exp $
41 */
42
43#include "opt_compat.h"
44
45#include <sys/param.h>
46#include <sys/buf.h>
47#include <sys/kernel.h>
48#include <sys/sysctl.h>

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

95 int j, k;
96 struct linker_set *l = (struct linker_set *) arg;
97 struct sysctl_oid **oidpp;
98
99 /* First, find the highest oid we have */
100 j = l->ls_length;
101 oidpp = (struct sysctl_oid **) l->ls_items;
102 for (k = 0; j--; oidpp++) {
41 */
42
43#include "opt_compat.h"
44
45#include <sys/param.h>
46#include <sys/buf.h>
47#include <sys/kernel.h>
48#include <sys/sysctl.h>

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

95 int j, k;
96 struct linker_set *l = (struct linker_set *) arg;
97 struct sysctl_oid **oidpp;
98
99 /* First, find the highest oid we have */
100 j = l->ls_length;
101 oidpp = (struct sysctl_oid **) l->ls_items;
102 for (k = 0; j--; oidpp++) {
103 if (!*oidpp)
104 continue;
103 if ((*oidpp)->oid_arg1 == arg) {
104 *oidpp = 0;
105 continue;
106 }
105 if ((*oidpp)->oid_arg1 == arg) {
106 *oidpp = 0;
107 continue;
108 }
107 if (*oidpp && (*oidpp)->oid_number > k)
109 if ((*oidpp)->oid_number > k)
108 k = (*oidpp)->oid_number;
109 }
110
111 /* Next, replace all OID_AUTO oids with new numbers */
112 j = l->ls_length;
113 oidpp = (struct sysctl_oid **) l->ls_items;
114 k += 100;
115 for (; j--; oidpp++)

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

127 sysctl_order((*oidpp)->oid_arg1);
128 }
129 qsort(l->ls_items, l->ls_length, sizeof l->ls_items[0],
130 sysctl_order_cmp);
131}
132
133SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_order, &sysctl_);
134
110 k = (*oidpp)->oid_number;
111 }
112
113 /* Next, replace all OID_AUTO oids with new numbers */
114 j = l->ls_length;
115 oidpp = (struct sysctl_oid **) l->ls_items;
116 k += 100;
117 for (; j--; oidpp++)

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

129 sysctl_order((*oidpp)->oid_arg1);
130 }
131 qsort(l->ls_items, l->ls_length, sizeof l->ls_items[0],
132 sysctl_order_cmp);
133}
134
135SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_order, &sysctl_);
136
137void
138sysctl_order_all(void)
139{
140 sysctl_order(&sysctl_);
141}
142
135/*
136 * "Staff-functions"
137 *
138 * These functions implement a presently undocumented interface
139 * used by the sysctl program to walk the tree, and get the type
140 * so it can print the value.
141 * This interface is under work and consideration, and should probably
142 * be killed with a big axe by the first person who can find the time.

--- 999 unchanged lines hidden ---
143/*
144 * "Staff-functions"
145 *
146 * These functions implement a presently undocumented interface
147 * used by the sysctl program to walk the tree, and get the type
148 * so it can print the value.
149 * This interface is under work and consideration, and should probably
150 * be killed with a big axe by the first person who can find the time.

--- 999 unchanged lines hidden ---