kern_sysctl.c (294757) | kern_sysctl.c (298069) |
---|---|
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 --- 22 unchanged lines hidden (view full) --- 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 36 */ 37 38#include <sys/cdefs.h> | 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 --- 22 unchanged lines hidden (view full) --- 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/kern/kern_sysctl.c 294757 2016-01-26 01:15:18Z markj $"); | 39__FBSDID("$FreeBSD: head/sys/kern/kern_sysctl.c 298069 2016-04-15 16:10:11Z pfg $"); |
40 41#include "opt_capsicum.h" 42#include "opt_compat.h" 43#include "opt_ktrace.h" 44 45#include <sys/param.h> 46#include <sys/fail.h> 47#include <sys/systm.h> --- 859 unchanged lines hidden (view full) --- 907 if (!error) 908 error = SYSCTL_OUT(req, buf, strlen(buf)); 909 if (error) 910 goto out; 911 namelen--; 912 name++; 913 continue; 914 } | 40 41#include "opt_capsicum.h" 42#include "opt_compat.h" 43#include "opt_ktrace.h" 44 45#include <sys/param.h> 46#include <sys/fail.h> 47#include <sys/systm.h> --- 859 unchanged lines hidden (view full) --- 907 if (!error) 908 error = SYSCTL_OUT(req, buf, strlen(buf)); 909 if (error) 910 goto out; 911 namelen--; 912 name++; 913 continue; 914 } |
915 lsp2 = 0; | 915 lsp2 = NULL; |
916 SLIST_FOREACH(oid, lsp, oid_link) { 917 if (oid->oid_number != *name) 918 continue; 919 920 if (req->oldidx) 921 error = SYSCTL_OUT(req, ".", 1); 922 if (!error) 923 error = SYSCTL_OUT(req, oid->oid_name, --- 154 unchanged lines hidden (view full) --- 1078 return (ENOENT); 1079} 1080 1081static int 1082sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) 1083{ 1084 char *p; 1085 int error, oid[CTL_MAXNAME], len = 0; | 916 SLIST_FOREACH(oid, lsp, oid_link) { 917 if (oid->oid_number != *name) 918 continue; 919 920 if (req->oldidx) 921 error = SYSCTL_OUT(req, ".", 1); 922 if (!error) 923 error = SYSCTL_OUT(req, oid->oid_name, --- 154 unchanged lines hidden (view full) --- 1078 return (ENOENT); 1079} 1080 1081static int 1082sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) 1083{ 1084 char *p; 1085 int error, oid[CTL_MAXNAME], len = 0; |
1086 struct sysctl_oid *op = 0; | 1086 struct sysctl_oid *op = NULL; |
1087 struct rm_priotracker tracker; 1088 1089 if (!req->newlen) 1090 return (ENOENT); 1091 if (req->newlen >= MAXPATHLEN) /* XXX arbitrary, undocumented */ 1092 return (ENAMETOOLONG); 1093 1094 p = malloc(req->newlen+1, M_SYSCTL, M_WAITOK); --- 901 unchanged lines hidden --- | 1087 struct rm_priotracker tracker; 1088 1089 if (!req->newlen) 1090 return (ENOENT); 1091 if (req->newlen >= MAXPATHLEN) /* XXX arbitrary, undocumented */ 1092 return (ENAMETOOLONG); 1093 1094 p = malloc(req->newlen+1, M_SYSCTL, M_WAITOK); --- 901 unchanged lines hidden --- |