Re: Is there a way I can check from a kernel module if a device file exists ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
On Feb 11, 2008 11:41 AM, Thomas Petazzoni<thomas.petazzoni@xxxxxxxxxxxxxxxxxx> wrote:> Le Mon, 11 Feb 2008 09:37:48 +0200,> "Ian Brown" <ianbrn@xxxxxxxxx> a écrit :>> > Is there a way I can check from a kernel module if a device file> > exists ?>> No.>> > For example, I want to check if a device file named :> > "/dev/myDeviceFile" exist (this device file should represent a char> > device).>> You probably don't want to do that, it's considered bad design. Can you> tell us more about what you're trying to do, so that we could probably> give you an idea on what to try ?>> For information, the device file in /dev must either be created> manually, or are created automatically by udev [1]. Instead of trying> to mess up with device files in the kernel, you should probably> configure udev instead.
Every char or block device has a major and a minor number. The file/dev/<any file> is just a special file pointing to those major andminor numbers in order to access some device driver from userland. Youcan have a driver running withtou any dev file accessing it or a devfile pointing to no driver.
As Thomas said, you probably don't want to do that.
Br,
David cohen
>> Sincerly,>> Thomas>> [1] http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html> --> Thomas Petazzoni, Free Electrons> Free Embedded Linux Training Materials> on http://free-electrons.com/training> (More than 1500 pages!)>��.n��������+%����w�j)p���{.n����z�ޖw�n'���q���b�������v��m�����Y�����


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux