7c872d3
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
7c872d3
index 0f2ad8c51..407af7f76 100644
7c872d3
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
7c872d3
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
7c872d3
@@ -249,6 +249,7 @@ PRE(sys_rt_sigreturn)
7c872d3
 PRE(sys_arch_prctl)
7c872d3
 {
7c872d3
    ThreadState* tst;
7c872d3
+   Bool known_option = True;
7c872d3
    PRINT( "arch_prctl ( %ld, %lx )", SARG1, ARG2 );
7c872d3
 
7c872d3
    vg_assert(VG_(is_valid_tid)(tid));
7c872d3
@@ -283,13 +284,16 @@ PRE(sys_arch_prctl)
7c872d3
       POST_MEM_WRITE(ARG2, sizeof(unsigned long));
7c872d3
    }
7c872d3
    else {
7c872d3
-      VG_(core_panic)("Unsupported arch_prctl option");
7c872d3
+      known_option = False;
7c872d3
    }
7c872d3
 
7c872d3
    /* Note; the Status writeback to guest state that happens after
7c872d3
       this wrapper returns does not change guest_FS_CONST or guest_GS_CONST;
7c872d3
       hence that direct assignment to the guest state is safe here. */
7c872d3
-   SET_STATUS_Success( 0 );
7c872d3
+   if (known_option)
7c872d3
+      SET_STATUS_Success( 0 );
7c872d3
+   else
7c872d3
+      SET_STATUS_Failure( VKI_EINVAL );
7c872d3
 }
7c872d3
 
7c872d3
 // Parts of this are amd64-specific, but the *PEEK* cases are generic.