Set the Linux ABI personality, second try

Mike Hearn mh at codeweavers.com
Fri Dec 31 10:38:25 CST 2004


This time it works!

Mike Hearn <mh at codeweavers.com>
Set the Linux ABI personality to get a legacy address space layout


-------------- next part --------------
--- libs/wine/config.c  (revision 14)
+++ libs/wine/config.c  (local)
@@ -35,6 +35,10 @@
 #endif
 #include "wine/library.h"
 
+#ifdef HAVE_SYSCALL_H
+#include <syscall.h>
+#endif
+
 static const char server_config_dir[] = "/.wine";        /* config dir relative to $HOME */
 static const char server_root_prefix[] = "/tmp/.wine-";  /* prefix for server root dir */
 static const char server_dir_prefix[] = "/server-";      /* prefix for server dir */
@@ -289,8 +293,13 @@ static void preloader_exec( char **argv,
         new_argv = xmalloc( (last_arg - argv + 2) * sizeof(*argv) );
         memcpy( new_argv + 1, argv, (last_arg - argv + 1) * sizeof(*argv) );
         new_argv[0] = full_name;
+
+        /* set the abi personality */
+        syscall(136, 0x8 /* PER_LINUX32 */ | 0x0200000 /* ADDR_COMPAT_LAYOUT */);
+        
         if (envp) execve( full_name, new_argv, envp );
         else execv( full_name, new_argv );
+        
         free( new_argv );
         free( full_name );
         return;


More information about the wine-patches mailing list