Skip to contentSkip to conversation

Use pid_t instead of int

PATCH In review René Nyffenegger 2 participants 4 messages May 8, 2016 – May 9, 2016 ABI/API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use pid_t instead of int

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

---
 include/linux/syscalls.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/syscalls.h +4 -4
index d795472..d507e75 100644
@@ -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);
Signature · 1 line
2.8.0
#1 lore raw
Quoted 2 lines · René Nyffenegger

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

#2 lore raw

Somewhere else, pid_t is a typedef for an int.

Rene

Quoted 14 lines · Andy Lutomirski
Quoted 2 lines · René Nyffenegger

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

#3 lore raw
In reply to Andy Lutomirski

From: René Nyffenegger <[email protected]>

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.

---
 include/linux/syscalls.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/syscalls.h +4 -4
index d795472..d507e75 100644
@@ -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);
Signature · 1 line
2.8.0