You could try system('readlink -f .') or, if your application is interactive, shell out with system('bash') and have a look.
In reply to Re: getcwd failed by rovf in thread getcwd failed by llancet