<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000080 face=宋体 size=2>Anyone who can help me to explain these
problems in getcwd().</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=宋体 size=2>
/*<BR> * If it's a mount point, have to stat
each element because<BR> * the inode number
in the directory is for the entry in the<BR>
* parent directory, not the inode number of the mounted
file.<BR> */</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=宋体 size=2> save_errno = 0;<BR> if
(s.st_dev == dev)<FONT color=#ff0000>// When use this, it's not
work. </FONT><BR> {<BR> for
(;;)<BR> {<BR> if
(!(dp = _readdir (dir)))<BR>
goto notfound;<BR> if (<FONT
color=#ff0000>dp->d_ino </FONT>== ino) <FONT color=#ff0000>// <FONT
face=宋体 size=2>dp->d_ino is always be 1. It has been set in imfs_dir_read
(imfs_directory.c).</FONT><BR></FONT><FONT color=#ff0000>
</FONT> break;<BR>
}<BR> }<BR> else <FONT color=#ff0000>// This is
work.</FONT><BR> for (;;)<BR> {<BR> if
(!(dp = _readdir (dir)))<BR> goto
notfound;<BR> if (ISDOT
(dp))<BR>
continue;<BR> bcopy (dp->d_name, bup, strlen
(dp->d_name) + 1);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=宋体 size=2> /* Save the
first error for later. */<BR> if (stat (up,
&s))<BR> {<BR>
if (!save_errno)<BR>
save_errno = errno;<BR>
errno = 0;<BR>
continue;<BR>
}<BR> if (s.st_dev == dev && s.st_ino ==
ino)<BR> break;<BR>
}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=宋体 size=2>Thanks,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#000080 face=宋体 size=2>Tu Juan</FONT></DIV></BODY></HTML>