Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396479 > unrolled thread

[PATCH] Use pid_t instead of int

Started byRené Nyffenegger <mail@renenyffenegger.ch>
First post2016-05-08 21:40 +0200
Last post2016-05-09 08:40 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Use pid_t instead of int René Nyffenegger <mail@renenyffenegger.ch> - 2016-05-08 21:40 +0200
    Re: [PATCH] Use pid_t instead of int Andy Lutomirski <luto@amacapital.net> - 2016-05-09 03:30 +0200
      Re: [PATCH] Use pid_t instead of int René Nyffenegger <mail@renenyffenegger.ch> - 2016-05-09 06:20 +0200
      Re: [PATCH] Use pid_t instead of int René Nyffenegger <mail@renenyffenegger.ch> - 2016-05-09 08:40 +0200

#1396479 — [PATCH] Use pid_t instead of int

FromRené Nyffenegger <mail@renenyffenegger.ch>
Date2016-05-08 21:40 +0200
Subject[PATCH] Use pid_t instead of int
Message-ID<rwCIx-4sw-9@gated-at.bofh.it>
Use pid_t instead of int in the declarations of sys_kill, sys_tgkill,
sys_tkill and sys_rt_sigqueueinfo in include/linux/syscalls.h

Signed-off-by: René Nyffenegger <mail@renenyffenegger.ch>
---
 include/linux/syscalls.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d795472..d507e75 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -371,10 +371,10 @@ asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese,
 				size_t sigsetsize);
 asmlinkage long sys_rt_tgsigqueueinfo(pid_t tgid, pid_t  pid, int sig,
 		siginfo_t __user *uinfo);
-asmlinkage long sys_kill(int pid, int sig);
-asmlinkage long sys_tgkill(int tgid, int pid, int sig);
-asmlinkage long sys_tkill(int pid, int sig);
-asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo);
+asmlinkage long sys_kill(pid_t pid, int sig);
+asmlinkage long sys_tgkill(int tgid, pid_t pid, int sig);
+asmlinkage long sys_tkill(pid_t pid, int sig);
+asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo);
 asmlinkage long sys_sgetmask(void);
 asmlinkage long sys_ssetmask(int newmask);
 asmlinkage long sys_signal(int sig, __sighandler_t handler);
-- 
2.8.0

[toc] | [next] | [standalone]


#1396529

FromAndy Lutomirski <luto@amacapital.net>
Date2016-05-09 03:30 +0200
Message-ID<rwIbf-1FR-7@gated-at.bofh.it>
In reply to#1396479
On Sun, May 8, 2016 at 12:38 PM, René Nyffenegger
<mail@renenyffenegger.ch> wrote:
> Use pid_t instead of int in the declarations of sys_kill, sys_tgkill,
> sys_tkill and sys_rt_sigqueueinfo in include/linux/syscalls.h

The description is no good.  *Why* are you changing it?

I checked tgkill and, indeed, tgkill takes pid_t parameters, so this
fixes an incorrect declaration.  I'm wondering why the code compiles
without warning.  Is SYSCALL_DEFINE too lenient for some reason?  Or
is pid_t just defined as int.

--Andy

[toc] | [prev] | [next] | [standalone]


#1396577

FromRené Nyffenegger <mail@renenyffenegger.ch>
Date2016-05-09 06:20 +0200
Message-ID<rwKPM-4Mr-9@gated-at.bofh.it>
In reply to#1396529
Somewhere else, pid_t is a typedef for an int.

Rene

On 09.05.2016 03:25, Andy Lutomirski wrote:
> On Sun, May 8, 2016 at 12:38 PM, René Nyffenegger
> <mail@renenyffenegger.ch> wrote:
>> Use pid_t instead of int in the declarations of sys_kill, sys_tgkill,
>> sys_tkill and sys_rt_sigqueueinfo in include/linux/syscalls.h
> 
> The description is no good.  *Why* are you changing it?
> 
> I checked tgkill and, indeed, tgkill takes pid_t parameters, so this
> fixes an incorrect declaration.  I'm wondering why the code compiles
> without warning.  Is SYSCALL_DEFINE too lenient for some reason?  Or
> is pid_t just defined as int.
> 
> --Andy
> 

[toc] | [prev] | [next] | [standalone]


#1396609

FromRené Nyffenegger <mail@renenyffenegger.ch>
Date2016-05-09 08:40 +0200
Message-ID<rwN1g-7fr-19@gated-at.bofh.it>
In reply to#1396529
From: René Nyffenegger <mail@renenyffenegger.ch>

In include/linux/syscalls.h, the four functions sys_kill, sys_tgkill,
sys_tkill and sys_rt_sigqueueinfo are declared with "int pid" and
"int tgid".

However, in kernel/signal.c, the corresponding definitions use
the more appropriate "pid_t" (which is a typedef'd int).

This patch changes "int" to "pid_t" in the declarations of
sys_kill, sys_tgkill, sys_tkill and sys_rt_sigqueueinfo in
include/linux/syscalls.h in order to harmonize the function
declarations with their respective definitions.

Signed-off-by: René Nyffenegger <mail@renenyffenegger.ch>
---
 include/linux/syscalls.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d795472..d507e75 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -371,10 +371,10 @@ asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese,
 				size_t sigsetsize);
 asmlinkage long sys_rt_tgsigqueueinfo(pid_t tgid, pid_t  pid, int sig,
 		siginfo_t __user *uinfo);
-asmlinkage long sys_kill(int pid, int sig);
-asmlinkage long sys_tgkill(int tgid, int pid, int sig);
-asmlinkage long sys_tkill(int pid, int sig);
-asmlinkage long sys_rt_sigqueueinfo(int pid, int sig, siginfo_t __user *uinfo);
+asmlinkage long sys_kill(pid_t pid, int sig);
+asmlinkage long sys_tgkill(pid_t tgid, pid_t pid, int sig);
+asmlinkage long sys_tkill(pid_t pid, int sig);
+asmlinkage long sys_rt_sigqueueinfo(pid_t pid, int sig, siginfo_t __user *uinfo);
 asmlinkage long sys_sgetmask(void);
 asmlinkage long sys_ssetmask(int newmask);
 asmlinkage long sys_signal(int sig, __sighandler_t handler);
-- 
2.8.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web