Can anyone tell me how /bin/pwd works? I thought it was a trivial program until I tried to write my own without getcwd(3). getcwd is not a system call, so it must be possible. The way I think it works is quite complicated, so I thought there would be an easier way. David Hemmings appeared by permission of the National Forestry Commission.