Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
cef0fde5
Commit
cef0fde5
authored
Jan 08, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Use sysconf() instead of getpagesize().
parent
2b97a064
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
loader.c
libs/wine/loader.c
+1
-1
mmap.c
libs/wine/mmap.c
+7
-7
No files found.
libs/wine/loader.c
View file @
cef0fde5
...
...
@@ -380,7 +380,7 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
IMAGE_SECTION_HEADER
*
sec
;
BYTE
*
addr
;
DWORD
code_start
,
data_start
,
data_end
;
const
size_t
page_size
=
getpagesize
(
);
const
size_t
page_size
=
sysconf
(
_SC_PAGESIZE
);
const
size_t
page_mask
=
page_size
-
1
;
int
delta
,
nb_sections
=
2
;
/* code + data */
unsigned
int
i
;
...
...
libs/wine/mmap.c
View file @
cef0fde5
...
...
@@ -104,7 +104,7 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags,
int
fildes
,
off_t
off
)
{
char
*
volatile
result
=
NULL
;
int
pagesize
=
getpagesize
(
);
const
size_t
pagesize
=
sysconf
(
_SC_PAGESIZE
);
pid_t
pid
,
wret
;
/* We only try to map to a fixed address if
...
...
@@ -255,7 +255,7 @@ static inline void reserve_area( void *addr, void *end )
#if (defined(__svr4__) || defined(__NetBSD__)) && !defined(MAP_TRYFIXED)
/* try_mmap_fixed is inefficient when using vfork, so we need a different algorithm here */
/* we assume no other thread is running at this point */
size_t
i
,
pagesize
=
getpagesize
(
);
size_t
i
,
pagesize
=
sysconf
(
_SC_PAGESIZE
);
char
vec
;
while
(
size
)
...
...
@@ -321,19 +321,19 @@ static inline void reserve_malloc_space( size_t size )
*/
static
inline
void
reserve_dos_area
(
void
)
{
const
size_t
page_size
=
getpagesize
()
;
const
size_t
first_page
=
0x1000
;
const
size_t
dos_area_size
=
0x110000
;
void
*
ptr
;
/* first page has to be handled specially */
ptr
=
wine_anon_mmap
(
(
void
*
)
page_size
,
dos_area_size
-
page_siz
e
,
PROT_NONE
,
MAP_NORESERVE
);
if
(
ptr
!=
(
void
*
)
page_siz
e
)
ptr
=
wine_anon_mmap
(
(
void
*
)
first_page
,
dos_area_size
-
first_pag
e
,
PROT_NONE
,
MAP_NORESERVE
);
if
(
ptr
!=
(
void
*
)
first_pag
e
)
{
if
(
ptr
!=
(
void
*
)
-
1
)
munmap
(
ptr
,
dos_area_size
-
page_siz
e
);
if
(
ptr
!=
(
void
*
)
-
1
)
munmap
(
ptr
,
dos_area_size
-
first_pag
e
);
return
;
}
/* now add first page with MAP_FIXED */
wine_anon_mmap
(
NULL
,
page_siz
e
,
PROT_NONE
,
MAP_NORESERVE
|
MAP_FIXED
);
wine_anon_mmap
(
NULL
,
first_pag
e
,
PROT_NONE
,
MAP_NORESERVE
|
MAP_FIXED
);
wine_mmap_add_reserved_area
(
NULL
,
dos_area_size
);
}
...
...
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