Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
b484e6f5
Commit
b484e6f5
authored
9 years ago
by
bors
Browse files
Options
Downloads
Plain Diff
Auto merge of #256 - nodakai:fix-cpu_set, r=alexcrichton
Fix CPU_SET and CPU_ISSET
parents
60f90cf5
afa77dfa
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/unix/notbsd/linux/mod.rs
+4
-4
4 additions, 4 deletions
src/unix/notbsd/linux/mod.rs
with
4 additions
and
4 deletions
src/unix/notbsd/linux/mod.rs
+
4
−
4
View file @
b484e6f5
...
...
@@ -450,15 +450,15 @@ f! {
}
pub
fn
CPU_SET
(
cpu
:
usize
,
cpuset
:
&
mut
cpu_set_t
)
->
()
{
let
size
=
mem
::
size_of_val
(
&
cpuset
.bits
[
0
]);
let
(
idx
,
offset
)
=
(
cpu
/
size
,
cpu
%
size
);
let
size
_in_bits
=
8
*
mem
::
size_of_val
(
&
cpuset
.bits
[
0
]);
// 32, 64 etc
let
(
idx
,
offset
)
=
(
cpu
/
size
_in_bits
,
cpu
%
size
_in_bits
);
cpuset
.bits
[
idx
]
|
=
1
<<
offset
;
()
}
pub
fn
CPU_ISSET
(
cpu
:
usize
,
cpuset
:
&
cpu_set_t
)
->
bool
{
let
size
=
mem
::
size_of_val
(
&
cpuset
.bits
[
0
]);
let
(
idx
,
offset
)
=
(
cpu
/
size
,
cpu
%
size
);
let
size
_in_bits
=
8
*
mem
::
size_of_val
(
&
cpuset
.bits
[
0
]);
let
(
idx
,
offset
)
=
(
cpu
/
size
_in_bits
,
cpu
%
size
_in_bits
);
0
!=
(
cpuset
.bits
[
idx
]
&
(
1
<<
offset
))
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment