On Sat, May 3, 2008 at 1:13 AM, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote: > On Fri, May 02, 2008 at 11:06:23PM -0700, H. Peter Anvin wrote: > > > > _GNU_SOURCE is defined by the application, not by the library. > > Yes, however the macro AC_GNU_SOURCE is supposed to define it > only for glibc. Having seen the actual code though it seems > that the automake documentation is misleading and the macro is > always defined regardless of the library being used. > > I'll change it to use __GLIBC__ instead. That change makes it work fine here. Thanks for looking into all of this. I forgot to hit reply to all on the last email I sent to just Herbert, so I've included that below as well. -Dan > Could you find out exactly what getcwd returned under klibc? > Or perhaps somehow _GNU_SOURCE is still being defined under > klibc? OK, here we go: #include <sys/types.h> #include <limits.h> #include <unistd.h> #include <stdio.h> main(int argc, char **argv) { char buf[PATH_MAX]; char *ptr; ptr = getcwd(buf, PATH_MAX); printf("%s", ptr); } $ klcc test.c $ ./a.out /home/dmcgee/projects/dash $ env - ./a.out /home/dmcgee/projects/dash And yes, as hpa said while I was finishing up this email, _GNU_SOURCE is still enabled during the compile even with klibc. I can see that it is defined in config.h even when running with this configure line: $ ./configure CC=klcc LD=klcc CFLAGS="-D__CTYPE_NO_INLINE" -- To unsubscribe from this list: send the line "unsubscribe dash" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html