File: test.c

package info (click to toggle)
modutils 2.3.11-13.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,156 kB
  • ctags: 1,038
  • sloc: ansic: 10,567; sh: 2,120; lex: 484; makefile: 479; yacc: 362
file content (28 lines) | stat: -rw-r--r-- 468 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <linux/module.h>
#include <linux/version.h>

static int fail=0;
static char modname[40] = { '\0' };
static char *load = modname;
#if LINUX_VERSION_CODE >= 131584 /* 2.2.0 */
#include <linux/kmod.h>
MODULE_PARM(fail, "i");
MODULE_PARM(load, "s");
#else
#include <linux/kerneld.h>
#endif

int init_module(void)
{
  printk("fail=%d\n", fail);
  printk("load=<%s>\n", load);

  if (load[0])
	request_module(load);

  return fail;
}

void cleanup_module(void)
{
}