sysctl_proc calls handler twice

m.ehinger at ltur.de m.ehinger at ltur.de
Mon Aug 15 06:15:39 GMT 2005


thanks,

meanwhile i found out that sysctlbyname(3) calls it only once.

maik



                                                                                                                                    
             Pawel Jakub Dawidek <pjd at FreeBSD.org>                                                                                  
                                                                                                                                    
             12.08.2005 18:27                                                                                                    An 
                                                               m.ehinger at ltur.de                                                    
                                                                                                                              Kopie 
                                                               freebsd-arch at freebsd.org                                             
                                                                                                                              Thema 
                                                               Re: sysctl_proc calls handler twice                                  
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    




On Thu, Aug 11, 2005 at 06:12:14PM +0200, m.ehinger at ltur.de wrote:
+> Hi,
+>
+> can someone explain why a proc sysctl (add via SYSCTL_PROC or SYSCTL_ADD_PROC) calls the handler twice if i read the sysctl only
+> once? Is this the normal behaviour?

Yes, AFAIR first call is done to find out how much memory should be
allocated and second one is request for a real data.

+> How can i prevent this?

You can't, try to live with it.

--
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!




More information about the freebsd-arch mailing list