ted
ted

Reputation: 4975

linux proc fs documentation

I have a driver that raises some warnings/errors during compilation, since the proc_fs api changed since its creation. The driver still uses create_proc_entry while the latest api version I am aware off, offers proc_create. Since I am new to driver programming under linux I tried to look at the source, however my ctags skills must be lacking since I only found proc_create in proc_fs.h. However, I would like to look at the implementation or some documentation, to know what error codes it returns so I know what I have to handle.

Can you point me to documentation for the proc api, or the source holding the definition of proc_create? A hint how it can be found would be appreciated as well.

Upvotes: 0

Views: 1314

Answers (2)

subin
subin

Reputation: 490

Best documentation for an API would be existing code itself. Check a few c files in fs/proc or grep for proc_create in the source code

Upvotes: 0

harmic
harmic

Reputation: 30577

create_proc is defined as an inline function, so it is fully implemented in the header proc_fs.h. It basically calls proc_create_data with a NULL for the data argument.

There seems very little documentation on these functions in the source so I'd recommend looking at other call sites within the kernel source, which you cam see listed in this LXR search.

BTW, creating new files in /proc seems frowned upon these days - it seems sysfs is where new interfaces should be created.

Upvotes: 1

Related Questions