From owner-freebsd-hackers Mon Feb 4 3:41:16 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from swan.prod.itd.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 59AC937B423 for ; Mon, 4 Feb 2002 03:41:13 -0800 (PST) Received: from pool0049.cvx22-bradley.dialup.earthlink.net ([209.179.198.49] helo=mindspring.com) by swan.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16XhUN-00057j-00; Mon, 04 Feb 2002 03:40:47 -0800 Message-ID: <3C5E733A.25EE304C@mindspring.com> Date: Mon, 04 Feb 2002 03:40:42 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: =?iso-8859-1?Q?Pawe=B3?= Jakub Dawidek Cc: freebsd-hackers@freebsd.org Subject: Re: File name. References: <20020204111015.D45984@garage.freebsd.pl> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Pawe=B3 Jakub Dawidek wrote: > Nope. We are in kernel area. > I want to control for example open() syscall: > static int my_open(register struct proc *p, register struct open_args *= ea) > { > [...] > } > Name of file to open is in ea->path, but this name can be: ./somefile > and i need a full path to it. Look at the "open" and "exec" source code. The "." is interpreted in the context of the current directory for the current process for the lookup. The answer is to know what "." means, in context. If you don't have a current process from which to get a pointer to the current directory vnode, then you will need to make one up yourself. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message