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
93852599
Commit
93852599
authored
Nov 19, 2021
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Nov 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Implement vm counters on FreeBSD.
Signed-off-by:
Damjan Jovanovic
<
damjan.jov@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f3478b4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
Makefile.in
server/Makefile.in
+1
-1
process.c
server/process.c
+38
-2
No files found.
server/Makefile.in
View file @
93852599
...
...
@@ -49,6 +49,6 @@ MANPAGES = \
wineserver.fr.UTF-8.man.in
\
wineserver.man.in
EXTRALIBS
=
$(LDEXECFLAGS)
$(RT_LIBS)
$(INOTIFY_LIBS)
EXTRALIBS
=
$(LDEXECFLAGS)
$(RT_LIBS)
$(INOTIFY_LIBS)
$(PROCSTAT_LIBS)
unicode_EXTRADEFS
=
-DNLSDIR
=
"
\"
${
nlsdir
}
\"
"
-DBIN_TO_NLSDIR
=
\"
`
${
MAKEDEP
}
-R
${
bindir
}
${
nlsdir
}
`
\"
server/process.c
View file @
93852599
...
...
@@ -36,6 +36,23 @@
#endif
#include <unistd.h>
#include <poll.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_QUEUE_H
# include <sys/queue.h>
#endif
#ifdef HAVE_SYS_SYSCTL_H
# include <sys/sysctl.h>
#endif
#ifdef HAVE_SYS_USER_H
# define thread __unix_thread
# include <sys/user.h>
# undef thread
#endif
#ifdef HAVE_LIBPROCSTAT
# include <libprocstat.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -1550,9 +1567,9 @@ DECL_HANDLER(get_process_vm_counters)
struct
process
*
process
=
get_process_from_handle
(
req
->
handle
,
PROCESS_QUERY_LIMITED_INFORMATION
);
if
(
!
process
)
return
;
#ifdef linux
if
(
process
->
unix_pid
!=
-
1
)
{
#ifdef linux
FILE
*
f
;
char
proc_path
[
32
],
line
[
256
];
unsigned
long
value
;
...
...
@@ -1579,9 +1596,28 @@ DECL_HANDLER(get_process_vm_counters)
fclose
(
f
);
}
else
set_error
(
STATUS_ACCESS_DENIED
);
#elif defined(HAVE_LIBPROCSTAT)
struct
procstat
*
procstat
;
unsigned
int
count
;
if
((
procstat
=
procstat_open_sysctl
()))
{
struct
kinfo_proc
*
kp
=
procstat_getprocs
(
procstat
,
KERN_PROC_PID
,
process
->
unix_pid
,
&
count
);
if
(
kp
)
{
reply
->
virtual_size
=
kp
->
ki_size
;
reply
->
peak_virtual_size
=
reply
->
virtual_size
;
reply
->
working_set_size
=
kp
->
ki_rssize
<<
PAGE_SHIFT
;
reply
->
peak_working_set_size
=
kp
->
ki_rusage
.
ru_maxrss
*
1024
;
procstat_freeprocs
(
procstat
,
kp
);
}
else
set_error
(
STATUS_ACCESS_DENIED
);
procstat_close
(
procstat
);
}
else
set_error
(
STATUS_ACCESS_DENIED
);
#endif
}
else
set_error
(
STATUS_ACCESS_DENIED
);
#endif
release_object
(
process
);
}
...
...
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