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
a563f584
Commit
a563f584
authored
Nov 07, 2020
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Nov 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement get_thread_times() on FreeBSD.
Signed-off-by:
Damjan Jovanovic
<
damjan.jov@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54f04370
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
6 deletions
+50
-6
Makefile.in
dlls/ntdll/Makefile.in
+1
-1
thread.c
dlls/ntdll/unix/thread.c
+49
-5
No files found.
dlls/ntdll/Makefile.in
View file @
a563f584
...
...
@@ -3,7 +3,7 @@ MODULE = ntdll.dll
IMPORTLIB
=
ntdll
IMPORTS
=
winecrt0
EXTRAINCL
=
$(UNWIND_CFLAGS)
EXTRALIBS
=
$(IOKIT_LIBS)
$(COREFOUNDATION_LIBS)
$(CORESERVICES_LIBS)
$(RT_LIBS)
$(PTHREAD_LIBS)
$(UNWIND_LIBS)
$(I386_LIBS)
EXTRALIBS
=
$(IOKIT_LIBS)
$(COREFOUNDATION_LIBS)
$(CORESERVICES_LIBS)
$(RT_LIBS)
$(PTHREAD_LIBS)
$(UNWIND_LIBS)
$(I386_LIBS)
$(PROCSTAT_LIBS)
EXTRADLLFLAGS
=
-mno-cygwin
-nodefaultlibs
-Wl
,--image-base,0x7bc00000
C_SRCS
=
\
...
...
dlls/ntdll/unix/thread.c
View file @
a563f584
...
...
@@ -43,6 +43,21 @@
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_QUEUE_H
#include <sys/queue.h>
#endif
#ifdef HAVE_SYS_USER_H
#include <sys/user.h>
#endif
#ifdef HAVE_LIBPROCSTAT_H
#include <libprocstat.h>
#endif
#define NONAMELESSUNION
#include "ntstatus.h"
...
...
@@ -790,9 +805,9 @@ static void wow64_context_to_server( context_t *to, const WOW64_CONTEXT *from )
#endif
/* __x86_64__ */
#ifdef linux
BOOL
get_thread_times
(
int
unix_pid
,
int
unix_tid
,
LARGE_INTEGER
*
kernel_time
,
LARGE_INTEGER
*
user_time
)
{
#ifdef linux
unsigned
long
clocks_per_sec
=
sysconf
(
_SC_CLK_TCK
);
unsigned
long
usr
,
sys
;
const
char
*
pos
;
...
...
@@ -837,15 +852,44 @@ BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LA
ERR
(
"Failed to parse %s
\n
"
,
debugstr_a
(
buf
));
return
FALSE
;
}
#elif defined(HAVE_LIBPROCSTAT)
struct
procstat
*
pstat
;
struct
kinfo_proc
*
kip
;
unsigned
int
proc_count
;
BOOL
ret
=
FALSE
;
pstat
=
procstat_open_sysctl
();
if
(
!
pstat
)
return
FALSE
;
if
(
unix_tid
==
-
1
)
kip
=
procstat_getprocs
(
pstat
,
KERN_PROC_PID
,
unix_pid
,
&
proc_count
);
else
kip
=
procstat_getprocs
(
pstat
,
KERN_PROC_PID
|
KERN_PROC_INC_THREAD
,
unix_pid
,
&
proc_count
);
if
(
kip
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
proc_count
;
i
++
)
{
if
(
unix_tid
==
-
1
||
kip
[
i
].
ki_tid
==
unix_tid
)
{
kernel_time
->
QuadPart
=
10000000
*
(
ULONGLONG
)
kip
[
i
].
ki_rusage
.
ru_stime
.
tv_sec
+
10
*
(
ULONGLONG
)
kip
[
i
].
ki_rusage
.
ru_stime
.
tv_usec
;
user_time
->
QuadPart
=
10000000
*
(
ULONGLONG
)
kip
[
i
].
ki_rusage
.
ru_utime
.
tv_sec
+
10
*
(
ULONGLONG
)
kip
[
i
].
ki_rusage
.
ru_utime
.
tv_usec
;
ret
=
TRUE
;
break
;
}
}
procstat_freeprocs
(
pstat
,
kip
);
}
procstat_close
(
pstat
);
return
ret
;
#else
BOOL
get_thread_times
(
int
unix_pid
,
int
unix_tid
,
LARGE_INTEGER
*
kernel_time
,
LARGE_INTEGER
*
user_time
)
{
static
int
once
;
if
(
!
once
++
)
FIXME
(
"not implemented on this platform
\n
"
);
return
FALSE
;
}
#endif
}
/******************************************************************************
* NtQueryInformationThread (NTDLL.@)
...
...
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