LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 03-05-2005, 12:57 AM   #1
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Rep: Reputation: 30
Which File Functions Can Be Used On /proc File?


hello,
i found that in struct proc_dir_entry struct file_operations * proc_fops; is
defined. and struct file_operations has defined read, write, poll, llseek,ioctl,flush,release,lock etc functions. so can all these functions be used on any /proc entry in usermode as well as in kenrel mode?
Also can following functions be used on my own created /proc file kernel
module and when to use them as i have alredy struct file_opereations read and
write routine that read/write to/from /proc file.
typedef int (read_proc_t)(char *page, char **start, off_t off,
int count, int *eof, void *data);
typedef int (write_proc_t)(struct file *file, const char *buffer,
unsigned long count, void *data);
typedef int (get_info_t)(char *, char **, off_t, int);

regards,
cranium
 
Old 03-06-2005, 11:11 AM   #2
jtshaw
Moderator
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 63
You access proc files through the vfs layer (like you do every fs) so ALL fs ops can be run on it. That specific struct you are refering to would only include the functions that don't use the vfs default implementation.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/sys/fs/file-nr ?? jharris Linux - General 5 07-27-2009 06:07 PM
how proc file use to hibernation sajjadc Linux - Software 0 06-07-2005 01:06 PM
What functions of a file /etc/mail/virustable ukrainet Linux - Newbie 1 12-03-2004 09:33 AM
Reading from a /proc file russelh Programming 2 12-02-2004 05:30 PM
Using wildcards with PHP file functions patpawlowski Programming 3 03-18-2004 09:20 AM


All times are GMT -5. The time now is 06:10 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration