Date: Wed, 8 Aug 2007 14:19:32 GMT From: Jesper Brix Rosenkilde <jbr@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 124900 for review Message-ID: <200708081419.l78EJWQM070706@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124900 Change 124900 by jbr@jbr_bob on 2007/08/08 14:19:22 readded sysctl Affected files ... .. //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#7 edit .. //depot/projects/soc2007/jbr-syscall/src/sys/sys/sysctl.h#2 edit Differences ... ==== //depot/projects/soc2007/jbr-syscall/src/sys/kern/kern_exec.c#7 (text+ko) ==== @@ -86,6 +86,7 @@ static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS); static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS); +static int sysctl_kern_usrsysshm(SYSCTL_HANDLER_ARGS); static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); static int do_execve(struct thread *td, struct image_args *args, struct mac *mac_p); @@ -99,6 +100,9 @@ SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD, NULL, 0, sysctl_kern_usrstack, "LU", ""); +SYSCTL_PROC(_kern, KERN_USRSYSSHM, usrsysshm, CTLTYPE_ULONG|CTLFLAG_RD, + NULL, 0, sysctl_kern_usrsysshm, "LU", ""); + SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD, NULL, 0, sysctl_kern_stackprot, "I", ""); @@ -145,6 +149,25 @@ } static int +sysctl_kern_usrsysshm(SYSCTL_HANDLER_ARGS) +{ + struct proc *p; + int error; + + p = curproc; +#ifdef SCTL_MASK32 + if (req->flags & SCTL_MASK32) { + unsigned int val; + val = (unsigned int)p->p_sysent->sv_sysshm; + error = SYSCTL_OUT(req, &val, sizeof(val)); + } else +#endif + error = SYSCTL_OUT(req, &p->p_sysent->sv_sysshm, + sizeof(p->p_sysent->sv_sysshm)); + return error; +} + +static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS) { struct proc *p; ==== //depot/projects/soc2007/jbr-syscall/src/sys/sys/sysctl.h#2 (text+ko) ==== @@ -393,6 +393,7 @@ #define KERN_HOSTUUID 36 /* string: host UUID identifier */ #define KERN_ARND 37 /* int: from arc4rand() */ #define KERN_MAXID 38 /* number of valid kern ids */ +#define KERN_USRSYSSHM 39 /* int: address of sysshm page */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -431,6 +432,7 @@ { "logsigexit", CTLTYPE_INT }, \ { "iov_max", CTLTYPE_INT }, \ { "hostuuid", CTLTYPE_STRING }, \ + { "usrsysshm", CTLTYPE_INT }, \ } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708081419.l78EJWQM070706>