summaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-07-09 17:56:59 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-07-09 17:56:59 +0000
commitebce412ca23c199c95ebfb0164453477732b7ff6 (patch)
tree8865bb663c1b4cb2016f10b147446fb2cd489f89 /sys/miscfs
parent7d921a016dce7a6f167d2de5dc154ef09a26c9af (diff)
downloadsrc-test2-ebce412ca23c199c95ebfb0164453477732b7ff6.tar.gz
src-test2-ebce412ca23c199c95ebfb0164453477732b7ff6.zip
Notes
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/procfs/procfs_rlimit.c58
1 files changed, 7 insertions, 51 deletions
diff --git a/sys/miscfs/procfs/procfs_rlimit.c b/sys/miscfs/procfs/procfs_rlimit.c
index b211d0bb7e3c..c735bede2e34 100644
--- a/sys/miscfs/procfs/procfs_rlimit.c
+++ b/sys/miscfs/procfs/procfs_rlimit.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
*
- * $Id: procfs_status.c,v 1.12 1999/01/05 03:53:06 peter Exp $
+ * $Id: procfs_rlimit.c,v 1.1 1999/04/30 13:04:21 phk Exp $
*/
/*
@@ -56,51 +56,6 @@
#include <miscfs/procfs/procfs.h>
-/*
- * This converts a quad_t to a string, stored in fin
- * It is here because there doesn't exist a quad_t entry in the kernel
- * printf() library.
- */
-
-static void quadtostring (char *fin, quad_t num)
-{
- char str[128];
- char *cp;
- int i, n;
-
- cp = str;
- i = 0;
-
- /*
- * Create the number string.
- * The string will be in reverse from the original number.
- */
-
- while (num) {
- *(cp++) = (num % 10) + '0';
- num /= 10;
- i++;
- }
-
- /* Null terminate */
- *cp = '\0';
-
- /*
- * Now, swap the order
- */
-
- for (n = 0; n < i; n++) {
- fin[n] = str[(i-1)-n];
- }
-
- /* Null terminate */
- fin[n] = '\0';
-
- return;
-}
-
-
-
int
procfs_dorlimit(curp, p, pfs, uio)
struct proc *curp;
@@ -113,7 +68,6 @@ procfs_dorlimit(curp, p, pfs, uio)
int xlen;
int error;
char psbuf[512]; /* XXX - conservative */
- char qstr[64];
if (uio->uio_rw != UIO_READ)
return (EOPNOTSUPP);
@@ -140,8 +94,9 @@ procfs_dorlimit(curp, p, pfs, uio)
if (p->p_rlimit[i].rlim_cur == RLIM_INFINITY) {
ps += sprintf(ps, "-1 ");
} else {
- quadtostring(qstr, p->p_rlimit[i].rlim_cur);
- ps += sprintf(ps, "%s ", qstr);
+ /* quad_t is a long on the Alpha, sigh.. */
+ ps += sprintf(ps, "%qu ",
+ (unsigned long long)p->p_rlimit[i].rlim_cur);
}
/*
@@ -151,8 +106,9 @@ procfs_dorlimit(curp, p, pfs, uio)
if (p->p_rlimit[i].rlim_max == RLIM_INFINITY) {
ps += sprintf(ps, "-1\n");
} else {
- quadtostring(qstr, p->p_rlimit[i].rlim_max);
- ps += sprintf(ps, "%s\n", qstr);
+ /* quad_t is a long on the Alpha, sigh.. */
+ ps += sprintf(ps, "%qu\n",
+ (unsigned long long)p->p_rlimit[i].rlim_max);
}
}