diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-15 16:12:13 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-15 16:12:13 +0000 |
commit | 3b3f24add09f8ab720860d4840f9755c102121b5 (patch) | |
tree | 18b918f62313b2b8265b2d7c40ce520f65493f49 /configure | |
parent | be09ac4194bd0a61c0d9412c32431fbe2273cba1 (diff) |
linux-user: prefer glibc over direct syscalls
The openat/*at syscalls are incredibly common with modern coreutils,
calling them directly via syscalls breaks for example fakeroot. Use
glibc stubs whenever directly available and provide old syscall
calling for people still using older libc.
Patch originally from Mika Westerberg, Adapted to
apply to current trunk and cleaned up by Riku Voipio.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7118 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -1156,6 +1156,53 @@ EOF fi fi +# +# Check for xxxat() functions when we are building linux-user +# emulator. This is done because older glibc versions don't +# have syscall stubs for these implemented. +# +atfile=no +if [ "$linux_user" = "yes" ] ; then + cat > $TMPC << EOF +#define _ATFILE_SOURCE +#include <sys/types.h> +#include <fcntl.h> +#include <unistd.h> + +int +main(void) +{ + /* try to unlink nonexisting file */ + return (unlinkat(AT_FDCWD, "nonexistent_file", 0)); +} +EOF + if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + atfile=yes + fi +fi + +# Check for initofy functions when we are building linux-user +# emulator. This is done because older glibc versions don't +# have syscall stubs for these implemented. In that case we +# don't provide them even if kernel supports them. +# +inotify=no +if [ "$linux_user" = "yes" ] ; then + cat > $TMPC << EOF +#include <sys/inotify.h> + +int +main(void) +{ + /* try to start inotify */ + return inotify_init(void); +} +EOF + if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + inotify=yes + fi +fi + # Check if tools are available to build documentation. if [ -x "`which texi2html 2>/dev/null`" ] && \ [ -x "`which pod2man 2>/dev/null`" ]; then @@ -1544,6 +1591,12 @@ if test "$curses" = "yes" ; then echo "CONFIG_CURSES=yes" >> $config_mak echo "CURSES_LIBS=-lcurses" >> $config_mak fi +if test "$atfile" = "yes" ; then + echo "#define CONFIG_ATFILE 1" >> $config_h +fi +if test "$inotify" = "yes" ; then + echo "#define CONFIG_INOTIFY 1" >> $config_h +fi if test "$brlapi" = "yes" ; then echo "CONFIG_BRLAPI=yes" >> $config_mak echo "#define CONFIG_BRLAPI 1" >> $config_h |