PATCH: set_thread_buffer fixed

Marcus Meissner marcus at jet.franken.de
Sat Jun 2 12:19:58 CDT 2001


> By this I understood to rip #define _FILE_OFFSET_BITS 64 out of config.h
> (and acconfig.h just to be sure) and rerun make.  It recompiles nearly
> everything, of course, and makes a wine that will run my app again, so I
> guess it is the same problem.

I have debugged the problem for some hours.

One problem I noticed is that the prototype for mmap64 in the glibc 2.1.1
headers is wrong (uses __off_t instead of __off64_t).

Also the glibc mmap64 implementation is relying very much on the kernel
it was compiled on. So it might break if it was compiled on a different
kernel.

I have now changed config.h to only enable 64bit support for glibc 2.2
or better.

Tested with using a wineserver compiled on glibc 2.1.1/2.2.14 running
on glibc 2.2.1/2.4.latest.

I have to include <features.h> in config.h now, so I needed to move
the _GNU_SOURCE define in pthread.c

Ciao, Marcus

Changelog:
	Enable 64bit file operations on Linux only for glibc 2.2 or better,
	since mmap64 is broken on glibc 2.1.

Index: include/acconfig.h
===================================================================
RCS file: /home/wine/wine/include/acconfig.h,v
retrieving revision 1.40
diff -u -r1.40 acconfig.h
--- include/acconfig.h	2001/05/29 20:55:22	1.40
+++ include/acconfig.h	2001/06/02 18:04:45
@@ -3,8 +3,16 @@
  * defined in the 'configure' script.
  */
 
-/* This is for glibc on Linux, it will turn on 64 bit file support at compile time */
-#define _FILE_OFFSET_BITS 64
+#include <features.h>
+/* This is for glibc on Linux, it will turn on 64 bit file support at
+ * compile time
+ * Since glibc 2.1.x has various degrees of broken mmap64 prototypes,
+ * we do not use this on glibc 2.1.x systems.
+ */
+#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ > 1)
+# define _FILE_OFFSET_BITS 64
+#endif
+
 @TOP@
 
 /* Define if .type asm directive must be inside a .def directive */
Index: scheduler/pthread.c
===================================================================
RCS file: /home/wine/wine/scheduler/pthread.c,v
retrieving revision 1.13
diff -u -r1.13 pthread.c
--- scheduler/pthread.c	2001/03/21 20:30:46	1.13
+++ scheduler/pthread.c	2001/06/02 18:04:46
@@ -7,9 +7,10 @@
  * Copyright 1999 Ove Kåven
  */
 
-#include "config.h"
 #define _GNU_SOURCE /* we may need to override some GNU extensions */
 
+#include "config.h"
+
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>




More information about the wine-patches mailing list