aboutsummaryrefslogtreecommitdiffstats
path: root/sys/miscfs/procfs/procfs_status.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/miscfs/procfs/procfs_status.c')
-rw-r--r--sys/miscfs/procfs/procfs_status.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c
index b8cc6dbe9f91..370f23a6efb2 100644
--- a/sys/miscfs/procfs/procfs_status.c
+++ b/sys/miscfs/procfs/procfs_status.c
@@ -166,15 +166,7 @@ procfs_dostatus(curp, p, pfs, uio)
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, "\n");
DOCHECK();
- xlen = ps - psbuf;
- xlen -= uio->uio_offset;
- ps = psbuf + uio->uio_offset;
- xlen = imin(xlen, uio->uio_resid);
- if (xlen <= 0)
- error = 0;
- else
- error = uiomove(ps, xlen, uio);
-
+ error = uiomove_frombuf(psbuf, ps - psbuf, uio);
return (error);
bailout:
@@ -246,13 +238,7 @@ procfs_docmdline(curp, p, pfs, uio)
buflen = ps - buf;
}
- buflen -= uio->uio_offset;
- ps = bp + uio->uio_offset;
- xlen = min(buflen, uio->uio_resid);
- if (xlen <= 0)
- error = 0;
- else
- error = uiomove(ps, xlen, uio);
+ error = uiomove_frombuf(bp, buflen, uio);
if (buf)
FREE(buf, M_TEMP);
return (error);