From ebc996f3b13004e7272c462254522ba0102f09fe Mon Sep 17 00:00:00 2001 From: Riku Voipio Date: Tue, 21 Apr 2009 15:01:51 +0300 Subject: linux-user: fix utimensat The glibc function for utimensat glibc returns -EINVAL when the path is null which is a different behaviour with the syscall. path can be null because internally the glibc is using utimensat with path null when implmenting futimens. If path is null, call futimes instead. don't try to copy timespec from user if is NULL. Add configure check for older systems Signed-off-by: Riku Voipio --- configure | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 85bc598df2..d3c91408cb 100755 --- a/configure +++ b/configure @@ -1285,6 +1285,25 @@ EOF fi fi +# check if utimensat and futimens are supported +utimens=no +cat > $TMPC << EOF +#define _ATFILE_SOURCE +#define _GNU_SOURCE +#include +#include + +int main(void) +{ + utimensat(AT_FDCWD, "foo", NULL, 0); + futimens(0, NULL); + return 0; +} +EOF +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + utimens=yes +fi + # Check if tools are available to build documentation. if test "$build_docs" = "yes" -a \( ! -x "`which texi2html 2>/dev/null`" -o ! -x "`which pod2man 2>/dev/null`" \) ; then build_docs="no" @@ -1682,6 +1701,9 @@ fi if test "$atfile" = "yes" ; then echo "#define CONFIG_ATFILE 1" >> $config_h fi +if test "$utimens" = "yes" ; then + echo "#define CONFIG_UTIMENSAT 1" >> $config_h +fi if test "$inotify" = "yes" ; then echo "#define CONFIG_INOTIFY 1" >> $config_h fi -- cgit v1.2.3