title: Why is does proc_create mode argument 0 correspond to 0444
body: <p>I am a newbie to kernel programming and am trying to userstand procfs. I have googled several examples and they all use:</p>
  
  <pre> proc_create("hello",0,NULL,&proc_fops);</pre>
  
  <p>where the second argument is the file mode / permission. Per proc_fs.h:</p>
  
  <pre>static inline struct proc_dir_entry *proc_create(
           const char *name, umode_t mode, struct proc_dir_entry *parent,
           const struct file_operations *proc_fops)</pre>
  
  <p>the mode is umode_t type which as far as I can tell is resolved to unsigned short int.</p>
  
  <p>In at least 3 examples, the accompanying comments and verbiage indicate substantially the same thing, that "  the value zero you see there represents the permissions you want on the proc file, where zero represents the default value of file permissions of 0444. In other words, you could have just used tt he numeric value 0444 (for octal), or 0400 for more restrictive access, and so on. But using zero for a typical readable proc file is fairly normal."</p>
  
  <p>I'm having trouble understanding what this means. I understand file permissions, chmod u+x , octal numbers, and I think I understand umask.</p>
  
  <p>I'm just not clear on how 0 maps to 0444, and what would happen if I put 1 there instead of 0.</p>