The HyperNews Linux KHG Discussion Pages

basic module

Forum: The Linux Kernel Hackers' Guide
Date: Wed, 29 Jul 1998 06:55:21 GMT
From: <vano0023@tc.umn.edu>

what's wrong with this code? It will not print out current->pid

#define MODULE
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/module.h>

extern struct task_struct *current;

int init_module() {printk("<0>Process command %s pid %i",current->comm, current->pid); return 0;}

void cleanup_module() {printk("<0>Goodbye\n"); }