title: Creating a simple write only proc entry in kernel
body: <pre><code>#include &lt;linux/module.h&gt;
  #include &lt;linux/kernel.h&gt;
  #include &lt;linux/proc_fs.h&gt;
  #include&lt;linux/sched.h&gt;
  #include &lt;asm/uaccess.h&gt;
  #include &lt;linux/slab.h&gt;
  
  char *msg;
  
  ssize_t write_proc(struct file *filp,const char *buf,size_t count,loff_t *offp)
  {
      copy_from_user(msg,buf,count);
      printk(KERN_INFO "%s",msg);
  
      return count;
  }
  
  struct file_operations proc_fops = {
      write: write_proc
  };
  
  
  int proc_init (void) {
      proc_create("write",0,NULL,&amp;proc_fops);
  
      return 0;
  }
  
  void proc_cleanup(void) {
      remove_proc_entry("write",NULL);
  }
  
  MODULE_LICENSE("GPL"); 
  module_init(proc_init);
  module_exit(proc_cleanup);
  </code></pre>
  
  <p>When I used the command <code>echo 'hello' &gt; /proc/write</code>  Nothing show up on terminal . Can you help me to find mistakes in the code ? The string that I writed on it should have show up on terminal. </p>
  
  <p>Example : </p>
  
  <p>$ echo 'hello' > /proc/write</p>
  
  <p>hello</p>