Some, but not all versions of the syscall return the expected size in
bytes on success or -1 on error. The others return 0 on success or -1
on error.
So, correct documentation of the current behavior would be to say
"non-negative" on success, rather than "zero".
We can resolve the difference between docs and code by changing either
one to match the other.
I have no strong feeling either way.
-Paul
Jeff Squyres wrote:
>On Feb 3, 2006, at 1:32 PM, David Creasy wrote:
>
>
>>Thanks for an amazingly useful library.
>>
>
>I'm glad you find it useful! :-)
>
>I apologize for the delay in replying; I just returned off about 2
>weeks of travel and a bazillion e-mails piled up while I was gone. :-(
>
>
>>The documentation says that the return value from
>>plpa_sched_getaffinity
>>is zero for success. Looks as though this is incorrect, and the return
>>value is as in the sched_getaffinity man page:
>>
>>"the size (in bytes) of the affinity mask used by the kernel. On
>>error,
>>-1 is returned, and errno is set appropriately"
>>
>>Can I just assume any value > 0 is OK?
>>
>
>Yoinks -- this is not something we were careful about. It looks like
>upon success, we're returning the value of the syscall. Hence, the
>return value is dependent upon whatever variant of setaffinity() is
>implemented in the back-end kernel.
>
>Paul/Bogdan -- in your research, did all the set/getaffinity kernel
>implementations return the same kind of value upon success (e.g.,
>what is listed above)? Or do we need to frob the return value
>returned by syscall to return some kind of consistent value?
>
>
--
Paul H. Hargrove PHHargrove_at_[hidden]
Future Technologies Group
HPC Research Department Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory Fax: +1-510-486-6900
|