bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getcwd() returns with stale errno value upon error


From: Phi Debian
Subject: Re: getcwd() returns with stale errno value upon error
Date: Thu, 26 Jun 2025 08:45:38 +0200

In the given reproducer, I am not sure btrfs is relevant here on my good'ol
ext4 I got.

$ mount | grep '/d2 ' | sed 's/(.*//'
/dev/sda1 on /d2 type ext4

$ cd /d2 ; mkdir -p a/b/c ; cd a/b/c ; rmdir /d2/a/b/c

$ bash -c 'pwd'
shell-init: error retrieving current directory: getcwd: cannot access
parent directories: No such file or directory
pwd: error retrieving current directory: getcwd: cannot access parent
directories: No such file or directory

$ ksh -c 'pwd'
ksh: pwd: cannot determine present working directory [No such file or
directory]

$ zsh -c 'pwd'
.

That's true that the bash shell-init: could be omitted and defered until
one ask for pwd explicitly.

I don't see any *ino* jazz here, but the classic, my current dir has been
removed under my feet.

I may have mis-read the *ino* part though.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]