>>>>> Cameron Schaus writes:
> Why does a call to getcwd descend the direcotries until a mount point
> is hit? I noticed this while profiling some code at work (this is
> very expensive on nfs mounted drives). Every directory that it finds,
> it runs lstat on.
> Is this done in the libc implementation of getcwd, or does the kernel
> system call do this? I am running 2.2.14 with Trond's nfsv3 patches
> with the Debian 2.1 distribution.
glibc calls the getcwd syscall if that exists and falls back reading
/proc/self/cwd and then back to lstating the directories (see
sysdeps/unix/sysv/linux/getcwd.c in the glibc sources).
-- Andreas Jaeger SuSE Labs email@example.com private firstname.lastname@example.org
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to email@example.com Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:15 EST