From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 27 18:12:19 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B99CD16A4CE for ; Sun, 27 Jun 2004 18:12:19 +0000 (GMT) Received: from VARK.homeunix.com (adsl-69-107-104-105.dsl.pltn13.pacbell.net [69.107.104.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C59143D41 for ; Sun, 27 Jun 2004 18:12:19 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i5RICKRI011096; Sun, 27 Jun 2004 11:12:20 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i5RICKK4011095; Sun, 27 Jun 2004 11:12:20 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 27 Jun 2004 11:12:20 -0700 From: David Schultz To: "Kentucky Mandeloid Mo." Message-ID: <20040627181220.GA10962@VARK.homeunix.com> Mail-Followup-To: "Kentucky Mandeloid Mo." , freebsd-hackers@FreeBSD.ORG References: <200406271925.40073.ky@df.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200406271925.40073.ky@df.ru> cc: freebsd-hackers@FreeBSD.ORG Subject: Re: kern___getcwd() returns ENOTDIR X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jun 2004 18:12:19 -0000 On Sun, Jun 27, 2004, Kentucky Mandeloid Mo. wrote: > I'm writng a smal kernel module that catches file access syscalls. > At every syscall I need a full name of file is being passed to a syscall. > I'm getting it with a path passed to syscall and if path is not starting > with / I get current working directory of process using kern___getcwd(). > In every syscall all works just fine except rmdir & unlink. > Sometimes in unlink and everytime in rmdir it returns "not a directory" error. > I know already that kern___getcwd() works through vnode cache and this method > is not a reliable way to get file names. > So is there any other way get cwd of a proccess? linux_getcwd() works in more cases than kern___getcwd(), but it has other problems.