Module Name:    src
Committed By:   jym
Date:           Sun Dec  4 18:34:20 UTC 2011

Modified Files:
        src/share/man/man9: sysctl.9

Log Message:
- add the bool type for IMMEDIATE flag.
- minor tweak to the handler example: it leaks 't' (on stack)
  when passed to sysctl_lookup(9), as it copyout its content via
  sysctl_data. That would not be the case if CTLFLAG_IMMEDIATE flag
  was set for this node but the example does not preclude that.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/sysctl.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/sysctl.9
diff -u src/share/man/man9/sysctl.9:1.17 src/share/man/man9/sysctl.9:1.18
--- src/share/man/man9/sysctl.9:1.17	Sun May 16 05:18:35 2010
+++ src/share/man/man9/sysctl.9	Sun Dec  4 18:34:20 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.9,v 1.17 2010/05/16 05:18:35 jruoho Exp $
+.\"	$NetBSD: sysctl.9,v 1.18 2011/12/04 18:34:20 jym Exp $
 .\"
 .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 16, 2010
+.Dd December 4, 2011
 .Dt SYSCTL 9
 .Os
 .Sh NAME
@@ -421,6 +421,7 @@ If the
 flag is set, the
 .Fa qv
 argument will be interpreted as the initial value for the new
+.Dq bool ,
 .Dq int
 or
 .Dq quad
@@ -504,6 +505,8 @@ sysctl_helper(SYSCTLFN_ARGS)
 	struct sysctlnode node;
 	int t, error;
 
+	t = *(int *)rnode-\*[Gt]sysctl_data;
+
 	node = *rnode;
 	node.sysctl_data = \*[Am]t;
 	error = sysctl_lookup(SYSCTLFN_CALL(\*[Am]node));
@@ -513,7 +516,7 @@ sysctl_helper(SYSCTLFN_ARGS)
 	if (t \*[Lt] 0 || t \*[Gt] 20)
 		return (EINVAL);
 
-	*(int*)rnode-\*[Gt]sysctl_data = t;
+	*(int *)rnode-\*[Gt]sysctl_data = t;
 	return (0);
 }
 .Ed

Reply via email to