From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Hudec Subject: Re: kernel space realpath() Date: Mon, 24 Mar 2003 07:34:37 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030324063437.GD8167@vagabond> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: To: "Ramy M. Hassan" Content-Disposition: inline In-Reply-To: List-Id: linux-fsdevel.vger.kernel.org On Sun, Mar 23, 2003 at 07:49:18PM +0200, Ramy M. Hassan wrote: > Hi, > I am new to kernel development. I am developing now a kernel module to > create log of all file operations under a certain specified directory. I > intercept the system calls that may do modifications to this directory > contents and create the logfile. My problem is that a system call like > sys_unlink takes a path that could be relative, and could contain ".." or > ".". It might also contain components that are symlinks to other > directories. So I want to get the real path of that file given its relative > path name. > Is there anyway to do that ? You should take a look at some syscall, that returns path. Like sys_getcwd. It call d_path (resp. __d_path, because it already has all the locks). ------------------------------------------------------------------------------- Jan 'Bulb' Hudec