diff options
author | Riku Voipio <riku.voipio@iki.fi> | 2009-04-21 15:01:51 +0300 |
---|---|---|
committer | Riku Voipio <riku.voipio@nokia.com> | 2009-06-16 16:56:28 +0300 |
commit | ebc996f3b13004e7272c462254522ba0102f09fe (patch) | |
tree | 52e818a802cbde12f5fbacc0d4b01b12822d8b27 /configure | |
parent | 74d753ac86c525380513dc57a2ab319606c7c07c (diff) |
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 <riku.voipio@iki.fi>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 <stddef.h> +#include <fcntl.h> + +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 |