question about inconsistent inode values for symbolic links to directories

julian_homer@hotmail.com julian_homer@hotmail.com
Sat May 13 18:05:00 GMT 2006


Hi,

I am getting some strange inode values for some symbolic links to
directories from a C program I am writing to traverse directories.

My understanding of the inode values of symbolic links and C functions is a
follows:

1. executing C function "stat" on symbolic link should return the inode
value for whatever the link points to.

2. executing C function "lstat" on symbolic link should return the inode
value of the actual symbolic link.

3. executing C function "readlink" on a symbolic link and the executing a
"stat" on the output of the readlink should produce and identical inode
value to a executing a "stat" on the symbolic link.


The issue I am encountering is that the inode values from a "stat" of the
symbolic link don't match the inode values of a "stat" of the output from a
"readlink" of the symbolic value.

I have been able to repeat this using cygwin on a different machine. I have
also executed the code on a solaris 8 system but didn't encounter any
problems.

Bellow is a listing that shows and example of the problem

"path" "readlink" "inode stat path" "inode lstat path" "inode stat readlink"

/link_test/test1/c/c /link_test/test1 180134 589824 180126
/link_test/test1/c /tmp 156721 6815744 19870

I would be grateful if anyone can shed any light on this. Expect it is me
being an idiot somewhere!

Cheers

Jools
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 31353 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060513/987c73c5/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list