lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061101165542.GA24989@khazad-dum.debian.net>
Date:	Wed, 1 Nov 2006 13:55:42 -0300
From:	Henrique de Moraes Holschuh <hmh@....eng.br>
To:	Shem Multinymous <multinymous@...il.com>
Cc:	David Woodhouse <dwmw2@...radead.org>,
	Richard Hughes <hughsient@...il.com>,
	Xavier Bestel <xavier.bestel@...e.fr>,
	Jean Delvare <khali@...ux-fr.org>, davidz@...hat.com,
	Dan Williams <dcbw@...hat.com>, linux-kernel@...r.kernel.org,
	devel@...top.org, sfr@...b.auug.org.au, len.brown@...el.com,
	greg@...ah.com, benh@...nel.crashing.org,
	linux-thinkpad mailing list <linux-thinkpad@...ux-thinkpad.org>,
	Pavel Machek <pavel@...e.cz>
Subject: Re: [PATCH v2] Re: Battery class driver.

On Wed, 01 Nov 2006, Shem Multinymous wrote:
> On 11/1/06, Henrique de Moraes Holschuh <hmh@....eng.br> wrote:
> >On Wed, 01 Nov 2006, David Woodhouse wrote:
> >> On Wed, 2006-11-01 at 13:26 +0000, Richard Hughes wrote:
> >> > With the battery class driver, how would that be conveyed? Would the
> >> > sysfs file be deleted in this case, or would the value of the sysfs
> >> > key be something like "<invalid>".
> >>
> >> I'd be inclined to make the read return -EINVAL.
> >
> >-EIO for transient errors (e.g. access to the embedded controller/battery
> >charger/whatever fails at that instant), -EINVAL for "not supported"
> >(missing ACPI method, attribute not supported in the specific hardware)?
> 
> Shouldn't it be -EIO or -EBUSY for transient errors (depending on
> type), and -ENXIO when not provided by hardware?

Sounds good to me, but I haven't seen much stuff returning -ENXIO.  Still,
AFAIK usually when you don't support something in sysfs, you don't provide
the entry at all so ENXIO should be quite rare.

> The -EINVAL is more appropriate for bad user-supplied values (out of
> range etc.) to writable attributes.

Yes, that makes a lot of sense.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ