diff -ur was/memory/virtual.c is/memory/virtual.c --- was/memory/virtual.c Fri May 11 07:03:48 2001 +++ is/memory/virtual.c Tue Jun 12 21:33:00 2001 @@ -664,6 +664,9 @@ if (fd == -1) return wine_anon_mmap( start, size, prot, flags ); + /* Linux 2.4.x seems not to return EINVAL for non-aligned offsets */ + if(!(offset&page_mask)) + { if ((ret = mmap( start, size, prot, flags, fd, offset )) != (LPVOID)-1) return ret; @@ -681,8 +684,12 @@ #ifdef MAP_PRIVATE if (!(flags & MAP_PRIVATE)) return ret; #endif - } - + } + } else if ((ret = mmap( start, size, prot, flags, fd, offset )) != (LPVOID)-1) + { + TRACE("setoff %p %x %x %x %d %x = %p\n", start, size, prot,flags, fd, offset, ret); + munmap(ret, size); + } /* Reserve the memory with an anonymous mmap */ ret = wine_anon_mmap( start, size, PROT_READ | PROT_WRITE, flags ); if (ret == (LPVOID)-1) return ret;