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
60833da9
Commit
60833da9
authored
Aug 08, 2007
by
Tijl Coosemans
Committed by
Alexandre Julliard
Aug 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loader: Use thr_self syscall to get thread id on FreeBSD.
parent
af78fa7b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
5 deletions
+95
-5
configure
configure
+62
-0
configure.ac
configure.ac
+6
-0
config.h.in
include/config.h.in
+3
-0
pthread.c
loader/pthread.c
+10
-0
ptrace.c
server/ptrace.c
+14
-5
No files found.
configure
View file @
60833da9
...
...
@@ -7478,6 +7478,68 @@ done
for
ac_header
in
sys/thr.h
do
as_ac_Header
=
`
echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
{
echo
"
$as_me
:
$LINENO
: checking for
$ac_header
"
>
&5
echo
$ECHO_N
"checking for
$ac_header
...
$ECHO_C
"
>
&6
;
}
if
{
as_var
=
$as_ac_Header
;
eval
"test
\"\$
{
$as_var
+set}
\"
= set"
;
}
;
then
echo
$ECHO_N
"(cached)
$ECHO_C
"
>
&6
else
cat
>
conftest.
$ac_ext
<<
_ACEOF
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#if HAVE_UCONTEXT_H
#include <ucontext.h>
#endif
#include <
$ac_header
>
_ACEOF
rm
-f
conftest.
$ac_objext
if
{
(
ac_try
=
"
$ac_compile
"
case
"((
$ac_try
"
in
*
\"
*
|
*
\`
*
|
*
\\
*
)
ac_try_echo
=
\$
ac_try
;;
*
)
ac_try_echo
=
$ac_try
;;
esac
eval
"echo
\"\$
as_me:
$LINENO
:
$ac_try_echo
\"
"
)
>
&5
(
eval
"
$ac_compile
"
)
2>conftest.er1
ac_status
=
$?
grep
-v
'^ *+'
conftest.er1
>
conftest.err
rm
-f
conftest.er1
cat
conftest.err
>
&5
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
test
-z
"
$ac_c_werror_flag
"
||
test
!
-s
conftest.err
}
&&
test
-s
conftest.
$ac_objext
;
then
eval
"
$as_ac_Header
=yes"
else
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
eval
"
$as_ac_Header
=no"
fi
rm
-f
core conftest.err conftest.
$ac_objext
conftest.
$ac_ext
fi
ac_res
=
`
eval echo
'${'
$as_ac_Header
'}'
`
{
echo
"
$as_me
:
$LINENO
: result:
$ac_res
"
>
&5
echo
"
${
ECHO_T
}
$ac_res
"
>
&6
;
}
if
test
`
eval echo
'${'
$as_ac_Header
'}'
`
=
yes
;
then
cat
>>
confdefs.h
<<
_ACEOF
#define `echo "HAVE_
$ac_header
" |
$as_tr_cpp
` 1
_ACEOF
fi
done
for
ac_header
in
pthread_np.h
do
as_ac_Header
=
`
echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
...
...
configure.ac
View file @
60833da9
...
...
@@ -325,6 +325,12 @@ AC_CHECK_HEADERS([resolv.h],,,
AC_CHECK_HEADERS(ucontext.h,,,[#include <signal.h>])
AC_CHECK_HEADERS([sys/thr.h],,,
[#include <sys/types.h>
#if HAVE_UCONTEXT_H
#include <ucontext.h>
#endif])
AC_CHECK_HEADERS([pthread_np.h],,,
[#ifdef HAVE_PTHREAD_H
#include <pthread.h>
...
...
include/config.h.in
View file @
60833da9
...
...
@@ -813,6 +813,9 @@
/* Define to 1 if you have the <sys/sysctl.h> header file. */
#undef HAVE_SYS_SYSCTL_H
/* Define to 1 if you have the <sys/thr.h> header file. */
#undef HAVE_SYS_THR_H
/* Define to 1 if you have the <sys/times.h> header file. */
#undef HAVE_SYS_TIMES_H
...
...
loader/pthread.c
View file @
60833da9
...
...
@@ -37,6 +37,10 @@
#ifdef HAVE_MACH_MACH_H
#include <mach/mach.h>
#endif
#ifdef HAVE_SYS_THR_H
#include <sys/ucontext.h>
#include <sys/thr.h>
#endif
#include "wine/library.h"
#include "wine/pthread.h"
...
...
@@ -149,6 +153,12 @@ static void init_current_teb( struct wine_pthread_thread_info *info )
info
->
tid
=
pthread_self
();
/* this should return the lwp id on solaris */
#elif defined(__APPLE__)
info
->
tid
=
mach_thread_self
();
#elif defined(__FreeBSD__)
{
long
lwpid
;
thr_self
(
&
lwpid
);
info
->
tid
=
(
int
)
lwpid
;
}
#else
info
->
tid
=
gettid
();
#endif
...
...
server/ptrace.c
View file @
60833da9
...
...
@@ -156,9 +156,18 @@ void sigchld_callback(void)
}
}
/* return the Unix pid to use in ptrace calls for a given
thread
*/
/* return the Unix pid to use in ptrace calls for a given
process
*/
static
int
get_ptrace_pid
(
struct
thread
*
thread
)
{
#ifdef linux
/* linux always uses thread id */
if
(
thread
->
unix_tid
!=
-
1
)
return
thread
->
unix_tid
;
#endif
return
thread
->
unix_pid
;
}
/* return the Unix tid to use in ptrace calls for a given thread */
static
int
get_ptrace_tid
(
struct
thread
*
thread
)
{
if
(
thread
->
unix_tid
!=
-
1
)
return
thread
->
unix_tid
;
return
thread
->
unix_pid
;
}
...
...
@@ -501,7 +510,7 @@ void get_selector_entry( struct thread *thread, int entry, unsigned int *base,
/* retrieve the thread x86 registers */
void
get_thread_context
(
struct
thread
*
thread
,
CONTEXT
*
context
,
unsigned
int
flags
)
{
int
i
,
pid
=
get_ptrace_
p
id
(
thread
);
int
i
,
pid
=
get_ptrace_
t
id
(
thread
);
long
data
[
8
];
/* all other regs are handled on the client side */
...
...
@@ -534,7 +543,7 @@ done:
/* set the thread x86 registers */
void
set_thread_context
(
struct
thread
*
thread
,
const
CONTEXT
*
context
,
unsigned
int
flags
)
{
int
pid
=
get_ptrace_
p
id
(
thread
);
int
pid
=
get_ptrace_
t
id
(
thread
);
/* all other regs are handled on the client side */
assert
(
(
flags
|
CONTEXT_i386
)
==
CONTEXT_DEBUG_REGISTERS
);
...
...
@@ -568,7 +577,7 @@ void set_thread_context( struct thread *thread, const CONTEXT *context, unsigned
/* retrieve the thread x86 registers */
void
get_thread_context
(
struct
thread
*
thread
,
CONTEXT
*
context
,
unsigned
int
flags
)
{
int
pid
=
get_ptrace_
p
id
(
thread
);
int
pid
=
get_ptrace_
t
id
(
thread
);
struct
dbreg
dbregs
;
/* all other regs are handled on the client side */
...
...
@@ -603,7 +612,7 @@ void get_thread_context( struct thread *thread, CONTEXT *context, unsigned int f
/* set the thread x86 registers */
void
set_thread_context
(
struct
thread
*
thread
,
const
CONTEXT
*
context
,
unsigned
int
flags
)
{
int
pid
=
get_ptrace_
p
id
(
thread
);
int
pid
=
get_ptrace_
t
id
(
thread
);
struct
dbreg
dbregs
;
/* all other regs are handled on the client side */
...
...
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