sys/kern/kern_sensors.c
void
sensor_sysctl8magic_install(struct ksensordev *sensdev)
{
	struct sysctl_oid_list *ol;	
	struct sysctl_ctx_list *cl = &sensdev->clist;
	struct ksensor *s;
	struct ksensors_head *sh = &sensdev->sensors_list;

	sysctl_ctx_init(cl);
	ol = SYSCTL_CHILDREN(SYSCTL_ADD_NODE(cl, (&SYSCTL_NODE_CHILDREN(_hw,
	    sensors)), sensdev->num, sensdev->xname, CTLFLAG_RD, NULL, ""));
	SLIST_FOREACH(s, sh, list) {
		char n[32];

		ksnprintf(n, sizeof(n), "%s%d", sensor_type_s[s->type], s->numt);
		SYSCTL_ADD_PROC(cl, ol, OID_AUTO, n, CTLTYPE_STRUCT |
		    CTLFLAG_RD, s, 0, sysctl_handle_sensor, "S,sensor", "");
	}
}
/*
 * XXX:
 * FreeBSD's sysctl(9) .oid_handler functionality is not accustomed
 * for the CTLTYPE_NODE handler to handle the undocumented sysctl
 * magic calls.  As soon as such functionality is developed, 
 * sysctl_sensors_handler() should be converted to handle all such
 * calls, and these sysctl_add_oid(9) calls should be removed 
 * "with a big axe".  This whole sysctl_add_oid(9) business is solely
 * to please sysctl(8).
 */
FreeBSD's sysctl(9) .oid_handler functionality is not accustomed
for the CTLTYPE_NODE handler to handle the undocumented sysctl
magic calls.  As soon as such functionality is developed,
sysctl_sensors_handler() should be converted to handle all such
calls, and these sysctl_add_oid(9) calls should be removed
"with a big axe".
FreeBSD ' s sysctl ( 9 ) . oid_handler functionality is not accustomed for the CTLTYPE_NODE handler to handle the undocumented sysctl magic calls . As soon as such functionality is developed sysctl_sensors_handler () should be converted to handle all such calls and these sysctl_add_oid ( 9 ) calls should be removed " with a big axe " .
void
sensor_sysctl8magic_install(struct ksensordev *sensdev)
{
	struct sysctl_oid_list *ol;	
	struct sysctl_ctx_list *cl = &sensdev->clist;
	struct ksensor *s;
	struct ksensors_head *sh = &sensdev->sensors_list;
	sysctl_ctx_init(cl);
	ol = SYSCTL_CHILDREN(SYSCTL_ADD_NODE(cl, (&SYSCTL_NODE_CHILDREN(_hw,
	    sensors)), sensdev->num, sensdev->xname, CTLFLAG_RD, NULL, ""));
	SLIST_FOREACH(s, sh, list) {
		char n[32];
		ksnprintf(n, sizeof(n), "%s%d", sensor_type_s[s->type], s->numt);
		SYSCTL_ADD_PROC(cl, ol, OID_AUTO, n, CTLTYPE_STRUCT |
		    CTLFLAG_RD, s, 0, sysctl_handle_sensor, "S,sensor", "");
	}
}
void sensor_sysctl8magic_install ( struct ksensordev * sensdev ) { struct sysctl_oid_list * ol ; struct sysctl_ctx_list * cl = & sensdev -> clist ; struct ksensor * s ; struct ksensors_head * sh = & sensdev -> sensors_list ; sysctl_ctx_init ( cl ) ; ol = SYSCTL_CHILDREN ( SYSCTL_ADD_NODE ( cl , ( & SYSCTL_NODE_CHILDREN ( _hw , sensors ) ) , sensdev -> num , sensdev -> xname , CTLFLAG_RD , NULL , " " ) ) ; SLIST_FOREACH ( s , sh , list ) { char n [ 32 ] ; ksnprintf ( n , sizeof ( n ) , " " , sensor_type_s [ s -> type ] , s -> numt ) ; SYSCTL_ADD_PROC ( cl , ol , OID_AUTO , n , CTLTYPE_STRUCT | CTLFLAG_RD , s , 0 , sysctl_handle_sensor , " " , " " ) ; } }
XXX:
 FreeBSD's sysctl(9) .oid_handler functionality is not accustomed
 for the CTLTYPE_NODE handler to handle the undocumented sysctl
 magic calls.
XXX : FreeBSD ' s sysctl ( 9 ) . oid_handler functionality is not accustomed for the CTLTYPE_NODE handler to handle the undocumented sysctl magic calls .