diff options
author | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-05-24 22:53:53 -0500 |
---|---|---|
committer | Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> | 2019-05-24 22:53:53 -0500 |
commit | ba1a8e3d1da08e05567ee6f83288cc5a993976f7 (patch) | |
tree | 95a26f6447d3cf7b1458418ad22cfcfa7cc47dae /bin/ps/fmt.c | |
parent | 2b6d352202dcdafeb03ddc7be9d45d54915afab4 (diff) | |
download | userland-ba1a8e3d1da08e05567ee6f83288cc5a993976f7.tar.gz userland-ba1a8e3d1da08e05567ee6f83288cc5a993976f7.tar.bz2 userland-ba1a8e3d1da08e05567ee6f83288cc5a993976f7.tar.xz userland-ba1a8e3d1da08e05567ee6f83288cc5a993976f7.zip |
bin: remove `kill` and `ps`; they are provided by procps
Diffstat (limited to 'bin/ps/fmt.c')
-rw-r--r-- | bin/ps/fmt.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c deleted file mode 100644 index 489a0ec..0000000 --- a/bin/ps/fmt.c +++ /dev/null @@ -1,60 +0,0 @@ -/* $NetBSD: fmt.c,v 1.21 2007/12/12 22:55:43 lukem Exp $ */ - -#include <sys/cdefs.h> -__RCSID("$NetBSD: fmt.c,v 1.21 2007/12/12 22:55:43 lukem Exp $"); - -#include <kvm.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <vis.h> -#include <sys/time.h> -#include <sys/resource.h> -#include "ps.h" - -void -fmt_puts(char *s, int *leftp) -{ - static char *v = 0; - static int maxlen = 0; - char *nv; - int len, nlen; - - if (*leftp == 0) - return; - len = strlen(s) * 4 + 1; - if (len > maxlen) { - if (maxlen == 0) - nlen = getpagesize(); - else - nlen = maxlen; - while (len > nlen) - nlen *= 2; - nv = realloc(v, nlen); - if (nv == 0) - return; - v = nv; - maxlen = nlen; - } - len = strvis(v, s, VIS_TAB | VIS_NL | VIS_CSTYLE); - if (*leftp != -1) { - if (len > *leftp) { - v[*leftp] = '\0'; - *leftp = 0; - } else - *leftp -= len; - } - (void)printf("%s", v); -} - -void -fmt_putc(int c, int *leftp) -{ - - if (*leftp == 0) - return; - if (*leftp != -1) - *leftp -= 1; - putchar(c); -} |