diff options
author | ru <ru@FreeBSD.org> | 2006-09-27 19:57:02 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-09-27 19:57:02 +0000 |
commit | 4ef62e4ca582414062d69e20a1ccdade4a110938 (patch) | |
tree | a886251dab8c19f71a5bfd0199ec1d9b327b3513 /sys/fs/procfs/procfs_ioctl.c | |
parent | f6b387ce531fb4ba91958db5aadcb53f89d4ed1b (diff) | |
download | FreeBSD-src-4ef62e4ca582414062d69e20a1ccdade4a110938.zip FreeBSD-src-4ef62e4ca582414062d69e20a1ccdade4a110938.tar.gz |
Fix our ioctl(2) implementation when the argument is "int". New
ioctls passing integer arguments should use the _IOWINT() macro.
This fixes a lot of ioctl's not working on sparc64, most notable
being keyboard/syscons ioctls.
Full ABI compatibility is provided, with the bonus of fixing the
handling of old ioctls on sparc64.
Reviewed by: bde (with contributions)
Tested by: emax, marius
MFC after: 1 week
Diffstat (limited to 'sys/fs/procfs/procfs_ioctl.c')
-rw-r--r-- | sys/fs/procfs/procfs_ioctl.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/sys/fs/procfs/procfs_ioctl.c b/sys/fs/procfs/procfs_ioctl.c index 7acf7d2..3808a2b 100644 --- a/sys/fs/procfs/procfs_ioctl.c +++ b/sys/fs/procfs/procfs_ioctl.c @@ -65,6 +65,9 @@ procfs_ioctl(PFS_IOCTL_ARGS) struct procfs_status32 *ps32; #endif int error, flags, sig; +#ifdef COMPAT_FREEBSD6 + int ival; +#endif PROC_LOCK(p); error = 0; @@ -72,20 +75,35 @@ procfs_ioctl(PFS_IOCTL_ARGS) #if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) case _IOC(IOC_IN, 'p', 1, 0): #endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 1): + ival = IOCPARM_IVAL(data); + data = &ival; +#endif case PIOCBIS: - p->p_stops |= *(uintptr_t *)data; + p->p_stops |= *(unsigned int *)data; break; #if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) case _IOC(IOC_IN, 'p', 2, 0): #endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 2): + ival = IOCPARM_IVAL(data); + data = &ival; +#endif case PIOCBIC: - p->p_stops &= ~*(uintptr_t *)data; + p->p_stops &= ~*(unsigned int *)data; break; #if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) case _IOC(IOC_IN, 'p', 3, 0): #endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 3): + ival = IOCPARM_IVAL(data); + data = &ival; +#endif case PIOCSFL: - flags = *(uintptr_t *)data; + flags = *(unsigned int *)data; if (flags & PF_ISUGID && (error = suser(td)) != 0) break; p->p_pfsflags = flags; @@ -132,10 +150,15 @@ procfs_ioctl(PFS_IOCTL_ARGS) #if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) case _IOC(IOC_IN, 'p', 5, 0): #endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 5): + ival = IOCPARM_IVAL(data); + data = &ival; +#endif case PIOCCONT: if (p->p_step == 0) break; - sig = *(uintptr_t *)data; + sig = *(unsigned int *)data; if (sig != 0 && !_SIG_VALID(sig)) { error = EINVAL; break; |