This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3.1] New functions pthread_[sg]etattr_default_np for default thread attributes
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 13 Jun 2013 07:58:11 +0530
- Subject: Re: [PATCH v3.1] New functions pthread_[sg]etattr_default_np for default thread attributes
- References: <20130315043154 dot GG22471 at spoyarek dot pnq dot redhat dot com> <20130318222239 dot 7A2712C084 at topped-with-meat dot com> <CAAHN_R13bRF0UY_XZ7Rj6tSeSgq8c_0j4bbEH6m9BbGD32EycQ at mail dot gmail dot com> <20130528220730 dot 33C262C06F at topped-with-meat dot com> <20130529065138 dot GF2145 at spoyarek dot pnq dot redhat dot com> <20130529224222 dot 8A87F2C07E at topped-with-meat dot com> <20130606131212 dot GZ13968 at spoyarek dot pnq dot redhat dot com> <20130612000601 dot 54C9F2C06E at topped-with-meat dot com> <20130612101128 dot GB19582 at spoyarek dot pnq dot redhat dot com> <20130612231757 dot CCC752C07F at topped-with-meat dot com>
On Wed, Jun 12, 2013 at 04:17:57PM -0700, Roland McGrath wrote:
> > + void *newp = (cpu_set_t *) realloc (__default_pthread_attr.cpuset,
> > + attrs.cpusetsize);
>
> Drop the cast and make the variable cpu_set_t *.
>
> You could skip the realloc if the sizes match, which will be the common
> case (the second most common, after zero).
I already do with:
+ else if (attrs.cpusetsize != __default_pthread_attr.cpusetsize)
+ {
+ ....
Perhaps you mean something else?
> > + if (ret == EPERM)
> > + {
> > + fprintf (stderr, "Skipping CPU Affinity test: %s\n", strerror (ret));
> [...]
> > + fprintf (stderr, "Skipping Scheduler Attributes test: %s\n",
>
> Should probably be on stdout like the rest of the output.
>
It was agreed in the past that test warnings such as skipping a case
should be printing on standard error so that it is visible in the make
check output:
http://sourceware.org/glibc/wiki/Testing/Testsuite#Writing_a_test_case
I'll post an updated version in some time.
Siddhesh