From nobody@FreeBSD.org  Mon Jan  3 17:58:53 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 939BF106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Jan 2011 17:58:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8367D8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Jan 2011 17:58:53 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p03HwrCP054743
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Jan 2011 17:58:53 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p03Hwr7k054742;
	Mon, 3 Jan 2011 17:58:53 GMT
	(envelope-from nobody)
Message-Id: <201101031758.p03Hwr7k054742@red.freebsd.org>
Date: Mon, 3 Jan 2011 17:58:53 GMT
From: Joris Dedieu <joris.dedieu@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] incorrect include in sysctl.9
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         153654
>Category:       docs
>Synopsis:       [patch] incorrect include in sysctl.9
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 03 18:00:24 UTC 2011
>Closed-Date:    Mon Jan 10 21:31:04 UTC 2011
>Last-Modified:  Mon Jan 10 21:31:04 UTC 2011
>Originator:     Joris Dedieu
>Release:        8.1-RELEASE-p2
>Organization:
>Environment:
FreeBSD ladybug2.rmdir.fr 8.1-RELEASE-p2 FreeBSD 8.1-RELEASE-p2 #0: Mon Dec 27 15:39:23 CET 2010     joris@ladybug2.rmdir.fr:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Has DATA_SET is defined in sys/kernel.h most SYSTL_* macros don't work if you don't include it.
>How-To-Repeat:

>Fix:
--- share/man/man9/sysctl.9.orig        2011-01-03 18:43:53.000000000 +0100
+++ share/man/man9/sysctl.9     2011-01-03 18:44:17.000000000 +0100
@@ -44,7 +44,7 @@
 .Nm SYSCTL_QUAD
 .Nd Static sysctl declaration functions
 .Sh SYNOPSIS
-.In sys/types.h
+.In sys/kernel.h
 .In sys/sysctl.h
 .Fn SYSCTL_DECL name
 .Fn SYSCTL_INT parent nbr name access ptr val descr


>Release-Note:
>Audit-Trail:

From: John Baldwin <jhb@freebsd.org>
To: freebsd-doc@freebsd.org
Cc: Joris Dedieu <joris.dedieu@gmail.com>,
 freebsd-gnats-submit@freebsd.org
Subject: Re: docs/153654: [patch] incorrect include in sysctl.9
Date: Mon, 3 Jan 2011 14:06:18 -0500

 <sys/kernel.h> does not include <sys/types.h>.  Plus, all of <sys/kernel.h>
 is not needed.  <sys/linker_set.h> is what defines DATA_SET().  This is
 probably the "right" set of includes:
 
 #include <sys/types.h>
 #include <sys/linker_set.h>
 #include <sys/sysctl.h>
 
 OTOH, <sysctl.h> should perhaps have a nested include of <sys/linker_set.h>
 in the #ifdef _KERNEL case in which case the manpage would not need changing.
 
 -- 
 John Baldwin

From: joris dedieu <joris.dedieu@gmail.com>
To: John Baldwin <jhb@freebsd.org>
Cc: freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: docs/153654: [patch] incorrect include in sysctl.9
Date: Fri, 7 Jan 2011 12:58:21 +0100

 You are right. My patch is wrong and your solution sounds better.
 Should I submit an other pr ?
 
 Joris

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/153654: commit references a PR
Date: Mon, 10 Jan 2011 20:59:25 +0000 (UTC)

 Author: jhb
 Date: Mon Jan 10 20:59:19 2011
 New Revision: 217239
 URL: http://svn.freebsd.org/changeset/base/217239
 
 Log:
   Add a nested include of <sys/linker_set.h> to make the sysctl(9) manpage
   accurate.  <sys/linker_set.h> is one of the very few headers similar to
   <sys/queue.h> for which nested includes is allowed.
   
   PR:		docs/153654
   Reviewed by:	bde
   MFC after:	1 month
 
 Modified:
   head/sys/sys/sysctl.h
 
 Modified: head/sys/sys/sysctl.h
 ==============================================================================
 --- head/sys/sys/sysctl.h	Mon Jan 10 20:56:59 2011	(r217238)
 +++ head/sys/sys/sysctl.h	Mon Jan 10 20:59:19 2011	(r217239)
 @@ -115,6 +115,8 @@ struct ctlname {
  #define CTL_AUTO_START	0x100
  
  #ifdef _KERNEL
 +#include <sys/linker_set.h>
 +
  #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
  	struct sysctl_req *req
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Jan 10 21:30:31 UTC 2011 
State-Changed-Why:  
bde@ agreed to add a nested include to <sys/sysctl.h> so that the manpage 
is now correct. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153654 
>Unformatted:
