On Tue, May 1, 2018 at 1:31 AM, Rich Felker wrote: > On Mon, Apr 30, 2018 at 03:29:39PM +1000, Patrick Oppenlander wrote: >> Actually, my biggest issue with getcwd is that it allocates a PATH_MAX >> sized buffer on the stack. That's painful on deeply embedded stuff. > > That's unrelated, and could/should be fixed by the attached patch I > think. Unfortunately that fails to build on arm with: src/unistd/getcwd.c: In function 'getcwd': src/unistd/getcwd.c:25:1: error: r7 cannot be used in asm here I was also having a go at resolving the stack & the buffer size issue and came up with the attached (untested) patch. Patrick