From owner-freebsd-hackers Mon Jul 17 12:14:35 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id D87B337BB12; Mon, 17 Jul 2000 12:14:30 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id NAA81576; Mon, 17 Jul 2000 13:14:29 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id NAA63275; Mon, 17 Jul 2000 13:14:24 -0600 (MDT) Message-Id: <200007171914.NAA63275@harmony.village.org> To: Hajimu UMEMOTO Subject: Re: sysctl interface for apm? Cc: nsayer@freebsd.org, nsayer@sftw.com, freebsd-hackers@freebsd.org In-reply-to: Your message of "Tue, 18 Jul 2000 03:35:14 +0900." <20000718.033514.59474907.ume@mahoroba.org> References: <20000718.033514.59474907.ume@mahoroba.org> <1884.963737703@critter.freebsd.dk> <200007171753.LAA62543@harmony.village.org> <39734D36.5FC7DDA@sftw.com> Date: Mon, 17 Jul 2000 13:14:24 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20000718.033514.59474907.ume@mahoroba.org> Hajimu UMEMOTO writes: : nsayer> The "why bother" is easy -- one should not have to belong to group : nsayer> operator to determine the current battery state. Too many things : nsayer> already have to be sgid (at least) without making this another reason. : I love this feature. Don't worry, he's not going to change this feature. I use it and will fix it back if someone "breaks" it.. : nsayer> I took a middle ground. I have two ints, machdep.apm_battlevel : nsayer> and machdep.apm_powerstate. The power state number is : nsayer> -1 to 5 for unknown, critical, low, medium, high (which four imply : nsayer> battery power), AC or charging (which two imply AC power). : : Then, I cannot switch to use sysctl. Actually, GKrellM requires : ai_batt_stat, ai_acline, ai_batt_life and ai_batt_time members of : struct apm_info. Yes. The right answer isn't to kludge this through a sysctl, but instead it is to fix apm to that it is safe to make it world read only. Is there a way inside a ioctl to see if you have something open for write access? Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message