[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnulib problem with getcwd when compiling octave
From: |
Paul Eggert |
Subject: |
Re: gnulib problem with getcwd when compiling octave |
Date: |
Thu, 17 Nov 2011 23:52:06 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
Thanks for the bug report. I just now pushed the following fix that's
needed to get fdopendir to work, which is one of two problems that you note:
* modules/getcwd (Depends-on): Add fdopendir.
This fixes one of the two problems reported by Kai Habel in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-11/msg00237.html>.
diff --git a/modules/getcwd b/modules/getcwd
index 3bd2ba7..3f23f63 100644
--- a/modules/getcwd
+++ b/modules/getcwd
@@ -16,6 +16,7 @@ mempcpy [test $REPLACE_GETCWD = 1]
d-ino [test $REPLACE_GETCWD = 1]
memmove [test $REPLACE_GETCWD = 1]
openat [test $REPLACE_GETCWD = 1]
+fdopendir [test $REPLACE_GETCWD = 1]
fstat [test $REPLACE_GETCWD = 1]
fstatat [test $REPLACE_GETCWD = 1]
opendir [test $REPLACE_GETCWD = 1]
The other (fstatat) problem is less obvious to me, so I have
some followup questions.
* Is some of your system compiled by g++ and other parts by gcc?
* What's the output of this shell command?
nm -o libgnu/.libs/libgnu.a | grep 'fstatat'
* And last, does the following hacky patch fix the fstatat problem?
diff --git a/lib/openat.h b/lib/openat.h
index eae86ce..37d63c1 100644
--- a/lib/openat.h
+++ b/lib/openat.h
@@ -43,6 +43,12 @@ bool openat_needs_fchdir (void);
_Noreturn void openat_restore_fail (int);
_Noreturn void openat_save_fail (int);
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define GNULIB_NAMESPACE_ GNULIB_NAMESPACE::
+#else
+# define GNULIB_NAMESPACE_ /* empty */
+#endif
+
/* Using these function names makes application code
slightly more readable than it would be with
fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW). */
@@ -52,13 +58,13 @@ _Noreturn void openat_save_fail (int);
static inline int
chownat (int fd, char const *file, uid_t owner, gid_t group)
{
- return fchownat (fd, file, owner, group, 0);
+ return GNULIB_NAMESPACE_ fchownat (fd, file, owner, group, 0);
}
static inline int
lchownat (int fd, char const *file, uid_t owner, gid_t group)
{
- return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
+ return GNULIB_NAMESPACE_ fchownat (fd, file, owner, group,
AT_SYMLINK_NOFOLLOW);
}
#endif
@@ -68,13 +74,13 @@ lchownat (int fd, char const *file, uid_t owner, gid_t
group)
static inline int
chmodat (int fd, char const *file, mode_t mode)
{
- return fchmodat (fd, file, mode, 0);
+ return GNULIB_NAMESPACE_ fchmodat (fd, file, mode, 0);
}
static inline int
lchmodat (int fd, char const *file, mode_t mode)
{
- return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
+ return GNULIB_NAMESPACE_ fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
}
#endif
@@ -84,13 +90,13 @@ lchmodat (int fd, char const *file, mode_t mode)
static inline int
statat (int fd, char const *name, struct stat *st)
{
- return fstatat (fd, name, st, 0);
+ return GNULIB_NAMESPACE_ fstatat (fd, name, st, 0);
}
static inline int
lstatat (int fd, char const *name, struct stat *st)
{
- return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
+ return GNULIB_NAMESPACE_ fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
}
#endif