Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4c5f9c09
Commit
4c5f9c09
authored
Jun 20, 2005
by
Wolfgang Thaller
Committed by
Alexandre Julliard
Jun 20, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement try_mmap_fixed for Darwin.
parent
84c8bf53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
mmap.c
libs/wine/mmap.c
+23
-1
No files found.
libs/wine/mmap.c
View file @
4c5f9c09
...
...
@@ -137,6 +137,28 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags,
return
result
==
addr
;
}
#elif defined(__APPLE__)
/*
* On Darwin, we can use the Mach call vm_allocate to allocate
* anonymous memory at the specified address, and then use mmap with
* MAP_FIXED to replace the mapping.
*/
static
int
try_mmap_fixed
(
void
*
addr
,
size_t
len
,
int
prot
,
int
flags
,
int
fildes
,
off_t
off
)
{
void
*
result
;
result
=
addr
;
if
(
vm_allocate
(
mach_task_self
(),
&
result
,
len
,
0
))
return
0
;
else
{
result
=
mmap
(
addr
,
len
,
prot
,
flags
|
MAP_FIXED
,
fildes
,
off
);
return
result
==
addr
;
}
}
#endif
/* (__svr4__ || __NetBSD__) && !MAP_TRYFIXED */
...
...
@@ -182,7 +204,7 @@ void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
#ifdef MAP_TRYFIXED
/* If available, this will attempt a fixed mapping in-kernel */
flags
|=
MAP_TRYFIXED
;
#elif defined(__svr4__) || defined(__NetBSD__)
#elif defined(__svr4__) || defined(__NetBSD__)
|| defined(__APPLE__)
if
(
try_mmap_fixed
(
start
,
size
,
prot
,
flags
,
fdzero
,
0
)
)
return
start
;
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment