Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
f4c49ff9
Commit
f4c49ff9
authored
Nov 27, 2014
by
Hisham Muhammad
Browse files
"get max pid" for FreeBSD
parent
da0956d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
freebsd/Platform.c
View file @
f4c49ff9
...
...
@@ -83,3 +83,13 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
*
five
=
(
double
)
loadAverage
.
ldavg
[
1
]
/
loadAverage
.
fscale
;
*
fifteen
=
(
double
)
loadAverage
.
ldavg
[
2
]
/
loadAverage
.
fscale
;
}
int
Platform_getMaxPid
()
{
int
maxPid
;
size_t
size
=
sizeof
(
maxPid
);
int
err
=
sysctlbyname
(
"kern.pid_max"
,
&
maxPid
,
&
size
,
NULL
,
0
);
if
(
err
)
{
return
99999
;
}
return
maxPid
;
}
freebsd/Platform.h
View file @
f4c49ff9
...
...
@@ -19,4 +19,6 @@ int Platform_getUptime();
void
Platform_getLoadAverage
(
double
*
one
,
double
*
five
,
double
*
fifteen
);
int
Platform_getMaxPid
();
#endif
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