lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Nov 2009 00:37:00 +0800
From:	Américo Wang <xiyou.wangcong@...il.com>
To:	"Helight.Xu" <helight.xu@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: 如何通过fd找到打开文件的路径及名称

On Fri, Nov 20, 2009 at 02:33:48PM +0800, Helight.Xu wrote:
> 在用户程序中打开文件进行编辑,那在内核中如何能通过open后的fd
> 来找到相应打开文件的路径及其名字呢?
>

问题是你为什么要在内核中做呢?在用户空间完全可以完成:

 % readlink /proc/<PID>/fd/X


-- 
Live like a child, think like the god.
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ