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
ff152b65
Commit
ff152b65
authored
Apr 03, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added hack to patch the glibc errno_location to jump to our function,
based on a patch by Marcus Meissner.
parent
6a9cea95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
sysdeps.c
scheduler/sysdeps.c
+22
-1
No files found.
scheduler/sysdeps.c
View file @
ff152b65
...
...
@@ -411,6 +411,22 @@ int *__h_errno_location(void)
#endif
/* HAVE_NPTL */
#if defined(__linux__) && defined(__i386__)
static
inline
void
writejump
(
const
char
*
symbol
,
void
*
dest
)
{
unsigned
char
*
addr
=
wine_dlsym
(
RTLD_NEXT
,
symbol
,
NULL
,
0
);
if
(
!
addr
)
return
;
/* write a relative jump at the function address */
mprotect
((
void
*
)((
unsigned
int
)
addr
&
~
(
getpagesize
()
-
1
)),
5
,
PROT_READ
|
PROT_EXEC
|
PROT_WRITE
);
addr
[
0
]
=
0xe9
;
*
(
int
*
)(
addr
+
1
)
=
(
unsigned
char
*
)
dest
-
(
addr
+
5
);
mprotect
((
void
*
)((
unsigned
int
)
addr
&
~
(
getpagesize
()
-
1
)),
5
,
PROT_READ
|
PROT_EXEC
);
}
#endif
/***********************************************************************
* SYSDEPS_InitErrno
*
...
...
@@ -421,7 +437,12 @@ void SYSDEPS_InitErrno(void)
#ifndef HAVE_NPTL
errno_location_ptr
=
thread_errno_location
;
h_errno_location_ptr
=
thread_h_errno_location
;
#endif
# if defined(__linux__) && defined(__i386__)
writejump
(
"__errno_location"
,
thread_errno_location
);
writejump
(
"__h_errno_location"
,
thread_h_errno_location
);
# endif
#endif
/* HAVE_NPTL */
}
...
...
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