changeset 29225:699ecd849255

Port to GNU/kFreeBSD - FreeBSD kernel + GNU libc, which has no openat syscall, yet <fcntl.h> 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.
author Jim Meyering <meyering@redhat.com>
date Fri, 14 Dec 2007 19:46:26 +0100
parents 5efaf5e75dd9
children 4e4ff272cf67
files ChangeLog lib/getcwd.c modules/getcwd
diffstat 3 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Dec 17 12:21:10 2007 +0100
+++ b/ChangeLog	Fri Dec 14 19:46:26 2007 +0100
@@ -1,3 +1,11 @@
+2007-12-17  Jim Meyering  <meyering@redhat.com>
+
+	Port to GNU/kFreeBSD - FreeBSD kernel + GNU libc,
+	which has no openat syscall, yet <fcntl.h> 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  <bruno@clisp.org>
 
 	* m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): Use GL_NOCRASH to
--- a/lib/getcwd.c	Mon Dec 17 12:21:10 2007 +0100
+++ b/lib/getcwd.c	Fri Dec 14 19:46:26 2007 +0100
@@ -29,6 +29,11 @@
 
 #include <fcntl.h> /* 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
--- a/modules/getcwd	Mon Dec 17 12:21:10 2007 +0100
+++ b/modules/getcwd	Fri Dec 14 19:46:26 2007 +0100
@@ -12,6 +12,7 @@
 d-ino
 dirfd
 extensions
+openat
 stdbool
 unistd
 malloc-posix