Scroll to navigation

PROC_DOSTRING(9) The proc filesystem PROC_DOSTRING(9)

NAME

proc_dostring - read a string sysctl

SYNOPSIS

int proc_dostring(struct ctl_table * table, int write, void __user * buffer, size_t * lenp, loff_t * ppos);

ARGUMENTS

table
the sysctl table
write
TRUE if this is a write to the sysctl file
buffer
the user buffer
lenp
the size of the user buffer
ppos
file position

DESCRIPTION

Reads/writes a string from/to the user buffer. If the kernel buffer provided is not large enough to hold the string, the string is truncated. The copied string is NULL-terminated. If the string is being read by the user process, it is copied and a newline '\n' is added. It is truncated if the buffer is not large enough.
Returns 0 on success.

COPYRIGHT

January 2017 Kernel Hackers Manual 4.8.