At least for BSD systems PATH_MAX constant is declared in <limits.h>, so it should be included to make thing compilable. Simple patch is attached.
Created attachment 1885 [details] PATH_MAX
Fixed with r15479 Volker
*** Bug 4008 has been marked as a duplicate of this bug. ***