From owner-freebsd-hackers Tue Nov 4 10:58:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA29105 for hackers-outgoing; Tue, 4 Nov 1997 10:58:02 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from relay.hq.tis.com (firewall-user@relay.hq.tis.com [192.94.214.100]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA29094 for ; Tue, 4 Nov 1997 10:57:57 -0800 (PST) (envelope-from cvance@tis.com) Received: by relay.hq.tis.com; id OAA08997; Tue, 4 Nov 1997 14:03:10 -0500 (EST) Received: from clipper.hq.tis.com(10.33.1.2) by relay.hq.tis.com via smap (4.0) id xma008995; Tue, 4 Nov 97 14:03:07 -0500 Received: from tis.com (skippy.hq.tis.com [10.33.112.187]) by clipper.hq.tis.com (8.7.5/8.7.3) with ESMTP id NAA26688; Tue, 4 Nov 1997 13:56:59 -0500 (EST) Message-Id: <199711041856.NAA26688@clipper.hq.tis.com> To: freebsd-hackers@freebsd.org cc: cvance@tis.com Subject: absolute pathname in kernel Date: Tue, 04 Nov 1997 13:57:01 -0500 From: Chris Vance Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Is there any easy way to obtain an absolute pathname from within the kernel? I would like to calculate the absolute pathname during the execve system call. For the most part, shells and programs use a full pathname, but this doesn't necessarily have to be the case. There doesn't seem to be any simple way to get this information. Assuming no simple way exists, what is the next best solution. Just start from the vnode of the current directory and keep going up one until the root is reached? In doing this, how would a pathname components be extracted? Would I need to open and read the parent directory until a match on the current directory is found? thanks, chris.