home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

LA_TYPE

Define your load-average support port, edit sendmail/conf.h

The load average is the average number of blocked processes (processes that are runnable but not able to run because of a lack of resources) over the last minute. The sendmail program can vary its behavior appropriately as the load average changes. Thresholds for change are defined by the options shown in Table 24-9.

The method that is used to get the current load average from the operating system varies widely. This LA_TYPE definition determines which method to use. It is correctly defined inside sendmail/conf.h for all currently supported operating systems. Porting sendmail to a new system might require that you define LA_TYPE yourself. The possible values and their meanings are shown in Table 3-5.

Table 3-5. LA_ Methods for getting the load average

LA_

Does what

LA_ZERO

Always returns 0. Essentially disables load average checking. This is portable to all systems.

LA_INT

Read /dev/kmem for the symbol avenrun. If found, interpret the result as a native (usually long) integer.

LA_FLOAT

Read /dev/kmem for the symbol avenrun. If found, interpret the result as a floating-point value.

LA_SHORT

Read /dev/kmem for the symbol avenrun. If found, interpret the result as a short integer.

LA_SUBR

Call the library routine getloadavg(3) and use the result returned.

LA_MACH

Call the MACH-specific processor_set_info(2) routine and use the result returned.

LA_PROCSTR

Read the Linux-specific /proc/loadavg file and interpret the result as a floating-point value.

LA_READKSYM

Use the (some SysV versions) ioctl of MIOC_READKSYM to read /dev/kmem.

LA_DGUX

DG/UX-specific support for using the dg_sys_info(2) function to read the load average.

LA_HPUX

HP-UX specific support for using the pstat_getdynamic(2) function to read the load average.

LA_IRIX6

Irix 6.x-specific support that adapts to 32- or 64-bit kernels. This is, otherwise, similar to LA_INT.

LA_KSTAT

Solaris specific support for using the kstat(2) function to read the load average.

LA_DEVSHORT

Read a short from a system file and scale it in the same manner as LA_SHORT. The default file is /dev/table/avenrun.

The LA_INT, LA_SHORT, LA_FLOAT, and LA_READKSYM settings require additional tuning. For these, three additional definitions are used, as shown in Table 3-6.

Table 3-6. Tuning for LA_INT, LA_SHORT, LA_FLOAT, and LA_READKSYM

Compile-time macro

Tunes

FSHIFT

Number of bits to shift right when using LA_INT, LA_SHORT, and LA_READKSYM. Default is 8.

_PATH_UNIX

The pathname of your kernel. This is required for LA_INT and LA_SHORT. Default is /unix for SysV; /hp_ux for HP-UX V9; /stand/unix for HP-UX V10, News, and UXP/OS; /dev/ksyms for Solaris; /dynix for DYNIX; otherwise /vmunix.

_PATH_KMEM

The pathname of your kernel memory. This is required for LA_INT, LA_SHORT, LA_FLOAT, and LA_READKSYM. Default is /dev/kmem.

LA_AVENRUN

The name of the kernel variable that holds the load average. Used by LA_INT, LA_SHORT, and LA_FLOAT. Default is averun for SysV, otherwise _averun.

NAMELISTMASK

The mask to bitwise-AND against the return value of nlist(3). If this is undefined, the return value is used as is. A common value is 0x7fffffff to strip off the high bit.

New ports should be reported to sendmail@sendmail.org so that they can be folded into future releases.

    Previous Section Next Section