Hi Jim, Jarno Rajahalme wrote: > Here is a simple program to demonstrate two problems with current gnulib: > > file main.cc: > > // config.h defines GNULIB_NAMESPACE as gnulib > #include <config.h> > #include <string.h> > #include <unistd.h> > #include <stdio.h> > > int main() > { > char * dir = gnulib::strndup(gnulib::getcwd(NULL, 32), > gnulib::strnlen("Hello!", 5)); > int fd = gnulib::open("hopefully non-existent file", O_RDONLY); > gnulib::fprintf(stdout, "Current Working Directory truncated to 5 > characters: %s\n", dir); > gnulib::close(fd); > return 0; > } > > > Compiling this with GCC 4.4.3 on OSX 10.6.3 produces two problems: > > 1. compiling main.cc fails: > > g++-mp-4.4 -DHAVE_CONFIG_H -I. -I.. -I../lib -g -g -O2 -MT main.o -MD -MP > -MF .deps/main.Tpo -c -o main.o main.cc > In file included from main.cc:4: > ../lib/unistd.h:730: error: 'fchownat' was not declared in this scope > ../lib/unistd.h:730: error: invalid type in declaration before ';' token
I've already posted a fix for this on Monday (the same problem occurred on Solaris): <http://lists.gnu.org/archive/html/bug-gnulib/2010-04/msg00075.html> Is it ok to apply it? Bruno