[darwinbuild] About the readlink redefinition in darwintrace.c
So, I just decided to give a real try to the DarwinBuild system. This is under Mac OS X 10.3.9, with the darwinbuild-0.7.2.tar.gz release. While installing the tools, I got an error message about an incompatible redefinition of "readlink" in darwintrace: [...] *** Making all in darwintrace *** cc -o darwintrace.dylib \ -W -Wall -pedantic -std=c99 \ -flat_namespace \ -fno-common \ -nostdlib \ -undefined suppress \ -dynamiclib \ darwintrace.c darwintrace.c:219: error: conflicting types for `readlink' /usr/include/unistd.h:240: error: previous declaration of `readlink' make[1]: *** [darwintrace.dylib] Error 1 make: *** [all] Error 2 So, my question is: shouldn't line 219 of darwintrace.c read ssize_t readlink(const char * path, char * buf, ssize_t bufsiz) { instead of ssize_t readlink(const char * path, char * buf, size_t bufsiz) { Axel
On Mar 15, 2006, at 6:03 AM, Axel Luttgens wrote:
So, my question is: shouldn't line 219 of darwintrace.c read
ssize_t readlink(const char * path, char * buf, ssize_t bufsiz) {
instead of
ssize_t readlink(const char * path, char * buf, size_t bufsiz) {
The real issue is that the declaration of readlink in unistd.h changed in tiger. The darwintrace.c code is correct for Tiger, but incorrect for earlier releases. We'll need to support both versions, conditionalized by one of the macros in AvailabilityMacros.h. - Kevin
On 15/03/06 19:58, Kevin Van Vechten wrote:
On Mar 15, 2006, at 6:03 AM, Axel Luttgens wrote:
So, my question is: shouldn't line 219 of darwintrace.c read
ssize_t readlink(const char * path, char * buf, ssize_t bufsiz) {
instead of
ssize_t readlink(const char * path, char * buf, size_t bufsiz) {
The real issue is that the declaration of readlink in unistd.h changed in tiger. The darwintrace.c code is correct for Tiger, but incorrect for earlier releases.
Oops! Sorry, I searched the list for possible items related to the above, but didn't think to have a look at Tiger's headers (which I nevertheless have here, on my disk; too lazy?). Now, that change is rather unsuspected; does is mean that very, very long pathnames are going to be supported?
We'll need to support both versions, conditionalized by one of the macros in AvailabilityMacros.h.
Thanks a lot for your reply, Axel
Not really. In practice, paths and symlink targets are only supported up to MAXPATHLEN (1024) bytes, which is well short of 2^32-1 (or 2^64-1 for ppc64) Shantonu On Mar 20, 2006, at 1:14 AM, Axel Luttgens wrote:
On 15/03/06 19:58, Kevin Van Vechten wrote:
On Mar 15, 2006, at 6:03 AM, Axel Luttgens wrote:
So, my question is: shouldn't line 219 of darwintrace.c read
ssize_t readlink(const char * path, char * buf, ssize_t bufsiz) {
instead of
ssize_t readlink(const char * path, char * buf, size_t bufsiz) {
The real issue is that the declaration of readlink in unistd.h changed in tiger. The darwintrace.c code is correct for Tiger, but incorrect for earlier releases.
Oops! Sorry, I searched the list for possible items related to the above, but didn't think to have a look at Tiger's headers (which I nevertheless have here, on my disk; too lazy?). Now, that change is rather unsuspected; does is mean that very, very long pathnames are going to be supported?
We'll need to support both versions, conditionalized by one of the macros in AvailabilityMacros.h.
Thanks a lot for your reply, Axel _______________________________________________ darwinbuild mailing list darwinbuild@opendarwin.org http://www.opendarwin.org/mailman/listinfo/darwinbuild
participants (3)
-
Axel Luttgens
-
Kevin Van Vechten
-
Shantonu Sen