From fecc3363511ec92cdb862a17d1c62413cb2a04af Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 14 Dec 2007 19:46:26 +0100 Subject: [PATCH] Port to GNU/kFreeBSD - FreeBSD kernel + GNU libc, which has no openat syscall, yet does define AT_FDCWD. * lib/getcwd.c: Undef AT_FDCWD if there is no openat function. * modules/getcwd (Depends-on): Add openat. Reported by Petr Salinger. --- ChangeLog | 8 ++++++++ lib/getcwd.c | 5 +++++ modules/getcwd | 1 + 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index f9159cbd4..a8f8b4c57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-12-17 Jim Meyering + + Port to GNU/kFreeBSD - FreeBSD kernel + GNU libc, + which has no openat syscall, yet does define AT_FDCWD. + * lib/getcwd.c: Undef AT_FDCWD if there is no openat function. + * modules/getcwd (Depends-on): Add openat. + Reported by Petr Salinger. + 2007-12-17 Bruno Haible * m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): Use GL_NOCRASH to diff --git a/lib/getcwd.c b/lib/getcwd.c index b8e9989b9..98df8bf99 100644 --- a/lib/getcwd.c +++ b/lib/getcwd.c @@ -29,6 +29,11 @@ #include /* For AT_FDCWD on Solaris 9. */ +/* On a system without the openat function, undefine AT_FDCWD. */ +#if ! HAVE_OPENAT +# undef AT_FDCWD +#endif + #ifndef __set_errno # define __set_errno(val) (errno = (val)) #endif diff --git a/modules/getcwd b/modules/getcwd index 17687e7ad..46ecb03d4 100644 --- a/modules/getcwd +++ b/modules/getcwd @@ -12,6 +12,7 @@ mempcpy d-ino dirfd extensions +openat stdbool unistd malloc-posix -- 2.11.0