LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-15-2005, 11:30 AM   #1
lordofring
Member
 
Registered: Feb 2005
Posts: 91

Rep: Reputation: 15
question about how to use linux driver


Hello,

Since linux is file-oriented. Everytime, I want to operate a device, I need to open and close the dev file. Is it good? For example, my application needs to kick the watchdog timer. in my function to kick, I open the dev file, ioctl to kick it and close the file at the end.

I know it works. But I don't think it's good to open/close everytime. I'm wandering how much resource it waste to open/close the file each time? If my harddisk is working very busyily, will the open function be delayed?

I open/close everytime because it's one function. It's easy to be used by other users.

Thanks
 
Old 04-15-2005, 01:50 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
If you know your program is going to be calling the function which opens and closes a device file frequently it might make sense to open it globally and used the same opened instance each time.

However, don't confused /dev/ files with real files on a file system somewhere. /dev is a virtual file system that allows you to use filo i/o opperations as hooks into the kernel. That information isn't actually be written or read from the hard disk.
 
Old 04-15-2005, 03:00 PM   #3
lordofring
Member
 
Registered: Feb 2005
Posts: 91

Original Poster
Rep: Reputation: 15
It's the answer that I'm looking for. Thank you very much.
 
  


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
Wireless driver-linux newbie question dath Linux - Wireless Networking 8 02-12-2006 05:53 PM
ati driver question and console question kholdstayr Slackware 2 07-18-2005 03:30 PM
ATI Linux Driver Question (2.6.9-mm1) aarontc Linux - Software 5 01-16-2005 10:53 PM
Linux SCSI Device Driver Update question Vicis Linux - General 0 02-16-2004 08:15 AM
New to Linux - question on installing VGA driver Fishbu Mandriva 1 12-19-2003 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:59 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