Error while opennig device file

Eugene Surovegin ebs at ebshome.net
Thu Jun 16 03:26:05 EST 2005


On Wed, Jun 15, 2005 at 06:19:43PM +0200, Garcia J?r?mie wrote:
> Hi everybody,
> I'd like to have your opinion on such a stupid question. Indeed, it must be very easy to see but
> I can't find out what goes on.
> I'm writing a device driver. In the init_module(), I register it with TEST_DEV_MAJOR = 122 
> 
> ret_val = register_chrdev(TEST_DEV_MAJOR, TEST_DEV_PROC_NAME, &lcd_fops);
> 
> In the user space, I have a programm that creates two device files using the same major number but with 
> different minor numbers:
> 
> ret_val = system("mknod -m 777 /dev/Test1 c 122 1");
> ret_val = system("mknod -m 777 /dev/Test1 c 122 2");
                                          ^ 
> Then I try to open both files :
> file_desc1 = open("/dev/test1", O_RDWR);
> file_desc2 = open("/dev/test2", O_RDWR);

You must be kidding.

You create /dev/Test1 twice, and then open /dev/test1 and /dev/test2.

First of all, Linux fs are case sensitive, second, you don't create 
test2 (even with wrong case).

-- 
Eugene








More information about the Linuxppc-dev mailing list