[patch-2.3.44] slight change to prctl(2)

From: Tigran Aivazian (tigran@aivazian.fsnet.co.uk)
Date: Sun Feb 13 2000 - 13:07:06 EST


Hi Linus,

A long time ago I added PR_GET_PDEATHSIG command to prtctl(2) to match the
existing PR_SET_PDEATHSIG. Now that I noticed two new commands to get/set
current->dumpable the whole thing looks inconsistent so I suggest to
change PR_GET_PDEATHSIG so that it is the *return* value of
prtctl(PR_GET_PDEATHSIG) instead of doing put_user() to the user address
pointed to by the second argument. This is better because it leaves less
opportunity for the user to mess up the way she makes system calls.

Hence the small patch (I hope nobody used this interface yet so they won't
be upset :)

Regards,
Tigran

diff -urN -X dontdiff linux/include/linux/prctl.h linux-pdeath/include/linux/prctl.h
--- linux/include/linux/prctl.h Thu Oct 7 18:17:09 1999
+++ linux-pdeath/include/linux/prctl.h Sun Feb 13 17:49:27 2000
@@ -3,8 +3,11 @@
 
 /* Values to pass as first argument to prctl() */
 
-#define PR_SET_PDEATHSIG 1 /* Second arg is a signal */
-#define PR_GET_PDEATHSIG 2 /* Second arg is a ptr to return the signal */
+/* prctl(PR_SET_PDEATHSIG, sig) sets pdeath signal to sig */
+#define PR_SET_PDEATHSIG 1
+
+/* prctl(PR_GET_PDEATHSIG) returns parent death notification signal value */
+#define PR_GET_PDEATHSIG 2
 
 /* Get/set current->dumpable */
 #define PR_GET_DUMPABLE 3
diff -urN -X dontdiff linux/kernel/sys.c linux-pdeath/kernel/sys.c
--- linux/kernel/sys.c Fri Feb 11 20:08:05 2000
+++ linux-pdeath/kernel/sys.c Sun Feb 13 17:49:59 2000
@@ -1029,7 +1029,7 @@
                         current->pdeath_signal = sig;
                         break;
                 case PR_GET_PDEATHSIG:
- error = put_user(current->pdeath_signal, (int *)arg2);
+ error = current->pdeath_signal;
                         break;
                 case PR_GET_DUMPABLE:
                         if (current->dumpable)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:25 EST