From: "Helight.Xu" <helight.xu@gmail.com>
To: Xiaotian Feng <xtfeng@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 如何通过fd找到打开文件的路径及名称
Date: Fri, 20 Nov 2009 17:55:07 +0800 [thread overview]
Message-ID: <4B06677B.9050101@gmail.com> (raw)
In-Reply-To: <7b6bb4a50911200012s67b28e58g8109b71479ef4257@mail.gmail.com>
Xiaotian Feng wrote:
> in fs/open.c
> sys_open
> | --> do_sys_open
> |---> fd_install
>
> Then fd is installed into file_fdtable
>
> in fs/file_table.c
> fget_light/fget
> |----> fcheck_files
>
> Then kernel get files from fd.
>
struct file is easy to get : current->files->fd_array[fd]
but I didn't find the file name!
> 2009/11/20 Helight.Xu <helight.xu@gmail.com>:
>
>> 在用户程序中打开文件进行编辑,那在内核中如何能通过open后的fd
>> 来找到相应打开文件的路径及其名字呢?
>>
>> --
>> ---------------------------------
>> Zhenwen Xu - Open and Free
>> Home Page: http://zhwen.org
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>>
>>
>
>
--
---------------------------------
Zhenwen Xu - Open and Free
Home Page: http://zhwen.org
next prev parent reply other threads:[~2009-11-20 9:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-20 6:33 如何通过fd找到打开文件的路径及名称 Helight.Xu
2009-11-20 8:12 ` 如何通过fd找到打开文件的路径及名称 Xiaotian Feng
2009-11-20 9:55 ` Helight.Xu [this message]
2009-11-22 16:37 ` 如何通过fd找到打开文件的路径及名称 Américo Wang
2009-11-23 1:02 ` 如何通过fd找到打开文件的路径及名称 Helight.Xu
2009-11-23 14:41 ` 如何通过fd找到打开文件的路径及名称 Américo Wang
[not found] ` <alpine.LRH.2.00.0911231605340.3659@twin.jikos.cz>
2009-11-23 15:31 ` 如何通过fd找到打开文件的路径及名称 Américo Wang
2009-11-24 12:03 ` non-english on list (was Re: ????????????fd????????????????????????????????????) Pavel Machek
2009-11-24 14:10 ` David Newall
2009-11-24 14:58 ` non-english on list Américo Wang
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=4B06677B.9050101@gmail.com \
--to=helight.xu@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xtfeng@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.