What is the root inode number in BSD 4.1 and 4.2?

Joe Steffen steffen at ihu1h.UUCP
Sat Aug 4 07:11:26 AEST 1984


In System V you can test to see if the current directory is root by 

	if (stat(".", &status) == 0 && status.st_ino == ROOTINO)
	
where ROOTINO defined in sys/params.h as 2.  This header file in BSD 4.2
does not have ROOTINO.  Is 2 the correct value in BSD, is it something
else, or do I have to stat("/", ...) to get the value?  I want to avoid the
latter if possible.
-- 


#	Joe Steffen, AT&T Bell Labs, Naperville, IL, (312) 979-5381



More information about the Comp.unix.wizards mailing list