From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbgoV-0004HU-1m for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:22:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbgoU-0004Gx-F0 for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:22:18 -0400 Received: from [199.232.76.173] (port=50696 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbgoU-0004Gp-4l for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:22:18 -0400 Received: from [84.20.150.76] (port=34809 helo=naru.obs2.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbgoT-00032Y-GD for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:22:18 -0400 Date: Thu, 13 Aug 2009 23:22:15 +0300 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH] linux-user: dup3, fallocate syscalls Message-ID: <20090813202215.GA28649@kos.to> References: <1248965155-14108-1-git-send-email-uli@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1248965155-14108-1-git-send-email-uli@suse.de> Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ulrich Hecht Cc: qemu-devel@nongnu.org Hi, I quequed the other patches from you execpt this one - The patch didn't apply for me, and a few comments inline: On Thu, Jul 30, 2009 at 04:45:55PM +0200, Ulrich Hecht wrote: > updated fallocate check to new configure, added dup3 check as suggested > by Jan-Simon M=C3=B6ller > Signed-off-by: Ulrich Hecht > --- > configure | 36 ++++++++++++++++++++++++++++++++++++ > linux-user/syscall.c | 12 ++++++++++++ > 2 files changed, 48 insertions(+), 0 deletions(-) >=20 > diff --git a/configure b/configure > index 8160bed..2329f88 100755 > --- a/configure > +++ b/configure > @@ -1366,6 +1366,36 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null = ; then > splice=3Dyes > fi > =20 > +# check for fallocate > +fallocate=3Dno > +cat > $TMPC << EOF > +#include > + > +int main(void) > +{ > + fallocate(0, 0, 0, 0); > + return 0; > +} > +EOF > +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then There is new stanza for this in configure: if compile_prog "" "" ; then > + fallocate=3Dyes > +fi > + > +# check for dup3 > +dup3=3Dno > +cat > $TMPC << EOF > +#include > + > +int main(void) > +{ > + dup3(0, 0, 0); > + return 0; > +} > +EOF > +if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then likewise > + dup3=3Dyes > +fi > + > # Check if tools are available to build documentation. > if test "$build_docs" =3D "yes" -a \( ! -x "`which texi2html 2>/dev/nu= ll`" -o ! -x "`which pod2man 2>/dev/null`" \) ; then > build_docs=3D"no" > @@ -1639,6 +1669,12 @@ fi > if test "$splice" =3D "yes" ; then > echo "CONFIG_SPLICE=3Dy" >> $config_host_mak > fi > +if test "$fallocate" =3D "yes" ; then > + echo "CONFIG_FALLOCATE=3Dy" >> $config_host_mak > +fi > +if test "$dup3" =3D "yes" ; then > + echo "CONFIG_DUP3=3Dy" >> $config_host_mak > +fi > if test "$inotify" =3D "yes" ; then > echo "CONFIG_INOTIFY=3Dy" >> $config_host_mak > fi > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 31cf151..d105b8e 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -3681,8 +3681,10 @@ static int target_to_host_fcntl_cmd(int cmd) > return F_SETLEASE; > case TARGET_F_GETLEASE: > return F_GETLEASE; This is patching your previous patch? Generally that is frowned upon - it is tricky to find which patches need to be applied first, and it is bette= r to fix it in the original patch so the broken code is never part of the g= it history. > +#ifdef F_DUPFD_CLOEXEC > case TARGET_F_DUPFD_CLOEXEC: > return F_DUPFD_CLOEXEC; > +#endif > case TARGET_F_NOTIFY: > return F_NOTIFY; > default: > @@ -4732,6 +4734,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_= long arg1, > case TARGET_NR_dup2: > ret =3D get_errno(dup2(arg1, arg2)); > break; > +#if defined(TARGET_NR_dup3) && defined(CONFIG_DUP3) > + case TARGET_NR_dup3: > + ret =3D get_errno(dup3(arg1, arg2, arg3)); > + break; > +#endif > #ifdef TARGET_NR_getppid /* not on alpha */ > case TARGET_NR_getppid: > ret =3D get_errno(getppid()); > @@ -6976,6 +6983,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_= long arg1, > break; > #endif > #endif /* CONFIG_SPLICE */ > +#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate) > + case TARGET_NR_fallocate: > + ret =3D get_errno(fallocate(arg1, arg2, arg3, arg4)); > + break; > +#endif This is colliding with other patches in linux-user-for-upstream. It is a = good example why it is better to separete patches for seperate features - In t= hat case it would have been quite easy for me to fix it in by hand. > default: > unimplemented: > gemu_log("qemu: Unsupported syscall: %d\n", num); Cheers, Riku