It is impossible. When the kernel loads it first loads built in modules, then mounts file system later on init insert other modules. What you want is a module that can only be inserted by init or manually by modprob or insmod. In modern systems however, the device files are generated using udevd so you don't need to check for device file.
-- Ori Idan On Feb 19, 2008 11:13 AM, Dan Shimshoni <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way I can test, from a kernel module, the existence of a > device file ? > > A kernel module I write is a character device module, which depends > on getting ioctls. In order that it will work, "mknod ... /dev/myDev" > should be issued before to create the device file. > > Is there a way to check, in the init() method of this module, the > existence of /dev/myDev (and exit with a proper printk if /dev/myDev > does not exist)? > > DS > > ================================================================= > To unsubscribe, send mail to [EMAIL PROTECTED] with > the word "unsubscribe" in the message body, e.g., run the command > echo unsubscribe | mail [EMAIL PROTECTED] > > -- ספרים וסיפורים שכתבתי: http://www.thestories.org