Chapter 4. Tips and tricks

4.1. 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 Section 2.1 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 Section 3.3.