Page 1 of 1

unistd.h readlink prototype

Posted: Sun Apr 12, 2009 11:37 pm
by pelago
I think the function prototype for readlink in unistd.h (specifically, devkitpro/devkitPPC/powerpc-gekko/include/sys/unistd.h) is out-of-date. It is currently:

Code: Select all

int     _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
but I think it should be:

Code: Select all

int     _EXFUN(readlink, (const char *__path, char *__buf, size_t __buflen));
I found this when trying to compile libiconv (http://www.gnu.org/software/libiconv/) which contains a wrapper around unistd.h which has size_t instead of int, and so compilation causes an "error: conflicting types for 'readlink'".

Changing either the source of libiconv or changing devkitpro/devkitPPC/powerpc-gekko/include/sys/unistd.h to match the other will work, but googling around it seems that size_t is more correct so the devkitPPC code is the one that should be changed.

Am I right in thinking this? I can post it as an issue on the sourceforge site if so.

Re: unistd.h readlink prototype

Posted: Mon Apr 13, 2009 10:46 pm
by pelago
Researching further I see that this is because devkitPPC release 16 is based on newlib 1.16, and this problem isn't fixed until newlib 1.17, so this isn't really a devkitPPC-specific problem.