Bug#1135783: (fwd) Bug#1135783: libkpathsea6: kpathsea's custom getcwd stats() all siblings of all parents
Karl Berry <[email protected]> Wed, 6 May 2026 18:56:14 -0600
| Newsgroups | gmane.linux.debian.devel.tetex |
|---|---|
| Message-ID | <202605070056.6470uECU065715__7673.9873083838$1778116525$gmane$org@freefriends.org> |
> - extern char *getcwd();
> + extern char *getcwd(char *, size_t);
Thanks Emmanuel and all. Maybe I should just remove the getcwd_forks
test altogether, if/since Olaf's fallback implementation isn't usable
on NFS. If it forks, it forks.
But for now, I opted (r78924) for the smaller change of removing the
getcwd declaration altogether, and instead assuming it's declared in
<unistd.h> (where it belongs, as far as I know). Previously the test
used #include <stdlib.h>, but I think that was just a mistake.
(If it turns out to be needed, can just re-add the #include <stdlib.h>.)
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
int fork() { exit(1); }
int vfork() { exit(1); }
char path[100];]],
[[getcwd(path,100);]])],
The problem with providing a full prototype is that then if the system
defines something different (presumably erroneously, but it happens),
the compilation will gratuitously fail. This was not a problem with the
() declaration, and was quite useful, making sources more robust across
systems and compilers.
> it is because there's a configure test that goes amiss, probably because
> of the new default C dialect with GCC 15, possibly in relation to changes
Yes, C23 broke (among many other things) the longstanding practice of
providing fallback declarations with empty parens.
Thanks,
Karl