[Solved] In what circumstances does getcwd() return NULL?

Its documentation states: ERRORS The getcwd() function shall fail if: [EINVAL] The size argument is 0. [ERANGE] The size argument is greater than 0, but is smaller than the length of the pathname +1. The getcwd() function may fail if: [EACCES] Read or search permission was denied for a component of the pathname. [ENOMEM] Insufficient … Read more