From: linux lover <linux_lover2004@yahoo.com>
To: linux-kernel@vger.kernel.org, lkg india <lkg_india@yahoogroups.com>
Subject: some /proc understandings
Date: Tue, 1 Mar 2005 22:17:20 -0800 (PST) [thread overview]
Message-ID: <20050302061720.74613.qmail@web52207.mail.yahoo.com> (raw)
Hello,
1) I want to know how much can i write to
/proc entry file?? Is there any limitation on file
size???
2)Also how can i call /proc entry files
proc_read_myfile function on that file by another
kernel module call? What parameters i require to pass
and how? Say i have read functions as
struct myfile_data_t {
char value[8];
};
struct proc_dir_entry *myfile_file;
struct myfile_data_t myfile_data;
int proc_read_myfile(char *page, char **start, off_t
off, int count, int *eof, void *data)
{
int len;
/* cast the void pointer of data to myfile_data_t*/
struct myfile_data_t *myfile_data=(struct
myfile_data_t *)data;
/* use sprintf to fill the page array with a string */
len = sprintf(page, "%s", myfile_data->value);
return len;
}
Then can it possible that i can call proc_read_myfile
from another kernel module?? Instead read file from
user level call?
3) Also Is following code valid of creating /proc
files with different file name created by passing
function cr_proc(fname)?
struct proc_dir_entry *entnew;
int cr_proc(char *fname)
{
if ((entnew1 = create_proc_entry(fname,
S_IRUGO | S_IWUSR, NULL)) == NULL)
return -EACCES;
entnew1->proc_fops = &proc_file_operations;
}
static struct file_operations proc_file_operations = {
open: proc_open,
release: proc_release,
read: proc_read,
write: proc_write,
};
What will happen if dynamic file names are going
to use same all above 4 functions???
regards,
linux_lover
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
reply other threads:[~2005-03-02 6:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050302061720.74613.qmail@web52207.mail.yahoo.com \
--to=linux_lover2004@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkg_india@yahoogroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®