From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 27 15:25:43 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 E197816A4CE for ; Sun, 27 Jun 2004 15:25:43 +0000 (GMT) Received: from cannabis.dataforce.net (cannabis.dataforce.net [195.42.160.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id E425743D39 for ; Sun, 27 Jun 2004 15:25:42 +0000 (GMT) (envelope-from ky@df.ru) Received: from proxy.rostelekom.ru (proxy.rostelekom.ru [195.42.179.169]) by cannabis.dataforce.net (8.11.6p2-DF5/8.8.8) with ESMTP id i5RFPec01433 for ; Sun, 27 Jun 2004 19:25:40 +0400 From: "Kentucky Mandeloid Mo." To: freebsd-hackers@freebsd.org Date: Sun, 27 Jun 2004 19:25:40 +0400 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200406271925.40073.ky@df.ru> Subject: kern___getcwd() returns ENOTDIR X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ky@df.ru 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 15:25:44 -0000 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?