Merge from coreutils for getcwd and HP-UX 11.