unistd.h readlink prototype

support for the powerpc toolchain
Post Reply
pelago
Posts: 4
Joined: Sun Apr 12, 2009 10:33 pm

unistd.h readlink prototype

Post by pelago » Sun Apr 12, 2009 11:37 pm

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.

pelago
Posts: 4
Joined: Sun Apr 12, 2009 10:33 pm

Re: unistd.h readlink prototype

Post by pelago » Mon Apr 13, 2009 10:46 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests