Chapter 4. Tips and tricks

Table of Contents
Convenience functions
Modules
Mode and ownership

Convenience functions

struct proc_dir_entry* create_proc_read_entry(const char* name, mode_t mode, struct proc_dir_entry* parent, read_proc_t* read_proc, void* data);

This function creates a regular file in exactly the same way as create_proc_entry from the section called Creating a regular file in Chapter 2 does, but also allows to set the read function read_proc in one call. This function can set the data as well, like explained in the section called A single call back for many files in Chapter 3.