2 * systest.c -- Test code for nooks system calls
4 * Copyright (C) 2002 Mike Swift
6 * The source code in this file can be freely used, adapted,
7 * and redistributed in source or binary form, so long as an
8 * acknowledgment appears in derived source files.
9 * No warranty is attached;
10 * we cannot take responsibility for errors or fitness for use.
14 #include <sys/types.h>
26 printf("Usage: %s -f module_name pid fault-type fault-count seed\n", name
);
32 main(int argc
, char * argv
[])
34 char * module_name
= NULL
;
37 unsigned long arg
= 0;
38 unsigned long seed
= 157;
44 for (i
= 1; i
< argc
; i
++ ) {
45 if (strcmp(argv
[i
], "-f") == 0) {
49 module_name
= victim_exe
= argv
[++i
];
50 sscanf(argv
[++i
],"%u", &victim_pid
);
51 sscanf(argv
[++i
],"%u", &cmd
);
52 sscanf(argv
[++i
],"%lu", &arg
);
53 sscanf(argv
[++i
],"%lu", &seed
);
55 printf("Unknown command %s\n", argv
[i
]);
60 /* Do the injection. */
61 swifi_inject_fault(module_name
,
63 seed
, /* random seed */