File: test.c

package info (click to toggle)
modutils 2.4.26-1.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,724 kB
  • ctags: 1,708
  • sloc: ansic: 16,932; sh: 2,998; makefile: 549; lex: 490; yacc: 375
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)
{
}