From 6f0b2e1f0fd3f2ce5a983c2e768619bb2739d8dd Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 29 Apr 2004 21:55:45 +0000 Subject: [PATCH] [BZ #130, BZ #131] 2004-04-28 Carlos O'Donell * sysdeps/unix/sysv/linux/mq_getattr.c: Include . * sysdeps/unix/sysv/linux/mq_notify.c: Likewise. * sysdeps/unix/sysv/linux/mq_open.c: Likewise. * sysdeps/unix/sysv/linux/mq_receive.c: Likewise. * sysdeps/unix/sysv/linux/mq_send.c: Likewise. * manual/resource.texi (sched_setaffinity, sched_getaffinity): Fix prototypes and description [BZ #131]. * string/bits/string2.h (strpbrk): Cast NULL to char * [BZ #130]. Patch by Ed Catmur . * string/tst-inlcall.c (main): Add test for strpbrk. --- ChangeLog | 15 +++++++++++++++ linuxthreads/ChangeLog | 5 +++++ linuxthreads/semaphore.c | 6 ++++-- manual/resource.texi | 18 +++++++++--------- string/bits/string2.h | 4 ++-- string/tst-inlcall.c | 9 ++++++++- sysdeps/unix/sysv/linux/mq_getattr.c | 1 + sysdeps/unix/sysv/linux/mq_notify.c | 1 + sysdeps/unix/sysv/linux/mq_open.c | 1 + sysdeps/unix/sysv/linux/mq_receive.c | 1 + sysdeps/unix/sysv/linux/mq_send.c | 1 + 11 files changed, 48 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e1d3ed..ddf4706 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-04-28 Carlos O'Donell + + * sysdeps/unix/sysv/linux/mq_getattr.c: Include . + * sysdeps/unix/sysv/linux/mq_notify.c: Likewise. + * sysdeps/unix/sysv/linux/mq_open.c: Likewise. + * sysdeps/unix/sysv/linux/mq_receive.c: Likewise. + * sysdeps/unix/sysv/linux/mq_send.c: Likewise. + 2004-04-29 Philip Blundell * sysdeps/arm/dl-machine.h (RTLD_START): Avoid unnecessary GOT @@ -5,6 +13,13 @@ 2004-04-29 Jakub Jelinek + * manual/resource.texi (sched_setaffinity, sched_getaffinity): Fix + prototypes and description [BZ #131]. + + * string/bits/string2.h (strpbrk): Cast NULL to char * [BZ #130]. + Patch by Ed Catmur . + * string/tst-inlcall.c (main): Add test for strpbrk. + [BZ #140] * sysdeps/unix/sysv/linux/sys/sysctl.h: Remove linux/compiler.h include. diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 48e31cb..d506b0a 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,8 @@ +2004-04-28 Jakub Jelinek + + * semaphore.c (sem_timedwait): Return -1 and set errno instead of + returning error number [BZ #133]. Patch by . + 2004-04-22 SUGIOKA Toshinobu * sysdeps/unix/sysv/linux/sh/vfork.S: Fix wrong function pointer diff --git a/linuxthreads/semaphore.c b/linuxthreads/semaphore.c index e0dac41..0793a5f 100644 --- a/linuxthreads/semaphore.c +++ b/linuxthreads/semaphore.c @@ -225,7 +225,8 @@ int sem_timedwait(sem_t *sem, const struct timespec *abstime) /* The standard requires that if the function would block and the time value is illegal, the function returns with an error. */ __pthread_unlock(&sem->__sem_lock); - return EINVAL; + __set_errno (EINVAL); + return -1; } /* Set up extrication interface */ @@ -263,7 +264,8 @@ int sem_timedwait(sem_t *sem, const struct timespec *abstime) if (was_on_queue) { __pthread_set_own_extricate_if(self, 0); - return ETIMEDOUT; + __set_errno (ETIMEDOUT); + return -1; } /* Eat the outstanding restart() from the signaller */ diff --git a/manual/resource.texi b/manual/resource.texi index 0c394f2..df77408 100644 --- a/manual/resource.texi +++ b/manual/resource.texi @@ -1367,12 +1367,12 @@ affinity mask can be retrieved from the system. @comment sched.h @comment GNU -@deftypefun int sched_getaffinity (pid_t @var{pid}, cpu_set_t *@var{cpuset}) +@deftypefun int sched_getaffinity (pid_t @var{pid}, size_t @var{cpusetsize}, cpu_set_t *@var{cpuset}) This functions stores the CPU affinity mask for the process or thread -with the ID @var{pid} in the memory pointed to by @var{cpuset}. If -successful, the function always initializes all bits in the -@code{cpu_set_t} object and returns zero. +with the ID @var{pid} in the @var{cpusetsize} bytes long bitmap +pointed to by @var{cpuset}. If successful, the function always +initializes all bits in the @code{cpu_set_t} object and returns zero. If @var{pid} does not correspond to a process or thread on the system the or the function fails for some other reason, it returns @code{-1} @@ -1395,12 +1395,12 @@ interface must be provided for that. @comment sched.h @comment GNU -@deftypefun int sched_setaffinity (pid_t @var{pid}, const cpu_set_t *@var{cpuset}) +@deftypefun int sched_setaffinity (pid_t @var{pid}, size_t @var{cpusetsize}, const cpu_set_t *@var{cpuset}) -This function installs the affinity mask pointed to by @var{cpuset} -for the process or thread with the ID @var{pid}. If successful the -function returns zero and the scheduler will in future take the -affinity information into account. +This function installs the @var{cpusetsize} bytes long affinity mask +pointed to by @var{cpuset} for the process or thread with the ID @var{pid}. +If successful the function returns zero and the scheduler will in future +take the affinity information into account. If the function fails it will return @code{-1} and @code{errno} is set to the error code: diff --git a/string/bits/string2.h b/string/bits/string2.h index 1a58716..01ef975 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -1,5 +1,5 @@ /* Machine-independant string function optimizations. - Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -1019,7 +1019,7 @@ __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) ({ char __a0, __a1, __a2; \ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \ ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') \ - ? ((void) (s), NULL) \ + ? ((void) (s), (char *) NULL) \ : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') \ ? strchr (s, __a0) \ : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') \ diff --git a/string/tst-inlcall.c b/string/tst-inlcall.c index 9edc973..2a4124e 100644 --- a/string/tst-inlcall.c +++ b/string/tst-inlcall.c @@ -1,5 +1,5 @@ /* Tester for calling inline string functions. - Copyright (C) 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -62,6 +62,13 @@ main (void) ++errors; } + const char * const hw = "hello world"; + if (strpbrk (hw, "o") - hw != 4) + { + puts ("strpbrk test 1 failed"); + ++errors; + } + if (errors == 0) { status = EXIT_SUCCESS; diff --git a/sysdeps/unix/sysv/linux/mq_getattr.c b/sysdeps/unix/sysv/linux/mq_getattr.c index 94c1df5..a61722e 100644 --- a/sysdeps/unix/sysv/linux/mq_getattr.c +++ b/sysdeps/unix/sysv/linux/mq_getattr.c @@ -18,6 +18,7 @@ #include #include +#include #include #ifdef __NR_mq_getsetattr diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c index 6ebe8ef..14db27d 100644 --- a/sysdeps/unix/sysv/linux/mq_notify.c +++ b/sysdeps/unix/sysv/linux/mq_notify.c @@ -18,6 +18,7 @@ #include #include +#include #include #ifdef __NR_mq_notify diff --git a/sysdeps/unix/sysv/linux/mq_open.c b/sysdeps/unix/sysv/linux/mq_open.c index ce5f5e9..d8926a7 100644 --- a/sysdeps/unix/sysv/linux/mq_open.c +++ b/sysdeps/unix/sysv/linux/mq_open.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #ifdef __NR_mq_open diff --git a/sysdeps/unix/sysv/linux/mq_receive.c b/sysdeps/unix/sysv/linux/mq_receive.c index b24ba4b..891663c 100644 --- a/sysdeps/unix/sysv/linux/mq_receive.c +++ b/sysdeps/unix/sysv/linux/mq_receive.c @@ -18,6 +18,7 @@ #include #include +#include #include #ifdef __NR_mq_timedreceive diff --git a/sysdeps/unix/sysv/linux/mq_send.c b/sysdeps/unix/sysv/linux/mq_send.c index 06d367b..cb9cbc2 100644 --- a/sysdeps/unix/sysv/linux/mq_send.c +++ b/sysdeps/unix/sysv/linux/mq_send.c @@ -18,6 +18,7 @@ #include #include +#include #include #ifdef __NR_mq_timedsend -- 2.7.4