From: "Rajat Jain" <rajat.noida.india@gmail.com>
To: kernelnewbies <kernelnewbies@nl.linux.org>,
newbie <linux-newbie@vger.kernel.org>
Subject: "struct file" - per process per file?
Date: Thu, 29 Mar 2007 22:11:48 +0530 [thread overview]
Message-ID: <b115cb5f0703290941k26dcefear2a113c939b8db224@mail.gmail.com> (raw)
Hi,
This has reference to LDD3 chap3 - Char drivers (Pg 60).
The following is my understanding which seems to be incorrect. Can
somebody please point out what am I missing?
LDD3 states that the fops->open() and fops->release() methods are
called only when "struct file" is created / destroyed. It further says
that "struct file" is created ONLY when a process calls open() system
all on a file. To give an example, it also says that if process 1
opens file A and then forks another process B, then A and B will share
the same struct file??
This seems quite strange to me as I had an understanding that two
processes working on the same file will always have different file
structure. Also, this would mean that a read by one of the processes
on the file would affect the file position pointer in the other
process?
I am sure I am missing something here. What is it?
Thanks,
Rajat
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ
next reply other threads:[~2007-03-29 16:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-29 16:41 Rajat Jain [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-03-30 1:51 "struct file" - per process per file? Gaurav Dhiman
2007-03-30 2:34 ` Rajat Jain
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=b115cb5f0703290941k26dcefear2a113c939b8db224@mail.gmail.com \
--to=rajat.noida.india@gmail.com \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-newbie@vger.kernel.org \
/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