Subject: Re: bin/560: ls -i returns incorrect inodes on symlinks and root dirs
To: Ken Hornstein <kenh@entropic.com>
From: I can teach you how to fish... <greywolf@autodesk.com>
List: netbsd-bugs
Date: 11/08/1994 13:11:40
"ls -i" may do a stat if you hand it an individual file, as in
"ls -id /usr", or "ls -i filename".  But if you do "ls -i dir" it
uses the inodes in the directory itself.

(Hint:  Try doing "trace ls -i /" and see what you find:
 You will find one lstat call on "/", one fstat call on the fd
 associated with the directory "/", and the rest will be getdents(2)
 calls -- which return struct dirents, which contain d_fileno which
 is the inode number in the directory.  Of *course* if you do "ls -i
 filename", it will use the inum in the stat(2) call.)



--
 _______Wizardry is dead._____ _____WHO: Greywolf (my nameplate even says so)
/ ___\ _ \ __\ V / \  / /__ \| | __/WHAT: UNIX System Mangler...er, Admin
\ \| |   < _| ` ' \ '` / \/ /|_| _/ WHERE: Autodesk, Inc.  3 Harbor Dr.
 \___|_|\_\__\|_|  \/\/ \__/___/_|  Sausalito, CA 94965 (415) 332-2344 x4219
	see also: gandalf@netcom.com