[Kwintv] finding a filename or getting a handle from major/minor pair

Neil Macvicar blackmogu at vfemail.net
Mon Jan 19 15:50:03 CET 2004


Hi all,
	Well using the VIDIOCGUNIT ioctl we can get all related units for a given 
device as major/minor pairs. Problem is, I can't find any elegant way of 
using these to obtain a useable name/handle.

All I could come up with is 

1. Use mknod to temporarily create a special file. (requires root privs, so 
mainly discounted).

2. Use stat() and check each filename given. Then do something like:

major = statBuf.st_dev >> 8;
minor = statBuf.st_dev &0xff;

then compare them to find if this is the device.

Anyone got any other ideas ?

--Neil.


More information about the kwintv mailing list