Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Aug 2005 16:19:26 +0200
From:      m.ehinger@ltur.de
To:        "Poul-Henning Kamp" <phk@phk.freebsd.dk>
Cc:        Pawel Jakub Dawidek <pjd@FreeBSD.org>, freebsd-arch@FreeBSD.org
Subject:   Re: sysctl_proc calls handler twice
Message-ID:  <OF7B953787.91394C4F-ONC125705F.004D6DAB-C125705F.004EBBE9@gateway-inter.net>
In-Reply-To: <11638.1124199342@phk.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

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@phk.freebsd.dk>                                                                               
             Gesendet von: phk@phk.freebsd.dk                                                                                       
                                                                                                                                 An 
                                                               Bruce Evans <bde@zeta.org.au>                                        
             16.08.2005 15:35                                                                                                 Kopie 
                                                               m.ehinger@ltur.de, Pawel Jakub Dawidek <pjd@FreeBSD.org>,            
                                                               freebsd-arch@FreeBSD.org                                             
                                                                                                                              Thema 
                                                               Re: sysctl_proc calls handler twice                                  
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    
                                                                                                                                    




In message <20050816221033.C47830@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@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.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OF7B953787.91394C4F-ONC125705F.004D6DAB-C125705F.004EBBE9>