sysctl_proc calls handler twice

m.ehinger at ltur.de m.ehinger at ltur.de
Tue Aug 16 14:20:03 GMT 2005


Thanks for all answers,

that more details than i needed.

I got around the problem by checking an external variable.

Here comes the hole story if somebody cares. (but be warned my english isn't the best)

      I wrote an driver for the Accelerometers used in Thinkpad and just want to see the data returned.
      So i created an sysctl proc which will read the data and return it.
      The problem was that the two calls to the proc are to close, i forgot to check if the Accelerometer
      has already finished its last run. So i want to write to the Accelerometer although he wasn't ready for that.
      With sysctlbyname i got no errors because the program itself took enough time between the calls.
      I now check if the previous command has finished before i send the new one so the double call isn't
       a probleme anymore.
      Any questions?

thanks again for the answers

maik




                                                                                                                                    
             "Poul-Henning Kamp" <phk at phk.freebsd.dk>                                                                               
             Gesendet von: phk at phk.freebsd.dk                                                                                       
                                                                                                                                 An 
                                                               Bruce Evans <bde at zeta.org.au>                                        
             16.08.2005 15:35                                                                                                 Kopie 
                                                               m.ehinger at ltur.de, Pawel Jakub Dawidek <pjd at FreeBSD.org>,            
                                                               freebsd-arch at FreeBSD.org                                             
                                                                                                                              Thema 
                                                               Re: sysctl_proc calls handler twice                                  
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    




In message <20050816221033.C47830 at delplex.bde.org>, Bruce Evans writes:

>     Only the last 2 of these calls reach the handler.  Proc handlers are
>     only special here in that they are more specialized than the integer
>     handlers.

Strictly speaking it is the other way arond: since integer handlers
are implemented in terms of proc handlers, it follows that proc handlers
cannot be more specialized than integer handlers.

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.




More information about the freebsd-arch mailing list