Dynamically adding entries to sysctl
问题 Consider this code: int procmon_state = 0; static struct ctl_table_header *procmon_table_header; static ctl_table state_table[] = { { .procname = "state", .mode = 0666, .proc_handler = &proc_dointvec_minmax, .data = &procmon_state, .maxlen = sizeof(int), .extra1 = "\x00\x00\x00\x00" /*0*/, .extra2 = "\x01\x00\x00\x00" /*1*/ }, { 0 } }; static ctl_table procmon_table[] = { { .procname = "procmon", .mode = 0555, .child = state_table }, { 0 } }; procmon_table_header = register_sysctl_table