HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
s
settune(2) settune(2)
NAME
settune() - set the value of a kernel tunable parameter
SYNOPSIS
#include <sys/dyntune.h>
int settune(const char *tunable,
uint64_t value,
unsigned int flags);
DESCRIPTION
This function sets the value of the kernel tunable parameter named tunable to the supplied value. This
new value takes effect immediately, except in the cases noted below.
Some parameters cannot be changed without rebooting the kernel. These parameters cannot be changed
using
settune().
Some parameters represent limits on resources that can be consumed by individual processes. In general,
changes to these parameters do not affect processes that are running at the time the change is made; they
affect only new programs started (with exec() or an equivalent) after that time. Some specific parame-
ters may be exceptions to this general rule; see the man pages for those parameters for details.
Valid values for the flags parameter and their connotations are:
STF_DEFAULT
STF_AUTO
The value of the tunable parameter is set by the kernel. The value parameter
to
settune() is ignored.
STF_NOAUTO Sets the tunable parameter to the value and turns off any automatic tuning
done by the kernel.
The tuneinfo2() call can give information about whether or not changes to a parameter are allowed or
will require a reboot. Some individual parameters may have specific notes regarding their behavior when
changed; consult the parameter man pages for details on each specific parameter.
Security Restrictions
The actions associated with this system call require the SYSATTR privilege. Processes owned by the
superuser have this privilege. Processes owned by other users may have this privilege, depending on sys-
tem configuration. See privileges (5) for more information about privileged access on systems that support
fine-grained privileges.
RETURN VALUE
This function returns one of the following values:
STR_OK The value of the specified parameter has been changed.
STR_ERROR The function did not complete successfully. The value of the specified parameter has
not been changed.
ERRORS
If this function returns STR_ERROR to indicate an error, the global variable errno will be set to one of
the following values to indicate the error that occurred:
[ENOENT] The specified tunable parameter does not exist.
[EFAULT] tunable specifies an address that is inaccessible.
[EPERM] The caller does not have the SYSATTR privilege.
[EINVAL] The specified value is not within the acceptable range for the specified parameter.
[EBUSY] The value of the parameter could not be changed immediately.
[ENOTSUP] The specified parameter cannot be changed without rebooting the kernel.
[EIO] The Kernel Registry Service was unavailable or encountered an error.
[ENOMEM] Insufficient memory to accommodate the new parameter value.
404 Hewlett-Packard Company − 1 − HP-UX 11i Version 3: February 2007