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
d5406d02
Commit
d5406d02
authored
Oct 31, 2021
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Nov 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement setting SYSTEM_PERFORMANCE_INFORMATION.IdleTime on FreeBSD.
Signed-off-by:
Damjan Jovanovic
<
damjan.jov@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
478a7dbc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
system.c
dlls/ntdll/unix/system.c
+18
-1
No files found.
dlls/ntdll/unix/system.c
View file @
d5406d02
...
...
@@ -1852,6 +1852,7 @@ static void get_performance_info( SYSTEM_PERFORMANCE_INFORMATION *info )
memset
(
info
,
0
,
sizeof
(
*
info
)
);
#if defined(linux)
if
((
fp
=
fopen
(
"/proc/uptime"
,
"r"
)))
{
double
uptime
,
idle_time
;
...
...
@@ -1860,12 +1861,28 @@ static void get_performance_info( SYSTEM_PERFORMANCE_INFORMATION *info )
fclose
(
fp
);
info
->
IdleTime
.
QuadPart
=
10000000
*
idle_time
;
}
else
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
{
static
int
clockrate_name
[]
=
{
CTL_KERN
,
KERN_CLOCKRATE
};
size_t
size
=
0
;
struct
clockinfo
clockrate
;
long
ptimes
[
CPUSTATES
];
size
=
sizeof
(
clockrate
);
if
(
!
sysctl
(
clockrate_name
,
2
,
&
clockrate
,
&
size
,
NULL
,
0
))
{
size
=
sizeof
(
ptimes
);
if
(
!
sysctlbyname
(
"kern.cp_time"
,
ptimes
,
&
size
,
NULL
,
0
))
info
->
IdleTime
.
QuadPart
=
(
ULONGLONG
)
ptimes
[
CP_IDLE
]
*
10000000
/
clockrate
.
stathz
;
}
}
#else
{
static
ULONGLONG
idle
;
/* many programs expect IdleTime to change so fake change */
info
->
IdleTime
.
QuadPart
=
++
idle
;
}
#endif
#ifdef linux
if
((
fp
=
fopen
(
"/proc/meminfo"
,
"r"
)))
...
...
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