summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-05-02 11:15:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-05-02 11:15:30 +0000
commit2cbb14893098445118dbd76eb3a6da56a4848f23 (patch)
tree7f96c922b39f82787b8db274ed1b1d7e5243b4ca /sys/kern
parentaa21ef7541a3118da61e9f0b759077a58b9d0f00 (diff)
Use intermediate vaddr_t cast when casting a pointer to off_t. Prevents
gcc4 from complaining about casting a pointer to an integer type of different size. ok guenther@, jsg@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/exec_elf.c4
-rw-r--r--sys/kern/kern_sysctl.c4
-rw-r--r--sys/kern/sys_process.c18
3 files changed, 13 insertions, 13 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 31399169905..882bbd12f4b 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.72 2010/01/14 23:12:11 schwarze Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.73 2010/05/02 11:15:29 kettenis Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -1198,7 +1198,7 @@ ELFNAMEEND(coredump_notes)(struct proc *p, void *iocookie, size_t *sizep)
iov.iov_len = sizeof(pss);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
- uio.uio_offset = (off_t)PS_STRINGS;
+ uio.uio_offset = (off_t)(vaddr_t)PS_STRINGS;
uio.uio_resid = sizeof(pss);
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_READ;
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 35fe3238fad..ee566720b8b 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.182 2010/04/20 20:49:33 deraadt Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.183 2010/05/02 11:15:29 kettenis Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -1646,7 +1646,7 @@ sysctl_proc_args(int *name, u_int namelen, void *oldp, size_t *oldlenp,
iov.iov_len = sizeof(pss);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
- uio.uio_offset = (off_t)PS_STRINGS;
+ uio.uio_offset = (off_t)(vaddr_t)PS_STRINGS;
uio.uio_resid = sizeof(pss);
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_READ;
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 72a65276cff..e4473890395 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_process.c,v 1.44 2010/01/28 19:23:06 guenther Exp $ */
+/* $OpenBSD: sys_process.c,v 1.45 2010/05/02 11:15:29 kettenis Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
@@ -261,7 +261,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval)
iov.iov_len = sizeof(int);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
- uio.uio_offset = (off_t)(long)SCARG(uap, addr);
+ uio.uio_offset = (off_t)(vaddr_t)SCARG(uap, addr);
uio.uio_resid = sizeof(int);
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = write ? UIO_WRITE : UIO_READ;
@@ -279,7 +279,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval)
iov.iov_len = piod.piod_len;
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
- uio.uio_offset = (off_t)(long)piod.piod_offs;
+ uio.uio_offset = (off_t)(vaddr_t)piod.piod_offs;
uio.uio_resid = piod.piod_len;
uio.uio_segflg = UIO_USERSPACE;
uio.uio_procp = p;
@@ -641,7 +641,7 @@ process_auxv_offset(struct proc *curp, struct proc *p, struct uio *uiop)
iov.iov_len = sizeof(pss);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
- uio.uio_offset = (off_t)PS_STRINGS;
+ uio.uio_offset = (off_t)(vaddr_t)PS_STRINGS;
uio.uio_resid = sizeof(pss);
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_READ;
@@ -653,15 +653,15 @@ process_auxv_offset(struct proc *curp, struct proc *p, struct uio *uiop)
if (pss.ps_envstr == NULL)
return (EIO);
- uiop->uio_offset += (off_t)(long)(pss.ps_envstr + pss.ps_nenvstr + 1);
+ uiop->uio_offset += (off_t)(vaddr_t)(pss.ps_envstr + pss.ps_nenvstr + 1);
#ifdef MACHINE_STACK_GROWS_UP
- if (uiop->uio_offset < (off_t)PS_STRINGS)
+ if (uiop->uio_offset < (off_t)(vaddr_t)PS_STRINGS)
return (EIO);
#else
- if (uiop->uio_offset > (off_t)PS_STRINGS)
+ if (uiop->uio_offset > (off_t)(vaddr_t)PS_STRINGS)
return (EIO);
- if ((uiop->uio_offset + uiop->uio_resid) > (off_t)PS_STRINGS)
- uiop->uio_resid = (off_t)PS_STRINGS - uiop->uio_offset;
+ if ((uiop->uio_offset + uiop->uio_resid) > (off_t)(vaddr_t)PS_STRINGS)
+ uiop->uio_resid = (off_t)(vaddr_t)PS_STRINGS - uiop->uio_offset;
#endif
return (0);