This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 24 Jul 2013 08:28:08 +0530
- Subject: Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?
- References: <51E4A123 dot 9070001 at gmail dot com> <51E6F3ED dot 8000502 at redhat dot com> <51E6F956 dot 5050902 at gmail dot com> <51E714DE dot 6060802 at redhat dot com> <CAHGf_=oZW3kNA3V-9u+BZNs3tL3JKCsO2a0Q6f0iJzo=N4Wb8w at mail dot gmail dot com> <51E7B205 dot 3060905 at redhat dot com> <20130722214335 dot D9AFF2C06F at topped-with-meat dot com> <51EDB378 dot 8070301 at redhat dot com> <20130723023520 dot GG4977 at spoyarek dot pnq dot redhat dot com> <51EEC6F1 dot 9010605 at redhat dot com>
On Tue, Jul 23, 2013 at 02:09:53PM -0400, Carlos O'Donell wrote:
> Sorry, just to clarify, are you saying that OPEN_MAX needs a similar
> exception or that it already has one?
It already has one.
> I don't see anything in the glibc manual, linux kernel man pages, or
> POSIX about _SC_OPEN_MAX being non-constant.
It's in the standard specification:
http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html
> I know that sysconf values are expected to be constant for the lifetime
> of the process, but this is just not true for _SC_NPROCESSORS_ONLN.
>
> Currently in glibc we do not guarantee that _SC_NPROCESSORS_ONLN is
> constant.
>
> It would be a shame to throw away sysconf and write an almost identical
> API to handle non-constant values.
>
> I would rather say:
>
> (a) These value are constant as required by POSIX: <list of them>
>
> (b) These values are not-constant: <list of them>
Right.
Siddhesh