Here, we do not intend to delve into the gory details of the procfs API set; rather, we shall cover just enough to have you be able to understand and use them. For deeper detail, do refer to the ultimate resource: the kernel code base. The routines we will cover here have been exported, thus making them available to driver authors like you. Also, as we mentioned earlier, all the procfs file objects are really pseudo objects, in the sense that they exist only in RAM.
Let's begin by exploring a few simple procfs APIs that allow you to perform a few key tasks – creating a directory under the proc filesystem, creating (pseudo) files under there, and deleting them, respectively. For all of these tasks, ensure you include the relevant header file;...