devfs
[Top] [All Lists]

Determining if devfs is running from a module

To: devfs@xxxxxxxxxxx
Subject: Determining if devfs is running from a module
From: michael.firth@xxxxxx
Date: Thu, 8 Aug 2002 10:13:58 +0100
Sender: owner-devfs@xxxxxxxxxxx
I'm trying to add devfs support to my driver, and wonder what is the
suggested method of determining if the kernel the driver is loaded into is
running devfs.

I could just use CONFIG_DEVFS_FS, but this only indicates if the kernel that
the module was compiled against was running devfs, and isn't safe against a
kernel rebuild.

>From the code, I could call either 'devfs_generate_path' or
'devfs_set_file_size' with a NULL handle, which will return ENOSYS from the
stub code and EINVAL from the real devfs code, but feel that this is a
kludge.

Also, what is the recommended replacement for checking the major and minor
device numbers in a call to open - is it to use
'devfs_get_handle_from_inode', and compare with the handle returned from
'devfs_register'?

Thanks in advance

Michael Firth


<Prev in Thread] Current Thread [Next in Thread>