Patchwork linux-user F_DUPFD_CLOEXEC fix

login
register
mail settings
Submitter Vince Weaver
Date Sept. 9, 2009, 4:06 p.m.
Message ID <20090909120328.R4195@stanley.csl.cornell.edu>
Download mbox | patch
Permalink /patch/33213/
State Superseded
Headers show

Comments

Vince Weaver - Sept. 9, 2009, 4:06 p.m.
Hello

on older machines, the F_DUPFD_CLOEXEC define is not available.  So 
linux-user targets fail to compile.

This fix simply disables the feature if it's not available.

Vince

Signed-off-by: Vince Weaver <vince@csl.cornell.edu>
malc - Sept. 9, 2009, 6:16 p.m.
On Wed, 9 Sep 2009, Vince Weaver wrote:

> Hello
> 
> on older machines, the F_DUPFD_CLOEXEC define is not available.  So 
> linux-user targets fail to compile.
> 
> This fix simply disables the feature if it's not available.

Seconded.

> 
> Vince
> 
> Signed-off-by: Vince Weaver <vince@csl.cornell.edu>
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 25b95ea..6fdb9f1 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -3685,8 +3685,10 @@ static int target_to_host_fcntl_cmd(int cmd)
>              return F_SETLEASE;
>          case TARGET_F_GETLEASE:
>              return F_GETLEASE;
> +#ifdef F_DUPFD_CLOEXEC       
>          case TARGET_F_DUPFD_CLOEXEC:
>              return F_DUPFD_CLOEXEC;
> +#endif       
>          case TARGET_F_NOTIFY:
>              return F_NOTIFY;
>  	default:
> 
>

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 25b95ea..6fdb9f1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3685,8 +3685,10 @@  static int target_to_host_fcntl_cmd(int cmd)
             return F_SETLEASE;
         case TARGET_F_GETLEASE:
             return F_GETLEASE;
+#ifdef F_DUPFD_CLOEXEC       
         case TARGET_F_DUPFD_CLOEXEC:
             return F_DUPFD_CLOEXEC;
+#endif       
         case TARGET_F_NOTIFY:
             return F_NOTIFY;
 	default: