Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1511118 - Realtime: incorrect code example for retrieving processor affinity
Summary: Realtime: incorrect code example for retrieving processor affinity
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: doc-Realtime_Reference_Guide
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Jaroslav Klech
QA Contact: Evan McNabb
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-08 17:53 UTC by Clark Williams
Modified: 2019-03-06 01:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-06-05 17:38:07 UTC


Attachments (Terms of Use)
Example for finding current process affinity mask (deleted)
2017-11-08 22:13 UTC, Clark Williams
no flags Details

Description Clark Williams 2017-11-08 17:53:44 UTC
Document URL: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_for_Real_Time/7/html/Reference_Guide/Using_the_sched_setaffinity_system_call_to_set_processor_affinity.html

Section Number and Name: Section 6.2 - USING THE SCHED_SETAFFINITY() SYSTEM CALL TO SET PROCESSOR AFFINITY

Describe the issue: The code fragment there is merely a function prototype and does not match the description of what *should* be there. Listed is the sched_setaffinity() function but the description indicates that it should 'get' the affinity, not set it. 

Suggestions for improvement: I'll provide a C program to get the current affinty of a process

Comment 2 Clark Williams 2017-11-08 22:13:10 UTC
Created attachment 1349598 [details]
Example for finding current process affinity mask

The attached C program retrieves the current process affinity mask and reports how many cpus are allowed in the mask. 

I've got the RT team reviewing it to see if we can make it simpler.

Comment 3 Jaroslav Klech 2018-05-04 13:14:44 UTC
(In reply to Clark Williams from comment #2)
> Created attachment 1349598 [details]
> Example for finding current process affinity mask
> 
> The attached C program retrieves the current process affinity mask and
> reports how many cpus are allowed in the mask. 
> 
> I've got the RT team reviewing it to see if we can make it simpler.

Hi Clark,

can I use the code sample you posted in the attachment in comment 2, or do you have a simplified version somewhere?

Thanks 

Jaroslav

Comment 4 Clark Williams 2018-05-04 21:52:32 UTC
Jaroslav,

The example still looks good to me. I doubt it can be simplified any more and still kept compilable/runnable.


Note You need to log in before you can comment on or make changes to this bug.