HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)

t
tuneinfo2(2) tuneinfo2(2)
any restrictions on the tunable value based on transient factors like the current usage pattern of
the system.
For example, the maximum value returned for
maxfiles (the number of files a process may
have open) will be no greater than the current value of
nfile (the number of files the system
may have open). However, the minimum value returned for
maxfiles may very well be less
than the number of files that some existing process has open.
uint64_t ti_flags;
A bitmask of zero or more of the following flags:
TIF_CANSET The value of this parameter can be changed using
settune().
TIF_DYNAMIC The value of this parameter can be changed using
settune(), without
requiring a reboot.
TIF_SIGNED The values, minima and maxima, for this parameter should be interpreted as
signed quantities.
TIF_MINVALID The ti_minimum field contains a minimum allowed value for this parame-
ter.
TIF_MAXVALID The ti_maximum field contains a maximum allowed value for this parame-
ter.
The character string location fields, ti_name, ti_oldname , ti_desc, and ti_module , can be used
to retrieve the character strings. These fields must be accessed using the TUNEINFO_STRING()
macro.
The first parameter of the macro is the pointer to the
tuneinfo2_t structure and the second parameter
is one of the four field names above. The result of the macro will be a pointer to a null-terminated string.
See the example below.
RETURN VALUE
If tuneinfo2() is successful, it returns the number of tunable parameters for which information was
returned and sets the value of bufsize to the amount of buffer space used. When the parameters buf and
bufsize are set to NULL and zero, respectively; it returns 0 and sets the value of bufsize to the amount of
buffer space that needs to be preallocated.
ERRORS
If this function returns -1 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.
[ENOSPC] The space in buf, as specified in bufsize, is not sufficient to hold the requested data.
[EFAULT] tunable, buf,orbufsize contains an address that is inaccessible.
[EIO] The Kernel Registry Service was unavailable or encountered an error.
[EINVAL] The version is not supported.
EXAMPLES
#include <stdlib.h>
#include <stdio.h>
#include <sys/dyntune.h>
...
tuneinfo2_t *buf;
size_t bufsize;
int ret;
int count;
int i;
/* To gather information on all tunables: */
/* 1. Find out how much space we need: */
bufsize = 0;
ret = tuneinfo2(TUNEINFO_VERSION, NULL, NULL, &bufsize);
if (ret) {
...
HP-UX 11i Version 2: December 2007 Update 2 Hewlett-Packard Company 503