[4/6] Cleanup Linux sigqueue implementation
Commit Message
This patch simplify Linux sigqueue implementation by assuming
__NR_rt_sigqueueinfo existence due minimum kernel requirement.
Checked on x86_64-linux-gnu.
* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
__NR_rt_sigqueueinfo.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
---
ChangeLog | 3 +++
sysdeps/unix/sysv/linux/sigqueue.c | 10 ++--------
2 files changed, 5 insertions(+), 8 deletions(-)
Comments
On Fri, Nov 3, 2017 at 5:40 PM, Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
> This patch simplify Linux sigqueue implementation by assuming
> __NR_rt_sigqueueinfo existence due minimum kernel requirement.
>
> Checked on x86_64-linux-gnu.
>
> * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
> __NR_rt_sigqueueinfo.
OK, but please state in the commit message the oldest kernel version
that provided __NR_rt_sigqueueinfo on all architectures.
zw
On 05/11/2017 19:30, Zack Weinberg wrote:
> On Fri, Nov 3, 2017 at 5:40 PM, Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>> This patch simplify Linux sigqueue implementation by assuming
>> __NR_rt_sigqueueinfo existence due minimum kernel requirement.
>>
>> Checked on x86_64-linux-gnu.
>>
>> * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
>> __NR_rt_sigqueueinfo.
>
> OK, but please state in the commit message the oldest kernel version
> that provided __NR_rt_sigqueueinfo on all architectures.
>
> zw
>
I am trying to find out exactly when realtime signals were introduced
on Linux and it seems it pre-dates git and so Linux 2.6.12 (commit
1da177e4 added both the headers and the systbl linkage on alpha
for instance). I think stating it is present on Linux 2.6 should
be suffice.
On Mon, Nov 6, 2017 at 5:59 AM, Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
> On 05/11/2017 19:30, Zack Weinberg wrote:
>> On Fri, Nov 3, 2017 at 5:40 PM, Adhemerval Zanella
>> <adhemerval.zanella@linaro.org> wrote:
>>> This patch simplify Linux sigqueue implementation by assuming
>>> __NR_rt_sigqueueinfo existence due minimum kernel requirement.
>>>
>>> Checked on x86_64-linux-gnu.
>>>
>>> * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
>>> __NR_rt_sigqueueinfo.
>>
>> OK, but please state in the commit message the oldest kernel version
>> that provided __NR_rt_sigqueueinfo on all architectures.
>
> I am trying to find out exactly when realtime signals were introduced
> on Linux and it seems it pre-dates git and so Linux 2.6.12 (commit
> 1da177e4 added both the headers and the systbl linkage on alpha
> for instance). I think stating it is present on Linux 2.6 should
> be suffice.
Yeah, that's fine. I just want there to be no confusion in the future.
I think you should go ahead and push the components of this patchset
that are fully reviewed and don't depend on other work, like this one
and the one cleaning up sigtimedwait and friends.
zw
On 06/11/2017 12:05, Zack Weinberg wrote:
> On Mon, Nov 6, 2017 at 5:59 AM, Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>> On 05/11/2017 19:30, Zack Weinberg wrote:
>>> On Fri, Nov 3, 2017 at 5:40 PM, Adhemerval Zanella
>>> <adhemerval.zanella@linaro.org> wrote:
>>>> This patch simplify Linux sigqueue implementation by assuming
>>>> __NR_rt_sigqueueinfo existence due minimum kernel requirement.
>>>>
>>>> Checked on x86_64-linux-gnu.
>>>>
>>>> * sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Asssume
>>>> __NR_rt_sigqueueinfo.
>>>
>>> OK, but please state in the commit message the oldest kernel version
>>> that provided __NR_rt_sigqueueinfo on all architectures.
>>
>> I am trying to find out exactly when realtime signals were introduced
>> on Linux and it seems it pre-dates git and so Linux 2.6.12 (commit
>> 1da177e4 added both the headers and the systbl linkage on alpha
>> for instance). I think stating it is present on Linux 2.6 should
>> be suffice.
>
> Yeah, that's fine. I just want there to be no confusion in the future.
>
> I think you should go ahead and push the components of this patchset
> that are fully reviewed and don't depend on other work, like this one
> and the one cleaning up sigtimedwait and friends.
>
> zw
>
Right, I will push both the sigqueue and the sigtimedwait simplify.
@@ -17,13 +17,10 @@
#include <errno.h>
#include <signal.h>
-#include <unistd.h>
#include <string.h>
-
+#include <unistd.h>
#include <sysdep.h>
-#include <sys/syscall.h>
-#ifdef __NR_rt_sigqueueinfo
/* Return any pending signal or wait for one for the given time. */
int
__sigqueue (pid_t pid, int sig, const union sigval val)
@@ -40,9 +37,6 @@ __sigqueue (pid_t pid, int sig, const union sigval val)
info.si_uid = __getuid ();
info.si_value = val;
- return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, &info);
+ return INLINE_SYSCALL_CALL (rt_sigqueueinfo, pid, sig, &info);
}
weak_alias (__sigqueue, sigqueue)
-#else
-# include <signal/sigqueue.c>
-#endif