kernel: Clean up the warning flags a bit.
[dragonfly.git] / test / sysperf / lockmgr1.c
blob2bde240fa64facbe568071721aa09ded0e5fb705
1 /*
2 * varsym..c
4 * varsym [threads]
6 * tests shared lock using varsym_get()
7 */
9 #include "blib.h"
10 #include <sys/varsym.h>
12 int
13 main(int ac, char **av)
15 long long count = 0;
16 long long max;
17 char c;
18 int n;
19 int i;
20 int j;
21 int status;
22 char buf[256];
24 printf("timing standard varsym_get() syscall, VARSYM_SYS\n");
26 start_timing();
27 while (stop_timing(0, NULL) == 0) {
28 varsym_get(VARSYM_SYS_MASK, "fubar", buf, sizeof(buf));
29 ++count;
31 max = count * 4;
33 if (ac > 1)
34 n = strtol(av[1], NULL, 0);
35 else
36 n = 1;
38 start_timing();
39 for (i = 0; i < n; ++i) {
40 if (fork() == 0) {
41 for (count = 0; count < max; ++count) {
42 varsym_get(VARSYM_SYS_MASK, "fubar",
43 buf, sizeof(buf));
45 _exit(0);
48 while (wait3(&status, 0, NULL) >= 0 || errno == EINTR)
50 stop_timing(max * n, "varsym1");
52 return(0);