[PATCH] [NtDll]: multiprocess tracing

Eric Pouech eric.pouech at wanadoo.fr
Tue May 16 14:20:05 CDT 2006


- force fd #2 to be always used in O_APPEND mode (workaround
  for Linux 2.6 bug in parallel calls to write())

This bugs mainly affects Linux 2.6 boxes in multi processor
set (or using hyperthreading).
Another workaround can be done directly in the redirection operation
from command line (something like "wine foo.exe >> err 2>&1")
but I was tired of it.
Not sure we want to include this patch anyway.

A+
---

 dlls/ntdll/loader.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 5f21e43..7aa2081 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2340,6 +2340,13 @@ void __wine_process_init(void)
     FILE_umask = umask(0777);
     umask( FILE_umask );
 
+    /* work around a linux 2.6 bug on parallel write to files */
+    {
+        int fl = fcntl(2, F_GETFL, 0);
+        fl |= O_APPEND;
+        fcntl(2, F_SETFL, fl);
+    }
+
     /* setup the load callback and create ntdll modref */
     wine_dll_set_callback( load_builtin_callback );
 




More information about the wine-patches mailing list