.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "REGISTER_SYSCTL_TABLE" "9" "17 July 2003" "" "" .SH NAME register_sysctl_table \- register a sysctl hierarchy .SH SYNOPSIS .sp \fB .sp struct ctl_table_header * register_sysctl_table (ctl_table * \fItable\fB, int \fIinsert_at_head\fB); \fR .SH "ARGUMENTS" .TP \fB\fItable\fB\fR the top-level table structure .TP \fB\fIinsert_at_head\fB\fR whether the entry should be inserted in front or at the end .SH "DESCRIPTION" .PP Register a sysctl table hierarchy. \fItable\fR should be a filled in ctl_table array. An entry with a ctl_name of 0 terminates the table. .PP The members of the &ctl_table structure are used as follows: .PP ctl_name - This is the numeric sysctl value used by sysctl(2). The number must be unique within that level of sysctl .PP procname - the name of the sysctl file under /proc/sys. Set to NULL to not enter a sysctl file .PP data - a pointer to data for use by proc_handler .PP maxlen - the maximum size in bytes of the data .PP mode - the file permissions for the /proc/sys file, and for sysctl(2) .PP child - a pointer to the child sysctl table if this entry is a directory, or NULL. .PP proc_handler - the text handler routine (described below) .PP strategy - the strategy routine (described below) .PP de - for internal use by the sysctl routines .PP extra1, extra2 - extra pointers usable by the proc handler routines .PP Leaf nodes in the sysctl tree will be represented by a single file under /proc; non-leaf nodes will be represented by directories. .PP sysctl(2) can automatically manage read and write requests through the sysctl table. The data and maxlen fields of the ctl_table struct enable minimal validation of the values being written to be performed, and the mode field allows minimal authentication. .PP More sophisticated management can be enabled by the provision of a strategy routine with the table entry. This will be called before any automatic read or write of the data is performed. .PP The strategy routine may return .PP < 0 - Error occurred (error is passed to user process) .PP 0 - OK - proceed with automatic read or write. .PP > 0 - OK - read or write has been done by the strategy routine, so return immediately. .PP There must be a proc_handler routine for any terminal nodes mirrored under /proc/sys (non-terminals are handled by a built-in directory handler). Several default handlers are available to cover common cases - .PP \fBproc_dostring\fR, \fBproc_dointvec\fR, \fBproc_dointvec_jiffies\fR, \fBproc_dointvec_minmax\fR, \fBproc_doulongvec_ms_jiffies_minmax\fR, \fBproc_doulongvec_minmax\fR .PP It is the handler's job to read the input buffer from user memory and process it. The handler should return 0 on success. .PP This routine returns NULL on a failure to register, and a pointer to the table header on success. .SH "ABOUT THIS DOCUMENT" .PP This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA .PP For more details see the file COPYING in the source distribution of Linux. .PP If you have comments on the formatting of this manpage, then please contact Michael Still (mikal@stillhq.com). .PP This documentation was generated with kernel version 2.5.72.