mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
tunables: Specify a default value for tunables
Enhance dl-tunables.list to allow specifying a default value for a tunable that it would be initialized to. * scripts/gen-tunables.awk: Recognize 'default' keyword in dl-tunables.list. * README.tunables: Document it.
This commit is contained in:
@ -113,6 +113,14 @@ $1 == "}" {
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
else if (attr == "default") {
|
||||
if (types[top_ns][ns][tunable] == "STRING") {
|
||||
default_val[top_ns][ns][tunable] = sprintf(".strval = \"%s\"", val);
|
||||
}
|
||||
else {
|
||||
default_val[top_ns][ns][tunable] = sprintf(".numval = %s", val)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
@ -146,9 +154,9 @@ END {
|
||||
for (n in types[t]) {
|
||||
for (m in types[t][n]) {
|
||||
printf (" {TUNABLE_NAME_S(%s, %s, %s)", t, n, m)
|
||||
printf (", {TUNABLE_TYPE_%s, %s, %s}, {.numval = 0}, NULL, TUNABLE_SECLEVEL_%s, %s},\n",
|
||||
printf (", {TUNABLE_TYPE_%s, %s, %s}, {%s}, NULL, TUNABLE_SECLEVEL_%s, %s},\n",
|
||||
types[t][n][m], minvals[t][n][m], maxvals[t][n][m],
|
||||
security_level[t][n][m], env_alias[t][n][m]);
|
||||
default_val[t][n][m], security_level[t][n][m], env_alias[t][n][m]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user