#include <linux/autoconf.h>
#if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS)
  #define MODVERSIONS
#endif

#if defined(MODVERSIONS)
  /* The names with checksums are to be defined in the following files.
   *   /usr/include/linux/modversions.h
   *   /boot/kernel.h (Generated at every booting time in
   *    /etc/rc.d/rc.sysinit)
   *   /usr/include/linux/modversions-up.h
   *   /usr/include/linux/modversions-smp.h
   *   /usr/include/linux/modversions-BOOT.h
   */
  #include <linux/modversions.h>
#endif

/* Names area declared in the names with checksums. */
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>

static int read_hoge(char * buf, char * * start, off_t offset, int len,
 int unused) {
    len = 0;
    len += sprintf(buf + len, "hoge\n");
    return (len);
}

static struct proc_dir_entry hoge_proc_entry = {
    0,
    4, "hoge",
    S_IFREG | S_IRUGO,
    1, 0, 0,
    0,
    (void *) 0,
    read_hoge,
};

int init_module() {
    /* This will be put in /var/log/messages. */
    printk(KERN_INFO "\"register_proc\" installed.\n");
    proc_register(& proc_root, & hoge_proc_entry);
    return (0);
}

void cleanup_module() {
    proc_unregister(& proc_root, hoge_proc_entry.low_ino);
    printk(KERN_INFO "\"register_proc\" uninstalled.\n");
}


