Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
tload prints a graph of the current system load average to the
specified tty (or the tty of the tload process if none is specified),
similar to what xload(1) does.
This package is the only program from the Linux procps suite that is
not part of NetBSD or available else where.
+24
View File
@@ -0,0 +1,24 @@
# $NetBSD: Makefile,v 1.11 2012/10/23 19:51:27 asau Exp $
#
DISTNAME= procps-2.0.6
PKGNAME= tload-2.0.6
PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://procps.sourceforge.net/
MAINTAINER= hubertf@NetBSD.org
COMMENT= Terminal version of xload
HOMEPAGE= http://procps.sourceforge.net/
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
do-build:
cd ${WRKSRC} ; \
${CC} ${CFLAGS} tload.c -o tload
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/tload ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/tload.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.include "../../mk/bsd.pkg.mk"
+3
View File
@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1 2001/10/31 22:54:00 zuntum Exp $
bin/tload
man/man1/tload.1
+6
View File
@@ -0,0 +1,6 @@
$NetBSD: distinfo,v 1.6 2005/02/24 13:40:58 agc Exp $
SHA1 (procps-2.0.6.tar.gz) = 8006cbc096922c53d340cdfe1e8dd9504cd2e203
RMD160 (procps-2.0.6.tar.gz) = 3cb7866428111f2aae2e9a7228cca53de76154e2
Size (procps-2.0.6.tar.gz) = 188674 bytes
SHA1 (patch-aa) = c626a4811317358d2a1c90d55cdcbbbc8e541cc2
+70
View File
@@ -0,0 +1,70 @@
$NetBSD: patch-aa,v 1.4 2003/09/23 08:49:17 wiz Exp $
--- tload.c.orig Tue Sep 2 18:02:19 1997
+++ tload.c
@@ -34,6 +34,25 @@
extern int optind;
extern char *optarg;
+#ifndef __linux__
+void
+display_version(void)
+{
+ printf("procps 2.0.6, pkgsrc port\n");
+}
+
+
+int
+loadavg(double *l0, double *l1, double *l2)
+{
+ double l[3];
+ getloadavg(l, 3);
+ *l0 = l[0];
+ *l1 = l[1];
+ *l2 = l[2];
+}
+#endif
+
void alrm(int n)
{
signal(SIGALRM, alrm);
@@ -74,6 +93,11 @@
double av[3];
static double max_scale, scale_fact;
char *scale_arg = NULL;
+ static char hostname[256];
+ static char date[256];
+ time_t datet;
+ static char headl[256], headr[256];
+ int lenl, lenr;
while ((opt = getopt(argc, argv, "s:d:V")) != -1)
switch (opt) {
@@ -94,6 +118,11 @@
setsize(0);
+ if (gethostname(hostname, sizeof(hostname)) < 0) {
+ perror(argv[optind]);
+ exit(1);
+ }
+
if (scale_arg)
max_scale = atof(scale_arg);
else
@@ -144,8 +173,13 @@
for(row = nrows-2; row >= 0; --row)
*(screen + row * ncols + col) = ' ';
}
- i = sprintf(screen, " %.2f, %.2f, %.2f",
- av[0], av[1], av[2]);
+ datet = time(NULL);
+ strftime(date, sizeof(date), "%c", localtime(&datet));
+ lenr = sprintf(headr, "%s %s", hostname, date);
+ lenl = sprintf(headl, " %.2f, %.2f, %.2f",
+ av[0], av[1], av[2]);
+ i = sprintf(screen, "%s %*.s %s", headl,
+ ncols - lenl - lenr - 2, "", headr);
if (i>0)
screen[i] = ' ';