mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-17 03:49:46 +08:00
6af69de3d3
* libc/string/strcasestr.c: Remove id macro. * libc/sys/linux/linuxthreads/attr.c: Fix up sched_priority field reference to be __sched_priority. * libc/sys/linux/linuxthreads/joinrace.c: Ditto. * libc/sys/linux/linuxthreads/manager.c: Ditto. * libc/sys/linux/stdlib/collate.c: Remove id macro. * libc/sys/linux/stdlib/collcmp.c: Ditto. * libc/sys/linux/stdlib/engine.c: Ditto. * libc/sys/linux/stdlib/fnmatch.c: Ditto. * libc/sys/linux/stdlib/glob.c: Ditto. * libc/sys/linux/stdlib/reallocf.c: Ditto. * libc/sys/linux/stdlib/regcomp.c: Ditto. * libc/sys/linux/stdlib/regerror.c: Ditto. * libc/sys/linux/stdlib/regexec.c: Ditto. * libc/sys/linux/stdlib/regfree.c: Ditto. * libc/sys/linux/sys/cdefs.h: Replace with latest version. * libc/sys/linux/include/argp.h: Ditto. * libc/sys/linux/sys/libc-lock.h: New file. * libc/sys/linux/sys/stdint.h: Ditto. * libc/sys/linux/include/sched.h: New file.
49 lines
895 B
C
49 lines
895 B
C
/* Test case by Permaine Cheung <pcheung@cygnus.com>. */
|
|
|
|
#include <errno.h>
|
|
#include <pthread.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
static void *
|
|
sub1 (void *arg)
|
|
{
|
|
/* Nothing. */
|
|
return NULL;
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int istatus;
|
|
int policy;
|
|
int cnt;
|
|
pthread_t thread1;
|
|
struct sched_param spresult1, sp1;
|
|
|
|
for (cnt = 0; cnt < 100; ++cnt)
|
|
{
|
|
printf ("Round %d\n", cnt);
|
|
|
|
pthread_create (&thread1, NULL, &sub1, NULL);
|
|
pthread_join (thread1, NULL);
|
|
|
|
istatus = pthread_getschedparam (thread1, &policy, &spresult1);
|
|
if (istatus != ESRCH)
|
|
{
|
|
printf ("pthread_getschedparam returns: %d\n", istatus);
|
|
return 1;
|
|
}
|
|
|
|
sp1.__sched_priority = 0;
|
|
istatus = pthread_setschedparam (thread1, SCHED_OTHER, &sp1);
|
|
if (istatus != ESRCH)
|
|
{
|
|
printf ("pthread_setschedparam returns: %d\n", istatus);
|
|
return 2;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|