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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 30 Oct 2010 12:00:47 -0200
From:	Henrique de Moraes Holschuh <hmh@....eng.br>
To:	Greg KH <gregkh@...e.de>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>, samu.p.onkalo@...ia.com,
	alan@...ux.intel.com, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: sysfs and power management

On Fri, 29 Oct 2010, Greg KH wrote:
> back to sleep.  That's probably the best way to do this, as userspace
> isn't going to open the sysfs file and not close it instantly anyway
> after it has read the data (seeking on a sysfs file isn't really
> recommended, even if it sometimes seems to work.)

Well, it is documented that seek(start of file) on sysfs works, and it
is ABI already (some userspace uses it on poll/select-capable
attributes).  So, maybe seek(somewhere that is not the start of the
file) doesn't work -- and it should return an error in that case if it
doesn't already...  but it is a lot more deterministic than "sometimes"
;-)

So yes, userspace will open() and not close() a sysfs attribute immediately
afterwards.  It is not only shell crap that interfaces to the kernel over
sysfs :-)

It would make a lot of sense to support the poll/select model on any
sensor for which you have event-driven notifications of change from the
hardware or firmware.

I don't know about open/close notifications, however.  Usually you need
those when you're going to stream something to userspace, and there are FAR
better interfaces to use in that case, such as the ring buffers used by the
data acquisition devices, netlink (which userspace programmers seems not to
like much :p), input devices, and generic character devices...

-- 
  "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