<<< Date Index >>>     <<< Thread Index >>>

Re: 1.5.8 build failure on Solaris 8



Oswald Buddenhagen writes:
> but not that the right function will be called. what was the problem
> we started from? sizeof(off_t) != sizeof(int) (e.g., #define
> _FILE_OFFSET_BITS 64  on x86) by any chance? see, #define lseek is NOT
> lseek() in this case.

Ah, right, I'm with you now.  Sorry about that.

Well, two things.  First, this wasn't directly the problem with the
build -- that was quite specifically that open() was a function-like
macro, and also being used as the name of a function pointer.

Secondly, your proposed solution

  #include <unistd.h>
  #define posix_lseek(a,b,c) lseek(a,b,c)
  #ifdef lseek
  # undef lseek
  #endif

doesn't actually help with the problem you're talking about.  If, having
done that, you then call

  posix_lseek(fd, 0, SEEK_SET)

that expands into

  lseek(fd, 0, SEEK_SET)

which doesn't expand into anything else, because lseek() is no longer a
macro.  (Well, SEEK_SET expands into something -- probably 0 -- but that
doesn't matter here.)  Thus your posix_lseek() macro is equivalent to
lseek(), not to lseek64() (assuming the implementation's lseek() macro
is equivalent to lseek64()).

-- 
Aaron Crane