summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsef <sef@FreeBSD.org>1997-12-13 03:13:49 +0000
committersef <sef@FreeBSD.org>1997-12-13 03:13:49 +0000
commitf13ddbc86500ce893f62460b62d775089a14aba0 (patch)
tree2ef0d8080b077044d2a0ab73a9b9d1b08d002334 /sys
parentb51dc6a0ad3ce435d5255b72124d2220a345c748 (diff)
downloadFreeBSD-src-f13ddbc86500ce893f62460b62d775089a14aba0.zip
FreeBSD-src-f13ddbc86500ce893f62460b62d775089a14aba0.tar.gz
Change the ioctls for procfs around a bit; in particular, whever possible,
change from ioctl(fd, PIOC<foo>, &i); to ioctl(fd, PIOC<foo>, i); This is going from the _IOW to _IO ioctl macro. The kernel, procctl, and truss must be in synch for it all to work (not doing so will get errors about inappropriate ioctl's, fortunately). Hopefully I didn't forget anything :).
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/procfs/procfs_vnops.c7
-rw-r--r--sys/miscfs/procfs/procfs_vnops.c7
-rw-r--r--sys/sys/pioctl.h13
3 files changed, 15 insertions, 12 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c
index f660f3a..9a40ea3 100644
--- a/sys/fs/procfs/procfs_vnops.c
+++ b/sys/fs/procfs/procfs_vnops.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95
*
- * $Id: procfs_vnops.c,v 1.46 1997/12/08 22:09:24 sef Exp $
+ * $Id: procfs_vnops.c,v 1.47 1997/12/12 03:33:43 sef Exp $
*/
/*
@@ -243,8 +243,9 @@ procfs_ioctl(ap)
break;
case PIOCSFL:
procp->p_pfsflags = (unsigned char)*(unsigned int*)ap->a_data;
- *(unsigned int*)ap->a_data = procp->p_stops;
break;
+ case PIOCGFL:
+ *(unsigned int*)ap->a_data = (unsigned int)procp->p_pfsflags;
case PIOCSTATUS:
psp = (struct procfs_status *)ap->a_data;
psp->state = (procp->p_step == 0);
@@ -273,7 +274,7 @@ procfs_ioctl(ap)
case PIOCCONT: /* Restart a proc */
if (procp->p_step == 0)
return EINVAL; /* Can only start a stopped process */
- if (ap->a_data && (signo = *(int*)ap->a_data)) {
+ if (signo = *(int*)ap->a_data) {
if (signo >= NSIG || signo <= 0)
return EINVAL;
psignal(procp, signo);
diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c
index f660f3a..9a40ea3 100644
--- a/sys/miscfs/procfs/procfs_vnops.c
+++ b/sys/miscfs/procfs/procfs_vnops.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95
*
- * $Id: procfs_vnops.c,v 1.46 1997/12/08 22:09:24 sef Exp $
+ * $Id: procfs_vnops.c,v 1.47 1997/12/12 03:33:43 sef Exp $
*/
/*
@@ -243,8 +243,9 @@ procfs_ioctl(ap)
break;
case PIOCSFL:
procp->p_pfsflags = (unsigned char)*(unsigned int*)ap->a_data;
- *(unsigned int*)ap->a_data = procp->p_stops;
break;
+ case PIOCGFL:
+ *(unsigned int*)ap->a_data = (unsigned int)procp->p_pfsflags;
case PIOCSTATUS:
psp = (struct procfs_status *)ap->a_data;
psp->state = (procp->p_step == 0);
@@ -273,7 +274,7 @@ procfs_ioctl(ap)
case PIOCCONT: /* Restart a proc */
if (procp->p_step == 0)
return EINVAL; /* Can only start a stopped process */
- if (ap->a_data && (signo = *(int*)ap->a_data)) {
+ if (signo = *(int*)ap->a_data) {
if (signo >= NSIG || signo <= 0)
return EINVAL;
psignal(procp, signo);
diff --git a/sys/sys/pioctl.h b/sys/sys/pioctl.h
index 8981782..60b6701 100644
--- a/sys/sys/pioctl.h
+++ b/sys/sys/pioctl.h
@@ -1,7 +1,7 @@
/*
* procfs ioctl definitions.
*
- * $Id: pioctl.h,v 1.2 1997/12/07 03:59:26 sef Exp $
+ * $Id: pioctl.h,v 1.3 1997/12/08 22:09:39 sef Exp $
*/
#ifndef _SYS_PIOCTL_H
@@ -17,14 +17,15 @@ struct procfs_status {
unsigned long val; /* Any extra data */
};
-# define PIOCBIS _IOW('p', 1, unsigned int) /* Set event flag */
-# define PIOCBIC _IOW('p', 2, unsigned int) /* Clear event flag */
-# define PIOCSFL _IOW('p', 3, unsigned int) /* Set flags */
+# define PIOCBIS _IO('p', 1) /* Set event flag */
+# define PIOCBIC _IO('p', 2) /* Clear event flag */
+# define PIOCSFL _IO('p', 3) /* Set flags */
/* wait for proc to stop */
# define PIOCWAIT _IOR('p', 4, struct procfs_status)
-# define PIOCCONT _IOW('p', 5, int) /* Continue a process */
+# define PIOCCONT _IO('p', 5) /* Continue a process */
/* Get proc status */
-# define PIOCSTATUS _IOW('p', 6, struct procfs_status)
+# define PIOCSTATUS _IOR('p', 6, struct procfs_status)
+# define PIOCGFL _IOR('p', 7, unsigned int) /* Get flags */
# define S_EXEC 0x00000001 /* stop-on-exec */
# define S_SIG 0x00000002 /* stop-on-signal */
OpenPOWER on IntegriCloud