Ticket #514: ldt_keeper_darwin.patch

File ldt_keeper_darwin.patch, 1.2 KB (added by stephane.lapie@…, 13 years ago)

This diff makes ldt_keeper's mmap() call behave properly, while keeping compatibility with other configurations.

Line 
1105c105
2< #if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
3---
4> #if (defined(__FreeBSD__) || defined(CONFIG_DARWIN)) && defined(LDT_AUTO_ALLOC)
5170c170
6< #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
7---
8> #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(CONFIG_DARWIN) || defined(__OpenBSD__) || defined(__DragonFly__)
9196,197c196,205
10<
11<     ldt_fs->fd = -1;
12---
13> #ifndef CONFIG_DARWIN
14>     ldt_fs->fd = open("/dev/zero", O_RDWR);
15>     if(ldt_fs->fd<0){
16>         perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: ");
17>       return NULL;
18>     }
19>     fs_seg=
20>     ldt_fs->fs_seg = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE,
21>                         ldt_fs->fd, 0);
22> #else
23199a208
24> #endif /* CONFIG_DARWIN */
25227c236
26< #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
27---
28> #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(CONFIG_DARWIN) || defined(__OpenBSD__) || defined(__DragonFly__)
29232c241
30< #if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
31---
32> #if (defined(__FreeBSD__) || defined(CONFIG_DARWIN)) && defined(LDT_AUTO_ALLOC)