[sane-devel] All sane frontends segfault with my HP 5200C

Oliver Rauch oliver.rauch@rauch-domain.de
Sun, 03 Feb 2002 14:18:30 +0100


Henning Meier-Geinitz wrote:

> How can I get the major/minor number of a device file?

Hi Henning,

I never did this but:

lstat and fstat have a field 
	dev_t st_dev 
	dev_t st_rdev
(man stat).

There are macros defined in linux/fs.h:
	MAJOR(dev_t dev)
	MINOR(dev_t dev)

that extract the major and minor number from
the device id.

I think this should work for linux.

Bye
Oliver

-- 
Homepage:	http://www.rauch-domain.de
sane-umax:	http://www.rauch-domain.de/sane-umax
xsane:		http://www.xsane.org
E-Mail:		mailto:Oliver.Rauch@rauch-domain.de