From owner-freebsd-arch@FreeBSD.ORG Tue Aug 16 14:29:24 2005 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4533216A42A for ; Tue, 16 Aug 2005 14:29:24 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BE1143D46 for ; Tue, 16 Aug 2005 14:29:23 +0000 (GMT) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id E926F52C70; Tue, 16 Aug 2005 16:29:21 +0200 (CEST) Received: from localhost (pjd.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 1F39352C6F; Tue, 16 Aug 2005 16:29:12 +0200 (CEST) Date: Tue, 16 Aug 2005 16:29:02 +0200 From: Pawel Jakub Dawidek To: m.ehinger@ltur.de Message-ID: <20050816142902.GE3944@garage.freebsd.pl> References: <11638.1124199342@phk.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3yNHWXBV/QO9xKNm" Content-Disposition: inline In-Reply-To: X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng devel (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: Poul-Henning Kamp , freebsd-arch@FreeBSD.org Subject: Re: sysctl_proc calls handler twice X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2005 14:29:25 -0000 --3yNHWXBV/QO9xKNm Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 16, 2005 at 04:19:26PM +0200, m.ehinger@ltur.de wrote: +>=20 +> Thanks for all answers, +>=20 +> that more details than i needed. +>=20 +> I got around the problem by checking an external variable. +>=20 +> Here comes the hole story if somebody cares. (but be warned my english i= sn't the best) +>=20 +> 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 for= got to check if the Accelerometer +> has already finished its last run. So i want to write to the Accel= erometer 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? You can recognize if userland is asking for the size only by checking if req->oldptr is NULL. If it is, you should only return size, if it is !=3D N= ULL then it requests for real data. BTW. Do you have any docs for what you are doing? Or can you send me what you got already? I was interested in this subject as well, but didn't found anything useful. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --3yNHWXBV/QO9xKNm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFDAfguForvXbEpPzQRAryPAKDlbatvQesnPIATjEjubSieLtv3nwCfXJaZ QSU6G93hw020ZljtTNMeFHk= =87Wc -----END PGP SIGNATURE----- --3yNHWXBV/QO9xKNm--