return q;
}
#else
+#include <unistd.h>
#include <sys/types.h>
#include <sys/times.h>
-#include <minix/sysinfo.h>
#include <time.h>
struct tms tms;
int secs, msecs;
u32_t system_hz;
times(&tms);
- getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
+ system_hz = (u32_t) sysconf(_SC_CLK_TCK);
secs = tms.tms_utime / system_hz;
q = secs;
tms.tms_utime -= secs * system_hz;
#include <minix/partition.h>
#include <minix/u64.h>
#include <minix/com.h>
-#include <minix/sysinfo.h>
#include <machine/partition.h>
#include <termios.h>
#include <stdarg.h>
return;
}
- if(getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz) < 0) {
- fprintf(stderr, "autopart: system hz not found\n");
- exit(1);
- }
+ system_hz = (u32_t) sysconf(_SC_CLK_TCK);
v = 2*system_hz;
ioctl(device, DIOCTIMEOUT, &v);
-PROG= lspci
+SCRIPTS= lspci.sh
MAN=
.include <bsd.prog.mk>
+++ /dev/null
-/*
- * Copyright (c) 2009, Erik van der Kouwe
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <minix/com.h>
-#include <stdio.h>
-#include <unistd.h>
-
-int main(int argc, char **argv)
-{
- struct pciinfo_entry *entry;
- struct pciinfo pciinfo;
-
- /* obtain a list of PCI devices from PM */
- if (getsysinfo(PM_PROC_NR, SI_PCI_INFO, &pciinfo) < 0)
- {
- perror("getsysinfo failed");
- return -1;
- }
-
- /* print the list of devices */
- entry = pciinfo.pi_entries;
- while (pciinfo.pi_count-- > 0)
- {
- printf("%.4X:%.4X %s\n", entry->pie_vid, entry->pie_did, entry->pie_name);
- entry++;
- }
-
- return 0;
-}
--- /dev/null
+#!/bin/sh
+
+if [ ! -f /proc/pci ]; then
+ echo "PCI list not found (is /proc mounted?)" >&2
+ exit 1
+fi
+
+exec cut -d' ' -f3- /proc/pci
#include <minix/ipc.h>
#include <minix/rs.h>
#include <minix/syslib.h>
-#include <minix/sysinfo.h>
#include <minix/bitmap.h>
#include <minix/paths.h>
#include <minix/sef.h>
}
/* Get HZ. */
- if(getsysinfo_up(PM_PROC_NR,
- SIU_SYSTEMHZ, sizeof(system_hz), &system_hz) < 0) {
- system_hz = DEFAULT_HZ;
- fprintf(stderr, "WARNING: reverting to default HZ %d\n",
- (int) system_hz);
- }
+ system_hz = (u32_t) sysconf(_SC_CLK_TCK);
/* Check optional arguments that come in pairs like "-args arglist". */
for (i=optind+MIN_ARG_COUNT+1; i<argc; i=i+2) {
#include <net/gen/socket.h>
#include <minix/queryparam.h>
#include <minix/com.h>
-#include <minix/sysinfo.h>
#include <inet/generic/buf.h>
#include <inet/generic/clock.h>
int a_flag, n_flag, v_flag;
struct tms tmsbuf;
- getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
+ system_hz = (u32_t) sysconf(_SC_CLK_TCK);
(prog_name=strrchr(argv[0], '/')) ? prog_name++ : (prog_name=argv[0]);
#include <unistd.h>
#include <sys/wait.h>
#include <minix/minlib.h>
-#include <minix/sysinfo.h>
#include <stdio.h>
/* -DNEW prints time to 0.01 sec. */
int hours, minutes, seconds, hundredths, i;
u32_t system_hz;
- getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
+ system_hz = (u32_t) sysconf(_SC_CLK_TCK);
digit_seen = 0;
for (i = 0; i < 8; i++) a[i] = ' ';
#include <string.h>
#include <time.h>
#include <minix/config.h>
-#include <minix/sysinfo.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/wait.h>
{
int i, m = 0xFFFF, n = 0xF;
- getsysinfo_up(PM_PROC_NR, SIU_SYSTEMHZ, sizeof(system_hz), &system_hz);
+ system_hz = sysconf(_SC_CLK_TCK);
if (strcmp(argv[0], "DO CHECK") == 0) {
timer = atoi(argv[1]);
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
-#include <minix/com.h>
#include <sys/mman.h>
#include <sys/wait.h>
#define CHUNKS1 3
#define CHUNKS2 2
#define CHUNKS (CHUNKS1+CHUNKS2)
+#define LARGESIZE 262144
int i, fd;
char *v[CHUNKS];
#define STARTV 0x90000000
exit(1);
}
} else {
- /* Child performs bogus getsysinfo */
+ /* Child performs bogus read */
int res;
char *buf = v[CHUNKS-1];
errno = 0;
- res = getsysinfo( PM_PROC_NR, SI_PROC_TAB, buf);
+ res = read(fd, buf, LARGESIZE);
if(res >= 0) {
fprintf(stderr, "res %d\n", res);
exit(1);