LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2012, 07:09 AM   #1
AnkurTank
LQ Newbie
 
Registered: Oct 2012
Posts: 13

Rep: Reputation: Disabled
Changing character device file permission which is created by driver


I am writing character driver, and in init function i am creating character device under /dev/ by using device_create function. device is created when i insert the driver module by giving below command
# insmod <modulename.ko>

But device has rw permission set to ower and in this case owner is root. permission looks as follows, user doesnt have rw permission.
crw------- 1 root root 250, 1 Oct 26 13:41 /dev/<mydevice>

Now my doubt is how do i give read & write permission to group and user in driver code ?

Thank in advance for help
 
Old 10-28-2012, 07:20 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
You should be able to use udev to do your work ...
http://sourceforge.net/apps/mediawik...ng_a_udev_Rule
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i2c character device file not created in linux 2.6.24 on at91sam9263ek john_schimandle Linux - Kernel 5 05-27-2010 11:03 AM
How to set permission of a file created by java? emanresu Linux - General 4 01-23-2008 01:54 AM
Character Device driver: How to load it automatically ? shendeswanand Linux - Software 0 02-09-2006 09:59 PM
Character device driver calsoft_pg Linux - Software 0 01-03-2006 12:17 PM
I have 8 character file name, no extension files being created in my dbaseIII+ folder bonzo Linux - General 2 01-22-2004 06:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration