Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f5b52a21
Commit
f5b52a21
authored
Jun 14, 2010
by
Francois Cartegnie
Committed by
Rémi Denis-Courmont
Jun 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_GetCPUCount: add Solaris detection
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
06389567
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
src/misc/cpu.c
src/misc/cpu.c
+27
-0
No files found.
src/misc/cpu.c
View file @
f5b52a21
...
@@ -49,6 +49,13 @@
...
@@ -49,6 +49,13 @@
#include <sys/sysctl.h>
#include <sys/sysctl.h>
#endif
#endif
#if defined(__SunOS)
#include <unistd.h>
#include <sys/types.h>
#include <sys/processor.h>
#include <sys/pset.h>
#endif
#if defined( __i386__ ) || defined( __x86_64__ ) || defined( __powerpc__ ) \
#if defined( __i386__ ) || defined( __x86_64__ ) || defined( __powerpc__ ) \
|| defined( __ppc__ ) || defined( __ppc64__ ) || defined( __powerpc64__ )
|| defined( __ppc__ ) || defined( __ppc64__ ) || defined( __powerpc64__ )
# ifndef WIN32
# ifndef WIN32
...
@@ -351,6 +358,26 @@ unsigned vlc_GetCPUCount(void)
...
@@ -351,6 +358,26 @@ unsigned vlc_GetCPUCount(void)
if
(
sysctlbyname
(
"hw.ncpu"
,
&
count
,
&
size
,
NULL
,
0
))
if
(
sysctlbyname
(
"hw.ncpu"
,
&
count
,
&
size
,
NULL
,
0
))
return
1
;
/* Failure */
return
1
;
/* Failure */
return
count
;
return
count
;
#elif defined(__SunOS)
unsigned
count
=
0
;
int
type
;
u_int
numcpus
;
processorid_t
*
cpulist
;
processor_info_t
cpuinfo
;
cpulist
=
malloc
(
sizeof
(
processorid_t
)
*
sysconf
(
_SC_NPROCESSORS_MAX
));
if
(
!
cpulist
)
return
1
;
if
(
pset_info
(
PS_MYID
,
&
type
,
&
numcpus
,
cpulist
)
==
0
)
{
for
(
u_int
i
=
0
;
i
<
numcpus
;
i
++
)
{
if
(
!
processor_info
(
cpulist
[
i
],
&
cpuinfo
))
count
+=
(
cpuinfo
.
pi_state
==
P_ONLINE
)
?
1
:
0
;
}
}
else
{
count
=
sysconf
(
_SC_NPROCESSORS_ONLN
);
}
free
(
cpulist
);
return
(
count
>
0
)
?
count
:
1
;
#else
#else
# warning "vlc_GetCPUCount is not implemented for your platform"
# warning "vlc_GetCPUCount is not implemented for your platform"
return
1
;
return
1
;
...
...
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