add swifi to the build/install.
[minix.git] / servers / is / dmp_rs.c
blobeb1d1925fc3e943c05db4c6f68a58b2f740e2310
1 /* This file contains procedures to dump RS data structures.
3 * The entry points into this file are
4 * rproc_dump: display RS system process table
6 * Created:
7 * Oct 03, 2005: by Jorrit N. Herder
8 */
10 #include "inc.h"
11 #include <timers.h>
12 #include <minix/rs.h>
13 #include "../../kernel/priv.h"
14 #include "../rs/const.h"
15 #include "../rs/type.h"
17 PUBLIC struct rprocpub rprocpub[NR_SYS_PROCS];
18 PUBLIC struct rproc rproc[NR_SYS_PROCS];
20 FORWARD _PROTOTYPE( char *s_flags_str, (int flags) );
22 /*===========================================================================*
23 * rproc_dmp *
24 *===========================================================================*/
25 PUBLIC void rproc_dmp()
27 struct rproc *rp;
28 struct rprocpub *rpub;
29 int i,j, n=0;
30 static int prev_i=0;
32 getsysinfo(RS_PROC_NR, SI_PROCPUB_TAB, rprocpub);
33 getsysinfo(RS_PROC_NR, SI_PROC_TAB, rproc);
35 printf("Reincarnation Server (RS) system process table dump\n");
36 printf("----label---- endpoint- -pid- flags -dev- -T- alive_tm starts command\n");
37 for (i=prev_i; i<NR_SYS_PROCS; i++) {
38 rp = &rproc[i];
39 rpub = &rprocpub[i];
40 if (! rp->r_flags & RS_IN_USE) continue;
41 if (++n > 22) break;
42 printf("%13s %9d %5d %5s %3d/%1d %3u %8u %5dx %s",
43 rpub->label, rpub->endpoint, rp->r_pid,
44 s_flags_str(rp->r_flags), rpub->dev_nr, rpub->dev_style,
45 rpub->period, rp->r_alive_tm, rp->r_restarts,
46 rp->r_cmd
48 printf("\n");
50 if (i >= NR_SYS_PROCS) i = 0;
51 else printf("--more--\r");
52 prev_i = i;
56 PRIVATE char *s_flags_str(int flags)
58 static char str[10];
59 str[0] = (flags & RS_IN_USE) ? 'U' : '-';
60 str[1] = (flags & RS_INITIALIZING) ? 'I' : '-';
61 str[2] = (flags & RS_UPDATING) ? 'u' : '-';
62 str[3] = (flags & RS_EXITING) ? 'E' : '-';
63 str[4] = (flags & RS_NOPINGREPLY) ? 'N' : '-';
64 str[5] = '\0';
66 return(str);